First of all, thanks a lot for considering helping the project by translating it. We truly appreciate it.
All translations are done with crowdin - we'd like to thank them for their gracious help with this project by providing us a free account.
You can open an issue to request a new language.
To enable a new language in Monica:
- we have to configure it in Crowdin first. This is something we must do ourselves (we: members of the project). To do it, we need to go to Settings > Translations > Target Languages and add the new locale here.
- add the name of the language in the main English settings file.
- update the lang-detector.php file by adding the new locale abbreviation.
- add the locale in the webpack.mix.js file.
- (optional) when adding a country-specific language (like 'en-GB'), you may need to update the crowdin.yml config file.
- run
php artisan lang:generate
to generate the new JSON file, and runyarn run production
to compile the JS with those new strings.
Then, submit your PR for review. A good example of adding a new locale can be found here.
Translation appears in two types of files in the codebase: in Laravel (php) and VueJS.
- simple string
- string with parameters: see laravel doc.
To translate: integrate the text replacement in your translation, like ":param".
Example:
:name’s birthday
=>anniversaire de :name
- plural forms: see laravel doc for documentation. It supports basic and occidental plural variations, each one being defined in here.
Example:
1 message|:count messages
=>:count message|:count messages
, or:{1}:count message|[2,*]:count messages
- format strings: we use Carbon to handle dates. format.php file contains format we use to export dates as strings in the right localized format. See php doc to know which format you can use.
We use the vue-i18n package.
- simple string
- string with parameters: see vue-i18n doc.
- To translate: integrate the text replacement in your translation, like
{param}
. - Example:
{name}’s birthday
=>anniversaire de {name}
- Other example:
{{ $t('people.stay_in_touch_frequency', { count: frequency }) }}
- To translate: integrate the text replacement in your translation, like
- plural forms: See vue-i18n doc.
Pluralization is customized in the pluralization.js file. This should fit your language pluralization form. Messages must be separated by a pipe, but you cannot define the number of occurrences it applies to like with Laravel translation (no brackets or braces).
Example:
1 message|{count} messages
=>{count} message|{count} messages
in French, or:{count}条消息
in Chinese (only 1 form)
Please respect typographic rules in your language.
See https://en.wikipedia.org/wiki/Punctuation
- Apostrophe: use real apostrophe character
’
instead of simple quote'
- Quotes: use real quotation marks like
“ ”
or« »
instead of double quote"
- Dash: use en dash
–
instead of hyphen-
when it’s necessary - Interpuct for separate some lists:
·