# HG changeset patch # User Pierre-Yves David # Date 1289319465 -3600 # Node ID 1a423eaee78258a1a793a64f4e19882de4a653d1 # Parent f68bd4c876d1c5a30be0f66fa4e4e02c23e4519a [config, i18n] Create default translation mechanism for all supported languages. Mostly usefull in test where language are never initialised from .po files. diff -r f68bd4c876d1 -r 1a423eaee782 cwconfig.py --- a/cwconfig.py Fri Dec 03 11:24:48 2010 +0000 +++ b/cwconfig.py Tue Nov 09 17:17:45 2010 +0100 @@ -947,6 +947,9 @@ def __init__(self, appid, debugmode=False): self.appid = appid CubicWebNoAppConfiguration.__init__(self, debugmode) + fake_gettext = (unicode, lambda ctx, msgid: unicode(msgid)) + for lang in self.available_languages(): + self.translations[lang] = fake_gettext self._cubes = None self.load_file_configuration(self.main_config_file()) diff -r f68bd4c876d1 -r 1a423eaee782 devtools/__init__.py --- a/devtools/__init__.py Fri Dec 03 11:24:48 2010 +0000 +++ b/devtools/__init__.py Tue Nov 09 17:17:45 2010 +0100 @@ -190,7 +190,7 @@ cube_appobject_path = TestServerConfiguration.cube_appobject_path | TwistedConfiguration.cube_appobject_path def available_languages(self, *args): - return ('en', 'fr', 'de') + return ('en', 'fr', 'de', 'es') def pyro_enabled(self): # but export PYRO_MULTITHREAD=0 or you get problems with sqlite and