Updated Translation (markdown)

master
El RIDO 9 years ago
parent 0ffe0e78a3
commit 48e76ba922

@ -5,17 +5,23 @@ The translation concept follows similar concepts as GNU gettext:
- As message IDs we use the original sentences in English. Therefore any untranslated messages will fall back to English and no English translation files need to be added.
- Plural forms are supported.
## Format
## How to translate
tl;dr: Go into the directory `i18n`. Copy any of the files into your languages [two-letter ISO 639-1 code](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes#Partial_ISO_639_table), i.e. to `es.json` for a Spanish. Open the file in a text editor and change the messages after the english message ID. Save the file in UTF-8 character encoding. Done. (Pull requests highly welcome!)
## Technical Details
### Format
As ZeroBin has to provide a logic for both the server and the client side, the format of choice is JSON. You find these files in the directory `i18n`; They have to be accessible through the webserver.
Each translation file is saved under the name of the languages two-letter ISO code and contains one JSON object. The attributes of the object are the message IDs to be translated from English and the values stored in them are the translated strings.
## Dynamic values
### Dynamic values
Often a dynamic value should be inserted into the message. In these cases the message IDs will be ideally full sentences, as the position of these values might change in different languages. The dynamic values are marked by either `%s` for strings or `%d` for numbers in the message ID.
## Plural forms
### Plural forms
Many languages use plural forms and some even more then one. For number dependent messages, an array of strings instead of a string can be set in the value of an attribute. Each language has a rule to decide which element from the array to use, given a certain number. Most languages will have the singular in the first position and the plural in the second. Here is an example for French:

Loading…
Cancel
Save