# HG changeset patch # User domruf # Date 2016-03-03 18:53:16 # Node ID ff9eba8e25415b6a4c1777bdecf3a6210c69f7ac # Parent 95a33e5d0596b3edc321170606cdc6f38d9de011 localization: set language for formencode based on config file Before, the language would be taken from the environment - such as LANG. Now it will use exactly what has been configured as lang in .ini . The formencode initialization could be done in many places and there is no obvious place ... but this one seems ok. diff --git a/kallithea/config/environment.py b/kallithea/config/environment.py --- a/kallithea/config/environment.py +++ b/kallithea/config/environment.py @@ -23,6 +23,7 @@ import platform import pylons import mako.lookup import beaker +import formencode # don't remove this import it does magic for celery from kallithea.lib import celerypylons @@ -138,4 +139,5 @@ def load_environment(global_conf, app_co if str2bool(config.get('initial_repo_scan', True)): repo2db_mapper(ScmModel().repo_scan(repos_path), remove_obsolete=False, install_git_hooks=False) + formencode.api.set_stdtranslation(languages=[config.get('lang')]) return config