diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 41e1cf355..a1790b620 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -340,12 +340,12 @@ To add a new locale: 5. If the language is `right-to-left`, add `dir: 'rtl'` (see `ar-EG` in config for example) 6. If the language requires special pluralization rules, add a `pluralRule` callback (see `ar-EG` or `ru-RU` in config for examples) -Check [Pluralization rule callback](https://vue-i18n.intlify.dev/guide/essentials/pluralization.html#custom-pluralization) for more info. +Check [Pluralization rule callback](https://vue-i18n.intlify.dev/guide/essentials/pluralization#custom-pluralization) and [Plural Rules](https://cldr.unicode.org/index/cldr-spec/plural-rules#TOC-Determining-Plural-Categories) for more info. ### Update translation We track the current progress of translations with [Lunaria](https://lunaria.dev/) on this site: https://i18n.npmx.dev/ -If you see any outdated translations in your language, feel free to update the keys to match then English version. +If you see any outdated translations in your language, feel free to update the keys to match the English version. In order to make sure you have everything up-to-date, you can run: @@ -408,6 +408,43 @@ See how `es`, `es-ES`, and `es-419` are configured in [config/i18n.ts](./config/
{{ $t('greeting', { name: userName }) }}
``` +4. Don't concatenate string messages in the Vue templates, some languages can have different word order. Use placeholders instead. + + **Bad:** + + ```vue +{{ $t('hello') }} {{ userName }}
+ ``` + + **Good:** + + ```vue +{{ $t('greeting', { name: userName }) }}
+ ``` + + **Complex content:** + + If you need to include HTML or components inside the translation, use [`i18n-t`](https://vue-i18n.intlify.dev/guide/advanced/component.html) component. This is especially useful when the order of elements might change between languages. + + ```json + { + "agreement": "I accept the {terms} and {privacy}.", + "terms_link": "Terms of Service", + "privacy_policy": "Privacy Policy" + } + ``` + + ```vue +