Skip to content

Commit

Permalink
Begin to translate with Ytranslate
Browse files Browse the repository at this point in the history
  • Loading branch information
vincent-lg committed Sep 16, 2016
1 parent 2f4bbb8 commit 45e6bcc
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 5 deletions.
5 changes: 5 additions & 0 deletions src/cocomud.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
6 changes: 6 additions & 0 deletions src/translations/en/ui/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
menu:
file: "&File"
preferences: "&Preferences\tAlt+Enter"
quit: "&Quit"
game: "&Game"
macro: "&Macro"
12 changes: 7 additions & 5 deletions src/ui/window.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)

Expand Down

0 comments on commit 45e6bcc

Please sign in to comment.