Allow to configure locale path and incubating languages

This commit is contained in:
Raphael Michel
2019-05-29 16:09:20 +02:00
parent 27c3e5d875
commit 58ce1cbab7
2 changed files with 23 additions and 3 deletions

View File

@@ -273,6 +273,24 @@ to speed up various operations::
If redis is not configured, pretix will store sessions and locks in the database. If memcached If redis is not configured, pretix will store sessions and locks in the database. If memcached
is configured, memcached will be used for caching instead of redis. is configured, memcached will be used for caching instead of redis.
Translations
------------
pretix comes with a nubmer of translations. Some of them are marked as "incubating", which means
they can usually only be selected in development mode. If you want to use them nevertheless, you
can activate them like this::
[languages]
allow_incubating=pt-br,da
You can also tell pretix about additional paths where it will search for translations::
[languages]
path=/path/to/my/translations
For a given language (e.g. ``pt-br``), pretix will then look in the
specific subfolder, e.g. ``/path/to/my/translations/pt_BR/LC_MESSAGES/django.po``.
Celery task queue Celery task queue
----------------- -----------------

View File

@@ -378,9 +378,11 @@ USE_I18N = True
USE_L10N = True USE_L10N = True
USE_TZ = True USE_TZ = True
LOCALE_PATHS = ( LOCALE_PATHS = [
os.path.join(os.path.dirname(__file__), 'locale'), os.path.join(os.path.dirname(__file__), 'locale'),
) ]
if config.has_option('languages', 'path'):
LOCALE_PATHS.insert(0, config.get('languages', 'path'))
FORMAT_MODULE_PATH = [ FORMAT_MODULE_PATH = [
'pretix.helpers.formats', 'pretix.helpers.formats',
@@ -407,7 +409,7 @@ LANGUAGES_OFFICIAL = {
} }
LANGUAGES_INCUBATING = { LANGUAGES_INCUBATING = {
'pt-br', 'da', 'pl', 'it', 'el' 'pt-br', 'da', 'pl', 'it', 'el'
} } - set(config.get('languages', 'allow_incubating', fallback='').split(','))
if DEBUG: if DEBUG:
LANGUAGES = ALL_LANGUAGES LANGUAGES = ALL_LANGUAGES