X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=doc%2Fmd%2Fdev%2FTranslations.md;fp=doc%2Fmd%2FTranslations.md;h=8f3b8f10c45f23151eb7d21b6ebe12a66aca6ff1;hb=91a21c272960889afd4eaa431a3d29b7785b6efc;hp=c23ec9627ba3c9e17eb9dfcf3bce12043443ad55;hpb=6128ab6a55430a2b705be31ff417c0c552a0db1f;p=github%2Fshaarli%2FShaarli.git diff --git a/doc/md/Translations.md b/doc/md/dev/Translations.md similarity index 66% rename from doc/md/Translations.md rename to doc/md/dev/Translations.md index c23ec962..8f3b8f10 100644 --- a/doc/md/Translations.md +++ b/doc/md/dev/Translations.md @@ -7,87 +7,80 @@ Note that only the `default` theme supports translations. ### Contributing -We encourage the community to contribute to Shaarli's translation either by improving existing -translations or submitting a new language. +We encourage the community to contribute to Shaarli translations, either by improving existing translations or submitting a new language. -Contributing to the translation does not require development skill. +Contributing to the translation does not require software development knowledge. -Please submit a pull request with the `.po` file updated/created. Note that the compiled file (`.mo`) -is not stored on the repository, and is generated during the release process. +Please submit a pull request with the `.po` file updated/created. Note that the compiled file (`.mo`) is not stored on the repository, and is generated during the release process. -### How to - -First, install [Poedit](https://poedit.net/) tool. - -Poedit will extract strings to translate from the PHP source code. -**Important**: due to the usage of a template engine, it's important to generate PHP cache files to extract -every translatable string. +### How to -You can either use [this script](https://gist.github.com/ArthurHoaro/5d0323f758ab2401ef444a53f54e9a07) (recommended) -or visit every template page in your browser to generate cache files, while logged in. +Install [Poedit](https://poedit.net/) (used to extract strings to translate from the PHP source code, and generate `.po` files). -Here is a list : +Due to the usage of a template engine, it's important to generate PHP cache files to extract every translatable string. You can either use [this script](https://gist.github.com/ArthurHoaro/5d0323f758ab2401ef444a53f54e9a07) (recommended) or visit every template page in your browser to generate cache files, while logged in. Here is a list : ``` http:/// +http:///login +http:///daily +http:///tags/cloud +http:///tags/list +http:///picture-wall http:///?nonope http:///admin/add-shaare http:///admin/password http:///admin/tags http:///admin/configure http:///admin/tools -http:///daily http:///admin/shaare http:///admin/export http:///admin/import -http:///login -http:///picture-wall http:///admin/plugins -http:///tags/cloud -http:///tags/list ``` -#### Improve existing translation - -In Poedit, click on "Edit a Translation", and from Shaarli's directory open -`inc/languages//LC_MESSAGES/shaarli.po`. -The existing list of translatable strings should have been loaded, then click on the "Update" button. +#### Improve existing translations -You can start editing the translation. +- In Poedit, click on "Edit a Translation +- Open `inc/languages//LC_MESSAGES/shaarli.po` under Shaarli's directory +- The existing list of translatable strings should load +- Click on the "Update" button. +- Start editing translations. ![poedit-screenshot](images/poedit-1.jpg) Save when you're done, then you can submit a pull request containing the updated `shaarli.po`. -#### Add a new language - -Open Poedit and select "Create New Translation", then from Shaarli's directory open -`inc/languages//LC_MESSAGES/shaarli.po`. - -Then select the language you want to create. -Click on `File > Save as...`, and save your file in `/inc/language//LC_MESSAGES/shaarli.po`. -`` here should be the language code respecting the [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-2) -format in lowercase (e.g. `de` for German). +#### Add a new language -Then click on the "Update" button, and you can start to translate every available string. +- In Poedit select "Create New Translation" +- Open `inc/languages//LC_MESSAGES/shaarli.po` under Shaarli's directory +- Select the language you want to create. +- Click on `File > Save as...`, save your file in `/inc/language//LC_MESSAGES/shaarli.po` (`` here should be the language code respecting the [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-2) format in lowercase - e.g. `de` for German) +- Click on the "Update" button +- Start editing translations. 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. +[Theme](Theming) 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//language//LC_MESSAGES/.po - tpl//language//LC_MESSAGES/.mo +``` +tpl//language//LC_MESSAGES/.po +tpl//language//LC_MESSAGES/.mo +``` Where `` 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,