Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/indico/indico-plugin-example
example plugin for the new indico plugin system
https://github.com/indico/indico-plugin-example
Last synced: about 1 month ago
JSON representation
example plugin for the new indico plugin system
- Host: GitHub
- URL: https://github.com/indico/indico-plugin-example
- Owner: indico
- Created: 2014-09-17T16:32:28.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2018-09-13T14:05:14.000Z (over 6 years ago)
- Last Synced: 2024-03-25T23:37:37.080Z (9 months ago)
- Language: Python
- Size: 295 KB
- Stars: 1
- Watchers: 15
- Forks: 3
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## Internationalization
### Server-side
Internationalization of Indico plugins is fully supported and, like Indico, relies on [Babel](http://babel.pocoo.org).
Onced you've finished developing your plugin, in order to extract plugin strings to be translated:
```console
$ pybabel extract -o indico_example/translations/messages.pot indico_example -F babel.cfg
$ pybabel extract -o indico_example/translations/messages-js.pot indico_example --no-default-keywords -k 'gettext' -k 'ngettext:1,2' -k '$T' -F babel-js.cfg
```Then in order to add a new language (in this case, `de_DE`):
```console
$ pybabel init -l de_DE -i indico_example/translations/messages.pot -d indico_example/translations/
```Every time there are changes to the `*.pot` file (extracted strings), you will want to update its localized counterparts:
```console
$ pybabel update -i indico_example/translations/messages.pot -l de_DE -d indico_example/translations
```Before packaging/running the plugin, you'll have to compile the `*.po` files.
```console
$ pybabel compile -d indico_example/translations/
```
### JavaScript (client)```console
$ pybabel init -i indico_example/translations/messages-js.pot -l de_DE -d indico_example/translations -D messages-js
$ pybabel update -i indico_example/translations/messages-js.pot -l de_DE -d indico_example/translations -D messages-js
```No compilation of `*.po` files is needed when it comes to JavaScript.