Make Settings.available_locales be a dictionary mapping locale codes to language names in that language

This commit is contained in:
Micah Lee 2018-09-30 15:01:02 -07:00
parent d28f38b1a0
commit 64a4428465
No known key found for this signature in database
GPG Key ID: 403C2657CD994F73

View File

@ -48,11 +48,25 @@ class Settings(object):
else: else:
self.common.log('Settings', '__init__', 'Supplied config does not exist or is unreadable. Falling back to default location') self.common.log('Settings', '__init__', 'Supplied config does not exist or is unreadable. Falling back to default location')
# Available languages in this version of OnionShare # Dictionary of available languages in this version of OnionShare,
self.available_locales = [ # mapped to the language name, in that language.
'cs', 'da', 'de', 'en', 'eo', 'es', 'fi', # TODO: Update language names to not be in English
'fr', 'it', 'nl', 'no', 'pt', 'ru', 'tr' self.available_locales = {
] 'cs': 'Croatian',
'da': 'Danish',
'de': 'German',
'en': 'English',
'eo': 'Esperanto',
'es': 'Spanish',
'fi': 'Finnish',
'fr': 'French',
'it': 'Italian',
'nl': 'Dutch',
'no': 'Norweigan',
'pt': 'Portuguese',
'ru': 'Russian',
'tr': 'Turkish'
}
# These are the default settings. They will get overwritten when loading from disk # These are the default settings. They will get overwritten when loading from disk
self.default_settings = { self.default_settings = {