[config, i18n] Create default translation mechanism for all supported languages.
Mostly usefull in test where language are never initialised from .po files.
--- 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())
--- 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