Settings¶
- django.conf.settings.STATICI_UNDERSCORE_18N_PACKAGES¶
Default: ('django.conf') A list of packages to check for translations.
Can be overrided with the -p/--package option of compileunderscorejsi18n command.
Each string in packages should be in Python dotted-package syntax (the same format as the strings in INSTALLED_APPS) and should refer to a package that contains a locale directory. If you specify multiple packages, all those catalogs are merged into one catalog. This is useful if you have JavaScript that uses strings from different applications.
- django.conf.settings.STATIC_UNDERSCORE_TEMPLATES_DOMAIN¶
Default: underscore_templates filename of generated static js file.
- django.conf.settings.STATIC_UNDERSCORE_TEMPLATES¶
Default: {} Dictionary of variables/template name bindings. Example: .. code-block:: django {
STATIC_UNDERSCORE_TEMPLATES = { ‘popup_template’: ‘_templates/popup.html’,} .. note:
- django.conf.settings.STATIC_UNDERSCORE_I18N_ROOT¶
Default: STATIC_ROOT Controls the file path that catalog files will be written into.
- django.conf.settings.STATICI_UNDERSCORE_I18N_OUTPUT_DIR¶
Default: 'underscore_templates' Controls the directory inside STATIC_UNDERSCORE_I18N_ROOT that generated files will be written into.
- django.conf.settings.STATIC_UNDERSCORE_I18N_FILENAME_FUNCTION¶
Default: 'staticunderscorei18n.utils.default_filename' The dotted path to the function that creates the filename.
The function receives two parameters:
- locale: a string representation of the locale currently processed
- domain: a string representation of the gettext domain used to check for translations
By default, the function returns the path '<language_code>/<domain>.js'.
The final filename is resulted by joining STATIC_UNDERSCORE_I18N_ROOT, STATIC_UNDERSCORE_I18N_OUTPUT_DIR and STATIC_UNDERSCORE_I18N_FILENAME_FUNCTION.
For example, with default settings in place and STATIC_ROOT = 'static', the JavaScript catalog generated for the en_GB locale is: 'static/jsunderscorei18n/en-gb/underscore_templates.js'