Merge pull request from ArthurHoaro/feature/theme-translation

Load theme translations files automatically
This commit is contained in:
ArthurHoaro 2018-03-26 20:26:10 +02:00 committed by GitHub
commit 9b2bd66fb6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 98 additions and 2 deletions

View file

@ -76,6 +76,18 @@ Then click on the "Update" button, and you can start to translate every availabl
Save when you're done, then you can submit a pull request containing the new `shaarli.po`.
### Theme translations
Theme translation extensions are loaded automatically if they're present.
As a theme developer, all you have to do is to add the `.po` and `.mo` compiled file like this:
tpl/<theme name>/language/<lang>/LC_MESSAGES/<theme name>.po
tpl/<theme name>/language/<lang>/LC_MESSAGES/<theme name>.mo
Where `<lang>` is the ISO 3166-1 alpha-2 language code.
Read the following section "Extend Shaarli's translation" to learn how to generate those files.
### Extend Shaarli's translation
If you're writing a custom theme, or a non official plugin, you might want to use the translation system,