Add some comments
parent
20b9aca841
commit
7d2174c9a4
|
@ -63,12 +63,15 @@ class ManjaroHello():
|
||||||
self.default_texts = {}
|
self.default_texts = {}
|
||||||
# Choose best locale for user
|
# Choose best locale for user
|
||||||
if self.preferences["locale"] not in self.locales:
|
if self.preferences["locale"] not in self.locales:
|
||||||
|
# If user's locale is supported
|
||||||
if self.sys_locale in self.locales:
|
if self.sys_locale in self.locales:
|
||||||
self.preferences["locale"] = self.sys_locale
|
self.preferences["locale"] = self.sys_locale
|
||||||
else:
|
else:
|
||||||
|
# If two first letters of user's locale is supported (ex: en_US -> en)
|
||||||
if self.sys_locale[:2] in self.locales:
|
if self.sys_locale[:2] in self.locales:
|
||||||
self.preferences["locale"] = self.sys_locale[:2]
|
self.preferences["locale"] = self.sys_locale[:2]
|
||||||
else:
|
else:
|
||||||
|
# Else use default locale
|
||||||
self.preferences["locale"] = self.default_locale
|
self.preferences["locale"] = self.default_locale
|
||||||
|
|
||||||
# Select current locale in languages menu
|
# Select current locale in languages menu
|
||||||
|
|
Loading…
Reference in New Issue