Skip to content

Commit 0805720

Browse files
skaldebaneautofix-ci[bot]danielroe
authored
feat: arabic i18n (#274)
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> Co-authored-by: Daniel Roe <daniel@roe.dev>
1 parent 6378bee commit 0805720

11 files changed

Lines changed: 1535 additions & 62 deletions

File tree

app/components/PackageVersions.vue

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -508,7 +508,13 @@ function getTagVersions(tag: string): VersionDisplay[] {
508508
<span class="text-xs text-fg-muted py-1.5">
509509
{{ $t('package.versions.other_versions') }}
510510
<span v-if="hiddenTagRows.length > 0" class="text-fg-subtle">
511-
({{ $t('package.versions.more_tagged', { count: hiddenTagRows.length }) }})
511+
({{
512+
$t(
513+
'package.versions.more_tagged',
514+
{ count: hiddenTagRows.length },
515+
hiddenTagRows.length,
516+
)
517+
}})
512518
</span>
513519
</span>
514520
</button>

app/pages/search.vue

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -886,7 +886,13 @@ defineOgImageComponent('Default', {
886886
role="status"
887887
class="text-fg-muted text-sm mt-4 font-mono"
888888
>
889-
{{ $t('search.found_packages', { count: formatNumber(visibleResults.total) }) }}
889+
{{
890+
$t(
891+
'search.found_packages',
892+
{ count: formatNumber(visibleResults.total) },
893+
visibleResults.total,
894+
)
895+
}}
890896
<span v-if="status === 'pending'" class="text-fg-subtle">{{
891897
$t('search.updating')
892898
}}</span>

config/i18n.ts

Lines changed: 57 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -13,26 +13,26 @@ interface LocaleObjectData extends LocaleObject {
1313
}
1414

1515
export const countryLocaleVariants: Record<string, (LocaleObjectData & { country?: boolean })[]> = {
16-
/*ar: [
17-
// ar.json contains ar-EG translations
18-
// { code: 'ar-DZ', name: 'Arabic (Algeria)' },
19-
// { code: 'ar-BH', name: 'Arabic (Bahrain)' },
20-
{ country: true, code: 'ar-EG', name: 'العربية' },
21-
// { code: 'ar-EG', name: 'Arabic (Egypt)' },
22-
// { code: 'ar-IQ', name: 'Arabic (Iraq)' },
23-
// { code: 'ar-JO', name: 'Arabic (Jordan)' },
24-
// { code: 'ar-KW', name: 'Arabic (Kuwait)' },
25-
// { code: 'ar-LB', name: 'Arabic (Lebanon)' },
26-
// { code: 'ar-LY', name: 'Arabic (Libya)' },
27-
// { code: 'ar-MA', name: 'Arabic (Morocco)' },
28-
// { code: 'ar-OM', name: 'Arabic (Oman)' },
29-
// { code: 'ar-QA', name: 'Arabic (Qatar)' },
30-
// { code: 'ar-SA', name: 'Arabic (Saudi Arabia)' },
31-
// { code: 'ar-SY', name: 'Arabic (Syria)' },
32-
// { code: 'ar-TN', name: 'Arabic (Tunisia)' },
33-
// { code: 'ar-AE', name: 'Arabic (U.A.E.)' },
34-
// { code: 'ar-YE', name: 'Arabic (Yemen)' },
35-
],*/
16+
ar: [
17+
// ar.json contains ar-EG translations
18+
// { code: 'ar-DZ', name: 'Arabic (Algeria)' },
19+
// { code: 'ar-BH', name: 'Arabic (Bahrain)' },
20+
{ country: true, code: 'ar-EG', name: 'العربية' },
21+
// { code: 'ar-EG', name: 'Arabic (Egypt)' },
22+
// { code: 'ar-IQ', name: 'Arabic (Iraq)' },
23+
// { code: 'ar-JO', name: 'Arabic (Jordan)' },
24+
// { code: 'ar-KW', name: 'Arabic (Kuwait)' },
25+
// { code: 'ar-LB', name: 'Arabic (Lebanon)' },
26+
// { code: 'ar-LY', name: 'Arabic (Libya)' },
27+
// { code: 'ar-MA', name: 'Arabic (Morocco)' },
28+
// { code: 'ar-OM', name: 'Arabic (Oman)' },
29+
// { code: 'ar-QA', name: 'Arabic (Qatar)' },
30+
// { code: 'ar-SA', name: 'Arabic (Saudi Arabia)' },
31+
// { code: 'ar-SY', name: 'Arabic (Syria)' },
32+
// { code: 'ar-TN', name: 'Arabic (Tunisia)' },
33+
// { code: 'ar-AE', name: 'Arabic (U.A.E.)' },
34+
// { code: 'ar-YE', name: 'Arabic (Yemen)' },
35+
],
3636
en: [
3737
// en.json contains en-US translations
3838
{ country: true, code: 'en-US', name: 'English (US)' },
@@ -84,47 +84,46 @@ const locales: (Omit<LocaleObjectData, 'code'> & { code: string })[] = [
8484
file: 'en.json',
8585
name: 'English',
8686
},
87+
{
88+
code: 'ar-EG',
89+
file: 'ar.json',
90+
name: 'العربية',
91+
dir: 'rtl',
92+
pluralRule: (choice: number) => {
93+
const name = new Intl.PluralRules('ar-EG').select(choice)
94+
return { zero: 0, one: 1, two: 2, few: 3, many: 4, other: 5 }[name]
95+
},
96+
} satisfies LocaleObjectData,
8797
/*{
88-
code: 'ar',
89-
file: 'ar.json',
90-
name: 'العربية',
91-
dir: 'rtl',
92-
pluralRule: (choice: number) => {
93-
const name = new Intl.PluralRules('ar-EG').select(choice)
94-
return { zero: 0, one: 1, two: 2, few: 3, many: 4, other: 5 }[name]
95-
},
96-
} satisfies LocaleObjectData,
97-
{
98-
code: 'ckb',
99-
file: 'ckb.json',
100-
name: 'کوردیی ناوەندی',
101-
dir: 'rtl',
102-
pluralRule: (choice: number) => {
103-
const name = new Intl.PluralRules('ckb').select(choice)
104-
return { zero: 0, one: 1, two: 2, few: 3, many: 4, other: 5 }[name]
105-
},
106-
} satisfies LocaleObjectData,
107-
{
108-
code: 'fa-IR',
109-
file: 'fa-IR.json',
110-
name: 'فارسی',
111-
dir: 'rtl',
112-
pluralRule: (choice: number) => {
113-
const name = new Intl.PluralRules('fa-IR').select(choice)
114-
return { zero: 0, one: 1, two: 2, few: 3, many: 4, other: 5 }[name]
115-
},
116-
} satisfies LocaleObjectData,
117-
{
118-
code: 'ca',
119-
file: 'ca.json',
120-
name: 'Català',
98+
code: 'ckb',
99+
file: 'ckb.json',
100+
name: 'کوردیی ناوەندی',
101+
dir: 'rtl',
102+
pluralRule: (choice: number) => {
103+
const name = new Intl.PluralRules('ckb').select(choice)
104+
return { zero: 0, one: 1, two: 2, few: 3, many: 4, other: 5 }[name]
121105
},
122-
{
123-
code: 'el-GR',
124-
file: 'el-GR.json',
125-
name: 'Ελληνικά',
106+
} satisfies LocaleObjectData,
107+
{
108+
code: 'fa-IR',
109+
file: 'fa-IR.json',
110+
name: 'فارسی',
111+
dir: 'rtl',
112+
pluralRule: (choice: number) => {
113+
const name = new Intl.PluralRules('fa-IR').select(choice)
114+
return { zero: 0, one: 1, two: 2, few: 3, many: 4, other: 5 }[name]
126115
},
127-
*/
116+
} satisfies LocaleObjectData,
117+
{
118+
code: 'ca',
119+
file: 'ca.json',
120+
name: 'Català',
121+
},
122+
{
123+
code: 'el-GR',
124+
file: 'el-GR.json',
125+
name: 'Ελληνικά',
126+
},*/
128127
{
129128
code: 'de-DE',
130129
file: 'de-DE.json',

i18n/locales/ar-EG.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{}

0 commit comments

Comments
 (0)