Build the wx message catalogs as part of build_wx command, add code to add the catalog dir when wx is imported, and re-enable the unittest that verifies message translation.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxPython/Phoenix/trunk@69451 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robin Dunn
2011-10-18 19:18:11 +00:00
parent c451dcc6ca
commit dea169304b
3 changed files with 17 additions and 1 deletions

View File

@@ -599,6 +599,10 @@ def build_wx(options, args):
traceback.print_exc()
sys.exit(1)
os.chdir(os.path.join(wxDir(), 'locale'))
print 'Building message catalogs'
runcmd('make allmo')
def build_py(options, args):

View File

@@ -48,6 +48,18 @@ def run():
c.find('GetLCID').ignore()
module.addPyCode("""\
#----------------------------------------------------------------------------
# Add the directory where the wxWidgets catalogs were installed
# to the default catalog path, if they were put in the pacakge dir.
import os
_localedir = os.path.join(os.path.dirname(__file__), "locale")
if os.path.exists(_localedir):
Locale.AddCatalogLookupPathPrefix(_localedir)
del os
#----------------------------------------------------------------------------
""")
#-----------------------------------------------------------------
tools.doCommonTweaks(module)
tools.addAutoProperties(module)

View File

@@ -31,7 +31,7 @@ class intl_Tests(wtc.WidgetTestCase):
# This tests if we're able to pull translations from the wx message catalogs
loc = wx.Locale(wx.LANGUAGE_SPANISH)
st = loc.GetString('Next')
#self.assertEqual(st, 'Siguiente')
self.assertEqual(st, 'Siguiente')
def test_intlConstants(self):