Skip to content

Commit

Permalink
finalizing translations.md
Browse files Browse the repository at this point in the history
  • Loading branch information
or-else committed Jul 31, 2021
1 parent 7f2b7f0 commit 5facd9f
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions docs/translations.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ Create a copy of the files naming them `email-password-reset-XX.teml` and `email

## Webapp

The translations are located in two places: [/src/i18n/](https://github.com/tinode/webapp/tree/master/src/i18n/) and [/service-worker.js](https://github.com/tinode/webapp/blob/master/service-worker.js).
The translations are located in two places: [/src/i18n/](https://github.com/tinode/webapp/tree/master/src/i18n/) and [/service-worker.js](https://github.com/tinode/webapp/blob/master/service-worker.js#L11).

In order to add a translation, copy `src/i18n/en.json` to a file named `src/i18n/XX.json` where `XX` is the [BCP-47](https://tools.ietf.org/rfc/bcp/bcp47.txt) code of the new language. If in doubt how to choose the BCP-47 language code, use a two letter [ISO-631-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes). Only the `"translation":` line have to be translated, the `"defaultMessage"`, `"description"` etc should NOT be translated, they serve as help only, i.e.:
In order to add a translation, copy `/src/i18n/en.json` to a file named `/src/i18n/XX.json` where `XX` is the [BCP-47](https://tools.ietf.org/rfc/bcp/bcp47.txt) code of the new language. If in doubt how to choose the BCP-47 language code, use a two letter [ISO-631-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes). Only the `"translation":` line have to be translated, the `"defaultMessage"`, `"description"` etc should NOT be translated, they serve as help only, i.e.:

```js
"action_block_contact": {
Expand Down Expand Up @@ -43,11 +43,16 @@ Please send a pull request with the new files. If you don't know how to create a
A single file needs to be translated: [/tinode/tindroid/app/src/main/res/values/strings.xml](https://github.com/tinode/tindroid/blob/master/app/src/main/res/values/strings.xml)
Create a new directory `values-XX` in [app/src/main/res](https://github.com/tinode/tindroid/tree/master/app/src/main/res), where `XX` is a two-letter [ISO-631-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) code , optionally followed by a two letter [ISO 3166-1-alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) region code (preceded by lowercase r), for example `pt-rBR`: Brazilian Portuguese.
Create a new directory `values-XX` in [app/src/main/res](https://github.com/tinode/tindroid/tree/master/app/src/main/res), where `XX` is a two-letter [ISO-631-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) code , optionally followed by a two letter [ISO 3166-1-alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) region code (preceded by lowercase r). For example `values-pt.xml` would hold Portuguese translations while `values-pt-rBR.xml` Brazilian Portuguese translations.
Make a copy of the file with English strings, place it to the new directory. Translate all the strings not marked with `translatable="false"` (the strings with `translatable="false"` don't need to be included at all) then send a pull request with the new file. If you don't know how to create a pull request then just sent the file in any way you can.
## iOS
The following two files need to be translated:
* [/en.lproj/Localizable.strings](https://github.com/tinode/ios/blob/master/en.lproj/Localizable.strings)
* [/Tinodios/en.lproj/Main.strings](https://github.com/tinode/ios/blob/master/Tinodios/en.lproj/Main.strings)
The iOS process of adding translations is convoluted. Unless you are familiar with the iOS development, please send the translated files to us and we will incorporate them into the project.

0 comments on commit 5facd9f

Please sign in to comment.