diff --git a/development.ini b/development.ini --- a/development.ini +++ b/development.ini @@ -90,10 +90,12 @@ full_stack = true static_files = true ## Internationalization (see setup documentation for details) -## By default, the language requested by the browser is used if available. -#i18n.enabled = false -## Fallback language, empty for English (valid values are the names of subdirectories in kallithea/i18n): -i18n.lang = +## By default, the languages requested by the browser are used if available, with English as default. +## Set i18n.enabled=false to disable automatic language choice. +#i18n.enabled = true +## To Force a language, set i18n.enabled=false and specify the language in i18n.lang. +## Valid values are the names of subdirectories in kallithea/i18n with a LC_MESSAGES/kallithea.mo +#i18n.lang = en cache_dir = %(here)s/data index_dir = %(here)s/data/index diff --git a/docs/setup.rst b/docs/setup.rst --- a/docs/setup.rst +++ b/docs/setup.rst @@ -80,13 +80,12 @@ The Kallithea web interface is automatic language, as indicated by the browser. Thus, different users may see the application in different languages. If the requested language is not available (because the translation file for that language does not yet exist or is -incomplete), the language specified in setting ``i18n.lang`` in the Kallithea -configuration file is used as fallback. If no fallback language is explicitly -specified, English is used. +incomplete), English is used. If you want to disable automatic language detection and instead configure a fixed language regardless of user preference, set ``i18n.enabled = false`` and -set ``i18n.lang`` to the desired language (or leave empty for English). +specify another language by setting ``i18n.lang`` in the Kallithea +configuration file. Using Kallithea with SSH diff --git a/kallithea/config/app_cfg.py b/kallithea/config/app_cfg.py --- a/kallithea/config/app_cfg.py +++ b/kallithea/config/app_cfg.py @@ -98,6 +98,11 @@ class KallitheaAppConfig(AppConfig): # Disable transaction manager -- currently Kallithea takes care of transactions itself self['tm.enabled'] = False + # Set the i18n source language so TG doesn't search beyond 'en' in Accept-Language. + # Don't force the default here if configuration force something else. + if not self.get('i18n.lang'): + self['i18n.lang'] = 'en' + base_config = KallitheaAppConfig() diff --git a/kallithea/i18n/en/LC_MESSAGES/kallithea.mo b/kallithea/i18n/en/LC_MESSAGES/kallithea.mo new file mode 100644 index 0000000000000000000000000000000000000000..babcfcd322ba8631ee98ce633dbe7dd029faea32 GIT binary patch literal 20 Oc$}NcB6N=d4FCWf1_6oy diff --git a/kallithea/lib/paster_commands/template.ini.mako b/kallithea/lib/paster_commands/template.ini.mako --- a/kallithea/lib/paster_commands/template.ini.mako +++ b/kallithea/lib/paster_commands/template.ini.mako @@ -185,10 +185,12 @@ full_stack = true static_files = true <%text>## Internationalization (see setup documentation for details) -<%text>## By default, the language requested by the browser is used if available. -#i18n.enabled = false -<%text>## Fallback language, empty for English (valid values are the names of subdirectories in kallithea/i18n): -i18n.lang = +<%text>## By default, the languages requested by the browser are used if available, with English as default. +<%text>## Set i18n.enabled=false to disable automatic language choice. +#i18n.enabled = true +<%text>## To Force a language, set i18n.enabled=false and specify the language in i18n.lang. +<%text>## Valid values are the names of subdirectories in kallithea/i18n with a LC_MESSAGES/kallithea.mo +#i18n.lang = en cache_dir = %(here)s/data index_dir = %(here)s/data/index