diff --git a/src/cocomud.py b/src/cocomud.py index dbf5d16..bc8712b 100644 --- a/src/cocomud.py +++ b/src/cocomud.py @@ -2,6 +2,11 @@ import wx +from ytranslate.tools import init, select + +init(root_dir="translations") +select("en") + from game import GameEngine from ui.window import MainWindow diff --git a/src/translations/en/ui/main.yml b/src/translations/en/ui/main.yml new file mode 100644 index 0000000..3416245 --- /dev/null +++ b/src/translations/en/ui/main.yml @@ -0,0 +1,6 @@ +menu: + file: "&File" + preferences: "&Preferences\tAlt+Enter" + quit: "&Quit" + game: "&Game" + macro: "&Macro" diff --git a/src/ui/window.py b/src/ui/window.py index 51d5550..0055a11 100644 --- a/src/ui/window.py +++ b/src/ui/window.py @@ -2,6 +2,8 @@ import wx +from ytranslate.tools import t + from dialogs.preferences import PreferencesDialog from dialogs.macro import MacroDialog from ui.event import EVT_FOCUS, FocusEvent, myEVT_FOCUS @@ -30,22 +32,22 @@ def CreateMenuBar(self): # File menu ## Preferences - preferences = wx.MenuItem(fileMenu, -1, '&Preferences\tAlt+Enter') + preferences = wx.MenuItem(fileMenu, -1, t("ui.main.menu.preferences")) self.Bind(wx.EVT_MENU, self.OnPreferences, preferences) fileMenu.AppendItem(preferences) ## Quit - quit = wx.MenuItem(fileMenu, -1, '&Quit\tCtrl+Q') + quit = wx.MenuItem(fileMenu, -1, t("ui.main.menu.quit")) self.Bind(wx.EVT_MENU, self.OnQuit, quit) fileMenu.AppendItem(quit) # Game menu - macro = wx.MenuItem(fileMenu, -1, '&Macro') + macro = wx.MenuItem(fileMenu, -1, t("ui.main.menu.macro")) self.Bind(wx.EVT_MENU, self.OnMacro, macro) gameMenu.AppendItem(macro) - menubar.Append(fileMenu, '&File') - menubar.Append(gameMenu, '&Game') + menubar.Append(fileMenu, t("ui.main.menu.file")) + menubar.Append(gameMenu, t("ui.main.menu.game")) self.SetMenuBar(menubar)