From dea169304be0ce85501103142915ef55c4c5e9ce Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Tue, 18 Oct 2011 19:18:11 +0000 Subject: [PATCH] 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 --- build.py | 4 ++++ etg/intl.py | 12 ++++++++++++ unittests/test_intl.py | 2 +- 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/build.py b/build.py index 096ba19c..115663fd 100755 --- a/build.py +++ b/build.py @@ -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): diff --git a/etg/intl.py b/etg/intl.py index 74dd00df..b18a1751 100644 --- a/etg/intl.py +++ b/etg/intl.py @@ -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) diff --git a/unittests/test_intl.py b/unittests/test_intl.py index 5f97a575..08a2316c 100644 --- a/unittests/test_intl.py +++ b/unittests/test_intl.py @@ -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):