-
-
Notifications
You must be signed in to change notification settings - Fork 32
How to add a new language on camptocamp
The rules to add a new language to camptocamp are described in this article.
The first step is to add the new language on Transifex. See the Camptocamp Transifex Account, and an article on how to proceed as a translator.
The second step is to retrieve these ongoing translations on Github. This should be done in the following file: https://github.com/c2corg/c2c_ui/blob/master/.github/workflows/retrieve-i18n.yml
The next step is to add the language in the UI properly. You can inspired yourself from this PR, and be carefull to distinguish locale that are available as content in the API, and the one that are just for the UI.
Note that it is helpfull for translators to have access to the demo of the PR, to see what they are doing.
See for example the addition of chinese and slovenian.
Remember to translate also the automated email (see this pull request).
In order to add languages and permit ES to index the content :
-
update ES settings to create the language settings required for ES indexing process. The difference between the standard and the heavy is the icu_analyzer usage. (ES plugin)
"index_slovene": { "type": "custom", "tokenizer": "standard", "filter": [ "autocomplete_filter", "lowercase" ] }, "slovene_heavy": { "tokenizer": "icu_tokenizer", "filter": [ "lowercase", "icu_folding" ] }, "index_chinois": { "type": "custom", "tokenizer": "standard", "filter": [ "autocomplete_filter" ] }, "chinois_heavy": { "tokenizer": "icu_tokenizer", "filter": [ "lowercase", "icu_folding" ] }
-
Update indice mapping to produce the indexing based upon language settings
"title_sl": { "type": "text", "index": false, "fields": { "ngram": { "type": "text", "analyzer": "index_ngram", "search_analyzer": "search_ngram" }, "raw": { "type": "text", "analyzer": "index_raw", "search_analyzer": "search_raw" }, "contentheavy": { "type": "text", "analyzer": "slovene_heavy" } } }, "title_zh": { "type": "text", "index": false, "fields": { "ngram": { "type": "text", "analyzer": "index_ngram", "search_analyzer": "search_ngram" }, "raw": { "type": "text", "analyzer": "index_raw", "search_analyzer": "search_raw" }, "contentheavy": { "type": "text", "analyzer": "chinois_heavy" } } }
-
Refresh the indice if it was not empty.
- 🏠 Home
- 📋 Changelog
- 🛠️ Dev environment
- 🎉 Resolving issues
- 🤖 CI/CD
- 📝 Tech docs
- 🎓 Courses
- 🤓 Admin