en_US is always available
We were using "en" as fallback only when no preferred language matched. This is obviously bad. Always insert en_US as available locale, so we can match it with the accept_languages. Don't set available_locales as mg_global, per discussion with paroneaya, make it a global var in translate.py Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
This commit is contained in:
@@ -19,7 +19,7 @@ from beaker.util import parse_cache_config_options
|
||||
import jinja2
|
||||
|
||||
from mediagoblin.tools import staticdirect
|
||||
from mediagoblin.tools.translate import get_available_locales
|
||||
from mediagoblin.tools.translate import set_available_locales
|
||||
from mediagoblin.init.config import (
|
||||
read_mediagoblin_config, generate_validation_report)
|
||||
from mediagoblin import mg_globals
|
||||
@@ -40,7 +40,7 @@ class ImproperlyConfigured(Error):
|
||||
|
||||
def setup_locales():
|
||||
"""Checks which language translations are available and sets them"""
|
||||
setup_globals(available_locales=get_available_locales())
|
||||
set_available_locales()
|
||||
|
||||
|
||||
def setup_global_and_app_config(config_path):
|
||||
|
||||
Reference in New Issue
Block a user