Project

General

Profile

« Previous | Next » 

Revision e848148a

Added by Adam Ruzicka about 1 year ago

Fixes #36330 - Fix plugin translations in frontend

- Add plugin:po_to_json rake task
- Load js locale files for all plugins
- Make i18n.js do multi-domain lookup

View differences:

developer_docs/how_to_create_a_plugin.asciidoc
$ mkdir ../foreman_plugin/locale
$ mkdir ../foreman_plugin/locale/en
$ rake plugin:gettext[foreman_plugin]
$ rake plugin:po_to_json[foreman_plugin]
----
This should create locale/foreman_plugin.pot file. Edit the header
......
`make -C locale tx-update`
2. In the Foreman dir, merge the updates into the PO files:
`rake plugin:gettext[foreman_plugin]`
3. In the plugin dir, rebuild the MO files: `make -C locale mo-files`
3. In the Foreman dir, generate files with translations for use in frontend:
`rake plugin:po_to_json[foreman_plugin]`
4. In the plugin dir, rebuild the MO files: `make -C locale mo-files`
These files should be .gitignored:
......
These files must be committed to git:
....
app/assets/javascripts/locale/**/*.js
locale/foreman_plugin.pot +
locale/*/foreman_plugin.po +
locale/*/LC_MESSAGES/foreman_plugin.mo

Also available in: Unified diff