-
-
Notifications
You must be signed in to change notification settings - Fork 403
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Better documentation * Fix doc * Fix doc about en.po * Update labeler.yml Co-authored-by: Stéphane Gigandet <stephane@openfoodfacts.org> Co-authored-by: Pierre Slamich <pierre@openfoodfacts.org>
- Loading branch information
1 parent
22bf228
commit 3ccb0f2
Showing
2 changed files
with
25 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,25 @@ | ||
### Translations | ||
You can translate Open Food Facts at https://translate.openfoodfacts.org. Please do not translate directly in the code, or your translations will be overwritten. | ||
If you have added or modified a string in the source file (the file with the .pot extension), you should update the crowdin-trigger branch from main/develop. This will trigger import within Crowdin, and 1 hour later, it will create a new pull request with added or modified strings in all language files, plus all added or modified translations. | ||
You can translate Open Food Facts at https://translate.openfoodfacts.org thanks to the Crowdin platform. Please do not translate directly in the code, or your translations will be overwritten. | ||
|
||
If you want to add a translatable string in the code: | ||
* modify the file with the `.pot` extension related to your context. Eg. | ||
```pot | ||
msgctxt "name_of_your_string" | ||
msgid "Hello world!" | ||
msgstr "" | ||
``` | ||
* modify the file `en.po` related to your context, to be sure at least an english string will be displayed before Crowdin send back all `.po` files (which can take several days). It should be the same code as the one from `.pot` + the english transaltion (see `msgstr` field). Eg. | ||
```po | ||
msgctxt "name_of_your_string" | ||
msgid "Hello world!" | ||
msgstr "Hello world!" | ||
``` | ||
* use your new string with the `lang()` function. Eg. in a template file: `[% lang('name_of_your_string') %]` | ||
* if you want to test your modifications in your dev environnement: | ||
* modify the `fr.po` files if you want to test in French; be aware it's just for test: these files will be overwritten by Crowdin. Eg. in French: | ||
```pot | ||
msgctxt "name_of_your_string" | ||
msgid "Hello world!" | ||
msgstr "Salut le monde!" | ||
``` | ||
* don't forget to `make build_lang` to let docker take your modifications into account |