mirror of
https://github.com/elk-zone/elk.git
synced 2024-11-22 01:15:25 +03:00
chore(i18n): fix arabic on top to avoid changing contributing guide (#1088)
Co-authored-by: Anthony Fu <anthonyfu117@hotmail.com>
This commit is contained in:
parent
81e24440e7
commit
f227ad6e2f
2 changed files with 13 additions and 13 deletions
|
@ -93,9 +93,9 @@ We are using [vue-i18n](https://vue-i18n.intlify.dev/) via [nuxt-i18n](https://i
|
|||
|
||||
1. Add a new file in [locales](./locales) folder with the language code as the filename.
|
||||
2. Copy [en-US](./locales/en-US.json) and translate the strings.
|
||||
3. Add the language to the `locales` array in [config/i18n.ts](./config/i18n.ts#L13)
|
||||
4. If the language is `right-to-left`, add `dir` option with `rtl` value, for example, for [ar-EG](./config/i18n.ts#L79)
|
||||
5. If the language requires special pluralization rules, add `pluralRule` callback option, for example, for [ar-EG](./config/i18n.ts#L80)
|
||||
3. Add the language to the `locales` array in [config/i18n.ts](./config/i18n.ts#L12), below `en` variants and `ar-EG`.
|
||||
4. If the language is `right-to-left`, add `dir` option with `rtl` value, for example, for [ar-EG](./config/i18n.ts#L27)
|
||||
5. If the language requires special pluralization rules, add `pluralRule` callback option, for example, for [ar-EG](./config/i18n.ts#L27)
|
||||
|
||||
Check [Pluralization rule callback](https://vue-i18n.intlify.dev/guide/essentials/pluralization.html#custom-pluralization) for more info.
|
||||
|
||||
|
|
|
@ -20,6 +20,16 @@ const locales: LocaleObjectData[] = [
|
|||
file: 'en-GB.json',
|
||||
name: 'English (UK)',
|
||||
},
|
||||
({
|
||||
code: 'ar-EG',
|
||||
file: 'ar-EG.json',
|
||||
name: 'العربية',
|
||||
dir: 'rtl',
|
||||
pluralRule: (choice: number) => {
|
||||
const name = new Intl.PluralRules('ar-EG').select(choice)
|
||||
return { zero: 0, one: 1, two: 2, few: 3, many: 4, other: 5 }[name]
|
||||
},
|
||||
} satisfies LocaleObjectData),
|
||||
{
|
||||
code: 'de-DE',
|
||||
file: 'de-DE.json',
|
||||
|
@ -72,16 +82,6 @@ const locales: LocaleObjectData[] = [
|
|||
file: 'cs-CZ.json',
|
||||
name: 'Česky',
|
||||
},
|
||||
({
|
||||
code: 'ar-EG',
|
||||
file: 'ar-EG.json',
|
||||
name: 'العربية',
|
||||
dir: 'rtl',
|
||||
pluralRule: (choice: number) => {
|
||||
const name = new Intl.PluralRules('ar-EG').select(choice)
|
||||
return { zero: 0, one: 1, two: 2, few: 3, many: 4, other: 5 }[name]
|
||||
},
|
||||
} satisfies LocaleObjectData),
|
||||
{
|
||||
code: 'tr-TR',
|
||||
file: 'tr-TR.json',
|
||||
|
|
Loading…
Reference in a new issue