mirror of
https://github.com/wxWidgets/Phoenix.git
synced 2026-01-06 12:00:13 +01:00
Merge pull request #708 from swprojects/i18nwxapp
Small fixes to i18nwxapp
This commit is contained in:
@@ -19,11 +19,11 @@ import wx
|
|||||||
|
|
||||||
def _displayHook(obj):
|
def _displayHook(obj):
|
||||||
if obj is not None:
|
if obj is not None:
|
||||||
print repr(obj)
|
print (repr(obj))
|
||||||
|
|
||||||
# add translation macro to builtin similar to what gettext does
|
# add translation macro to builtin similar to what gettext does
|
||||||
import __builtin__
|
import builtins
|
||||||
__builtin__.__dict__['_'] = wx.GetTranslation
|
builtins.__dict__['_'] = wx.GetTranslation
|
||||||
|
|
||||||
import app_const as appC
|
import app_const as appC
|
||||||
|
|
||||||
|
|||||||
@@ -48,18 +48,18 @@ tCmd = pyExe + ' ' + pyGettext + ' ' + (gtOptions % (appC.langDomain,
|
|||||||
appC.langDomain,
|
appC.langDomain,
|
||||||
outFolder,
|
outFolder,
|
||||||
appFolder))
|
appFolder))
|
||||||
print "Generating the .pot file"
|
print ("Generating the .pot file")
|
||||||
print "cmd: %s" % tCmd
|
print ("cmd: %s" % tCmd)
|
||||||
rCode = subprocess.call(tCmd)
|
rCode = subprocess.call(tCmd)
|
||||||
print "return code: %s\n\n" % rCode
|
print ("return code: %s\n\n" % rCode)
|
||||||
|
|
||||||
for tLang in supportedLang:
|
for tLang in supportedLang:
|
||||||
# build command for msgfmt
|
# build command for msgfmt
|
||||||
langDir = os.path.join(appFolder, ('locale\%s\LC_MESSAGES' % tLang))
|
langDir = os.path.join(appFolder, ('locale\%s\LC_MESSAGES' % tLang))
|
||||||
poFile = os.path.join(langDir, appC.langDomain + '.po')
|
poFile = os.path.join(langDir, appC.langDomain + '.po')
|
||||||
tCmd = pyExe + ' ' + pyMsgfmt + ' ' + poFile
|
tCmd = pyExe + ' ' + pyMsgfmt + ' ' + poFile
|
||||||
|
|
||||||
print "Generating the .mo file"
|
print ("Generating the .mo file")
|
||||||
print "cmd: %s" % tCmd
|
print ("cmd: %s" % tCmd)
|
||||||
rCode = subprocess.call(tCmd)
|
rCode = subprocess.call(tCmd)
|
||||||
print "return code: %s\n\n" % rCode
|
print ("return code: %s\n\n" % rCode)
|
||||||
|
|||||||
Binary file not shown.
@@ -83,7 +83,7 @@ class AppI18N(sc.SizedFrame):
|
|||||||
defaultDir=os.getcwd(),
|
defaultDir=os.getcwd(),
|
||||||
defaultFile="",
|
defaultFile="",
|
||||||
wildcard=wildcard,
|
wildcard=wildcard,
|
||||||
style=wx.OPEN | wx.MULTIPLE | wx.CHANGE_DIR
|
style=wx.FD_OPEN | wx.FD_MULTIPLE | wx.FD_CHANGE_DIR
|
||||||
) as dlg:
|
) as dlg:
|
||||||
|
|
||||||
# Show the dialog and retrieve the user response. If it is the
|
# Show the dialog and retrieve the user response. If it is the
|
||||||
|
|||||||
@@ -66,7 +66,7 @@ The ``.pot`` file is then provided to the translators and they use it to
|
|||||||
generate a ``.po`` file for the language they translate too or they can also use
|
generate a ``.po`` file for the language they translate too or they can also use
|
||||||
the ``.pot`` file to merge new/changed text strings to an existing ``.po`` file.
|
the ``.pot`` file to merge new/changed text strings to an existing ``.po`` file.
|
||||||
|
|
||||||
To do the actual translation we recomment `poEdit` [2]_ , it allows you to
|
To do the actual translation we recommend `poEdit` [2]_ , it allows you to
|
||||||
create or update a translation catalog (``.po`` file) from the ``.pot`` file.
|
create or update a translation catalog (``.po`` file) from the ``.pot`` file.
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user