Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion app/components/PackageVersions.vue
Original file line number Diff line number Diff line change
Expand Up @@ -508,7 +508,13 @@ function getTagVersions(tag: string): VersionDisplay[] {
<span class="text-xs text-fg-muted py-1.5">
{{ $t('package.versions.other_versions') }}
<span v-if="hiddenTagRows.length > 0" class="text-fg-subtle">
({{ $t('package.versions.more_tagged', { count: hiddenTagRows.length }) }})
({{
$t(
'package.versions.more_tagged',
{ count: hiddenTagRows.length },
hiddenTagRows.length,
)
}})
</span>
</span>
</button>
Expand Down
8 changes: 7 additions & 1 deletion app/pages/search.vue
Original file line number Diff line number Diff line change
Expand Up @@ -886,7 +886,13 @@ defineOgImageComponent('Default', {
role="status"
class="text-fg-muted text-sm mt-4 font-mono"
>
{{ $t('search.found_packages', { count: formatNumber(visibleResults.total) }) }}
{{
$t(
'search.found_packages',
{ count: formatNumber(visibleResults.total) },
visibleResults.total,
)
}}
<span v-if="status === 'pending'" class="text-fg-subtle">{{
$t('search.updating')
}}</span>
Expand Down
115 changes: 57 additions & 58 deletions config/i18n.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,26 +13,26 @@ interface LocaleObjectData extends LocaleObject {
}

export const countryLocaleVariants: Record<string, (LocaleObjectData & { country?: boolean })[]> = {
/*ar: [
// ar.json contains ar-EG translations
// { code: 'ar-DZ', name: 'Arabic (Algeria)' },
// { code: 'ar-BH', name: 'Arabic (Bahrain)' },
{ country: true, code: 'ar-EG', name: 'العربية' },
// { code: 'ar-EG', name: 'Arabic (Egypt)' },
// { code: 'ar-IQ', name: 'Arabic (Iraq)' },
// { code: 'ar-JO', name: 'Arabic (Jordan)' },
// { code: 'ar-KW', name: 'Arabic (Kuwait)' },
// { code: 'ar-LB', name: 'Arabic (Lebanon)' },
// { code: 'ar-LY', name: 'Arabic (Libya)' },
// { code: 'ar-MA', name: 'Arabic (Morocco)' },
// { code: 'ar-OM', name: 'Arabic (Oman)' },
// { code: 'ar-QA', name: 'Arabic (Qatar)' },
// { code: 'ar-SA', name: 'Arabic (Saudi Arabia)' },
// { code: 'ar-SY', name: 'Arabic (Syria)' },
// { code: 'ar-TN', name: 'Arabic (Tunisia)' },
// { code: 'ar-AE', name: 'Arabic (U.A.E.)' },
// { code: 'ar-YE', name: 'Arabic (Yemen)' },
],*/
ar: [
// ar.json contains ar-EG translations
// { code: 'ar-DZ', name: 'Arabic (Algeria)' },
// { code: 'ar-BH', name: 'Arabic (Bahrain)' },
{ country: true, code: 'ar-EG', name: 'العربية' },
// { code: 'ar-EG', name: 'Arabic (Egypt)' },
// { code: 'ar-IQ', name: 'Arabic (Iraq)' },
// { code: 'ar-JO', name: 'Arabic (Jordan)' },
// { code: 'ar-KW', name: 'Arabic (Kuwait)' },
// { code: 'ar-LB', name: 'Arabic (Lebanon)' },
// { code: 'ar-LY', name: 'Arabic (Libya)' },
// { code: 'ar-MA', name: 'Arabic (Morocco)' },
// { code: 'ar-OM', name: 'Arabic (Oman)' },
// { code: 'ar-QA', name: 'Arabic (Qatar)' },
// { code: 'ar-SA', name: 'Arabic (Saudi Arabia)' },
// { code: 'ar-SY', name: 'Arabic (Syria)' },
// { code: 'ar-TN', name: 'Arabic (Tunisia)' },
// { code: 'ar-AE', name: 'Arabic (U.A.E.)' },
// { code: 'ar-YE', name: 'Arabic (Yemen)' },
],
en: [
// en.json contains en-US translations
{ country: true, code: 'en-US', name: 'English (US)' },
Expand Down Expand Up @@ -84,47 +84,46 @@ const locales: (Omit<LocaleObjectData, 'code'> & { code: string })[] = [
file: 'en.json',
name: 'English',
},
{
code: 'ar-EG',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should be ar not ar-EG, buildLocales will add ar-EG using both files

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mmm, that's what it was from the elk code, but it causes a type error 🤔

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you need to run pnpm nuxt prepare or start dev server, locales are typed at i18n

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

still seems to give a type error. happens on CI too

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

checking on my local, I changed the type

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh shoot, commented in the same moment
yes vscode. before the error was on the string itself, now (idk what changed) it seems to be @intlify/core-base

and in a previous commit it failed in CI here too (on the type of the strring itself)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

arrggg missing @intlify/core-base, can you run pnpm add @intlify/core-base and commit and push package.json and pnpm-lock.yaml

Copy link
Contributor Author

@skaldebane skaldebane Jan 29, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

when'd that disappear! i just added it back, here's the error:

Type '"ar"' is not assignable to type '"ar-EG" | "de-DE" | "en-US" | "es-419" | "es-ES" | "fr-FR" | "it-IT" | "ja-JP" | "zh-CN"'.ts(2322)
module.d.mts(447, 5): The expected type comes from property 'code' which is declared here on type 'LocaleObjectData'

(property) LocaleObject<"ar-EG" | "de-DE" | "en-US" | "es-419" | "es-ES" | "fr-FR" | "it-IT" | "ja-JP" | "zh-CN">.code: "ar-" | "de-DE" | "en-US" | "es-419" | "es-ES" | "fr-FR" | "it-IT" | "ja-JP" | "zh-CN"

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

apparently it was removed in 4ca6ce8, knip is now failing CI

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed ✅

file: 'ar.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: 'ar',
file: 'ar.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: 'ckb',
file: 'ckb.json',
name: 'کوردیی ناوەندی',
dir: 'rtl',
pluralRule: (choice: number) => {
const name = new Intl.PluralRules('ckb').select(choice)
return { zero: 0, one: 1, two: 2, few: 3, many: 4, other: 5 }[name]
},
} satisfies LocaleObjectData,
{
code: 'fa-IR',
file: 'fa-IR.json',
name: 'فارسی',
dir: 'rtl',
pluralRule: (choice: number) => {
const name = new Intl.PluralRules('fa-IR').select(choice)
return { zero: 0, one: 1, two: 2, few: 3, many: 4, other: 5 }[name]
},
} satisfies LocaleObjectData,
{
code: 'ca',
file: 'ca.json',
name: 'Català',
code: 'ckb',
file: 'ckb.json',
name: 'کوردیی ناوەندی',
dir: 'rtl',
pluralRule: (choice: number) => {
const name = new Intl.PluralRules('ckb').select(choice)
return { zero: 0, one: 1, two: 2, few: 3, many: 4, other: 5 }[name]
},
{
code: 'el-GR',
file: 'el-GR.json',
name: 'Ελληνικά',
} satisfies LocaleObjectData,
{
code: 'fa-IR',
file: 'fa-IR.json',
name: 'فارسی',
dir: 'rtl',
pluralRule: (choice: number) => {
const name = new Intl.PluralRules('fa-IR').select(choice)
return { zero: 0, one: 1, two: 2, few: 3, many: 4, other: 5 }[name]
},
*/
} satisfies LocaleObjectData,
{
code: 'ca',
file: 'ca.json',
name: 'Català',
},
{
code: 'el-GR',
file: 'el-GR.json',
name: 'Ελληνικά',
},*/
{
code: 'de-DE',
file: 'de-DE.json',
Expand Down
1 change: 1 addition & 0 deletions i18n/locales/ar-EG.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
Loading