i18n: implement LocaleSettings, use wx.GetTranslation instead of gettext
(cherry picked from commit 3648a5c8c7b230a4b695a29ebfaad3877e7b644f)
This commit is contained in:
@@ -22,6 +22,7 @@ import os.path
|
||||
import urllib.request
|
||||
import urllib.error
|
||||
import urllib.parse
|
||||
import wx
|
||||
|
||||
from logbook import Logger
|
||||
|
||||
@@ -533,3 +534,26 @@ class GraphSettings:
|
||||
|
||||
def set(self, type, value):
|
||||
self.settings[type] = value
|
||||
|
||||
|
||||
class LocaleSettings:
|
||||
_instance = None
|
||||
|
||||
@classmethod
|
||||
def getInstance(cls):
|
||||
if cls._instance is None:
|
||||
cls._instance = LocaleSettings()
|
||||
return cls._instance
|
||||
|
||||
def __init__(self):
|
||||
|
||||
defaults = {
|
||||
'locale': wx.LANGUAGE_DEFAULT
|
||||
}
|
||||
self.settings = SettingsProvider.getInstance().getSettings('localeSettings', defaults)
|
||||
|
||||
def get(self, key):
|
||||
return self.settings[key]
|
||||
|
||||
def set(self, key, value):
|
||||
self.settings[key] = value
|
||||
|
||||
Reference in New Issue
Block a user