Management commands¶
compilejsi18n¶
Collect JavaScript catalog files in a single location.
Some commonly used options are:
-l LOCALEor--locale=LOCALEThe locale to process. Default is to process all but if for some reason I18N features are disabled, only settings.LANGUAGE_CODE will be processed.
-d DOMAINor--domain=DOMAINOverride the gettext domain. By default, the command uses the
djangojsgettext domain.-p PACKAGESor-packages=PACKAGESA list of packages to check for translations. Default is
'django.conf'. Use multiple times to add more.-o OUPUT_DIRor--output=OUTPUT_DIROutput directory to store generated catalogs. Defaults to the joining path of
STATICI18N_ROOTandSTATICI18N_OUTPUT_DIR.-f OUTPUT_FORMATor--format=OUTPUT_FORMAT- Format of the output catalog. Options are:
js,json.
Defaults to
js.-n NAMESPACEor--namespace=NAMESPACEThe final gettext will be put with window.SpecialBlock.gettext rather than the window.gettext. This is useful for pluggable modules which need Javascript i18n.
Defaults to
None.
For a full list of options, refer to the compilejsi18n management command
help by running:
$ python manage.py compilejsi18n --help
Note
Missing directories will be created on-the-fly by the command when invoked.