mirror of
https://github.com/pretix/pretix.git
synced 2026-05-04 15:04:03 +00:00
i18n: add config for enabling a set of languages
Adds the `enabled` setting to the `[languages]` table in the pretix.cfg. If left empty, or omitted all languages are enabled.
This commit is contained in:
committed by
Raphael Michel
parent
a43625c5e8
commit
18df9d66bb
@@ -495,11 +495,14 @@ LANGUAGES_INCUBATING = {
|
||||
LANGUAGES_RTL = {
|
||||
'ar', 'hw'
|
||||
}
|
||||
|
||||
if DEBUG:
|
||||
LANGUAGES = ALL_LANGUAGES
|
||||
else:
|
||||
LANGUAGES = [(k, v) for k, v in ALL_LANGUAGES if k not in LANGUAGES_INCUBATING]
|
||||
LANGUAGES = []
|
||||
LANGUAGES_ENABLED = [lang for lang in config.get("languages", "enabled", fallback='').split(',') if lang]
|
||||
for k, v in ALL_LANGUAGES:
|
||||
if not DEBUG and k in LANGUAGES_INCUBATING:
|
||||
continue
|
||||
if LANGUAGES_ENABLED and k not in LANGUAGES_ENABLED:
|
||||
continue
|
||||
LANGUAGES.append((k, v))
|
||||
|
||||
|
||||
EXTRA_LANG_INFO = {
|
||||
|
||||
Reference in New Issue
Block a user