Management Commands
Regenerate and compile the web console’s gettext message catalogs.
- class smarter.apps.dashboard.management.commands.update_console_messages.Command(*args, **kwargs)[source]
Bases:
SmarterCommandDjango manage.py update_console_messages command.
Regenerates
smarter/smarter/locale/<language>/LC_MESSAGES/django.po, from the Django templates and Python code, anddjangojs.po, from the React apps’ messages inreact/i18n/messages.js, for each language insettings.LANGUAGES, then compiles them to.mofiles. Translations already in the.pofiles are kept.Run
npm run i18n:extractinsmarter/reactfirst, ormake i18n-messages, which does both.- help = "Regenerate the web console's message catalogs, django.po and djangojs.po, in smarter/smarter/locale, for each language in settings.LANGUAGES, and compile them."
- smarter.apps.dashboard.management.commands.update_console_messages.DJANGO_IGNORE_PATTERNS = ['react', 'static', 'staticfiles', 'node_modules', 'requirements', 'venv']
the.
React workspace (the djangojs domain), and static and third-party files, which hold no web console messages.
['react', 'static', 'staticfiles', 'node_modules', 'requirements', 'venv']
- Type:
Directories, under the project root, that makemessages skips for the django domain
- smarter.apps.dashboard.management.commands.update_console_messages.REACT_MESSAGES_DIR = PosixPath('react/i18n')
Where
npm run i18n:extractwritesmessages.js, the React apps’ messages, relative to.the project root. makemessages reads only this directory for the djangojs domain.