Changeset - ff9eba8e2541
[Not reviewed]
default
0 1 0
domruf - 10 years ago 2016-03-03 18:53:16
dominikruf@gmail.com
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.
1 file changed with 2 insertions and 0 deletions:
0 comments (0 inline, 0 general)
kallithea/config/environment.py
Show inline comments
 
@@ -14,24 +14,25 @@
 
"""
 
    Pylons environment configuration
 
"""
 

	
 
import os
 
import logging
 
import kallithea
 
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
 

	
 
import kallithea.lib.app_globals as app_globals
 

	
 
from kallithea.config.routing import make_map
 

	
 
from kallithea.lib import helpers
 
from kallithea.lib.auth import set_available_permissions
 
from kallithea.lib.utils import repo2db_mapper, make_ui, set_app_settings, \
 
    load_rcextensions, check_git_version, set_vcs_config, set_indexer_config
 
@@ -129,13 +130,14 @@ def load_environment(global_conf, app_co
 
    # store config reference into our module to skip import magic of
 
    # pylons
 
    kallithea.CONFIG.update(config)
 
    set_vcs_config(kallithea.CONFIG)
 
    set_indexer_config(kallithea.CONFIG)
 

	
 
    #check git version
 
    check_git_version()
 

	
 
    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
0 comments (0 inline, 0 general)