Skip to content

fix(locale): use the endonym for Hindi and close the Chinese bracket - #367

Merged
IgorShevchik merged 1 commit into
mainfrom
sync/nuxt-e333e8d
Aug 11, 2026
Merged

fix(locale): use the endonym for Hindi and close the Chinese bracket#367
IgorShevchik merged 1 commit into
mainfrom
sync/nuxt-e333e8d

Conversation

@IgorShevchik

Copy link
Copy Markdown
Collaborator

Sync with nuxt/ui — ports e333e8d (nuxt/ui#6823).

Upstream bundled two unrelated corrections. One half applies here; the other deliberately must not.

✅ The name field should be the endonym

name is what the locale switcher renders (labelKey: 'name' in LocaleSelect.vue), so it should carry the language's own name. Upstream fixed eight locales that carried the English one (DanishDansk, Hebrewעברית, Hindiहिन्दी, IcelandicÍslenska, …).

Audited all 20 of our locales. Nineteen already carry proper endonyms — العربية, Português (Brasil), Deutsch, English, Français, Bahasa Indonesia, Italiano, 日本語, Қазақша, Español, Bahasa Melayu, Polski, Русский, 中文(简体), ภาษาไทย, Türkçe, Українська, Tiếng Việt. One did not:

 // src/runtime/locale/in.ts
-  name: 'Indian',
+  name: 'हिन्दी',

This is upstream's hi.ts fix verbatim — same language, same replacement value. Indian is not a language, and the file's own messages are Hindi (कोड, गुण). The repository already knew this; its comments read hi: 'in' // Indian (हिन्दी). Only the rendered field disagreed.

❌ The Tajik tjtg half — not mirrored, on purpose

Upstream renamed tj.tstg.ts because tg is Tajik's ISO 639-1 code while tj is the ISO 3166 code for Tajikistan — a country code where a language code belongs.

That reasoning must not be generalised here. Our locale codes are Bitrix24 portal language codes, not ISO 639-1: in, kz, ua, vn, sc, tc, br, la. Several look like exactly the mistake upstream just fixed (ua vs ISO uk, kz vs kk, vn vs vi) — but they are the identifiers the platform this library integrates with actually uses, which is why the repo already carries an explicit ISO↔Bitrix24 mapping (LocaleSelect.vue and SupportedLanguages.vue both map hi: 'in', tc: 'tw', …). Renaming any of them would break every consumer passing a Bitrix24 language code.

Three fork-only fixes in the same field

Found while auditing — same defect class, none of them from upstream:

Where Was Now
src/runtime/dictionary/i18n.ts { code: 'in', name: 'भारतीय' } — Devanagari for "Indian", the same non-language label just translated हिन्दी, so the dictionary and the locale agree
src/runtime/locale/tc.ts 中文(繁體) — full-width closed with a half-width ); the dictionary already had it right, so the two disagreed 中文(繁體), fixed at the source and in the three comments repeating it
comments in locale/index.ts, LocaleSelect.vue, SupportedLanguages.vue // Indian (हिन्दी) // Hindi (हिन्दी)

Observed, left alone

ar.ts says 'العربية' while the dictionary says 'عربي'. Both are legitimate Arabic endonyms and upstream does not touch Arabic, so picking one is a call for someone who reads the language — flagged rather than changed.

Verify (CI=true)

lint · test · typecheck · build — all green. No snapshot contains any of these strings and no test asserts on locale name; tests 5878 passed | 6 skipped across 262 files, unchanged.

User-visible effect: the locale switcher's Hindi entry stops reading Indian among nineteen endonyms, and the Traditional Chinese entry closes its bracket.

Ledger: cursor → e333e8d; the three no-op entries (094fb57, 10ec237, 795c353) are reconciled to PR #361 / c31d250.


Generated by Claude Code

Ports the native-name half of nuxt/ui e333e8d (#6823): the `name` field is
rendered by the locale switcher (`labelKey: 'name'`), so it should carry the
language's own name, not its English one.

Audited all 20 locales. Nineteen already carry proper endonyms; `in.ts` said
`Indian` — which is not a language, while the file's messages are Hindi
(`कोड`, `गुण`). This is upstream's `hi.ts` fix verbatim, same replacement
value. The repository already knew: its comments read `// Indian (हिन्दी)`.
Only the rendered field disagreed.

Three fork-only fixes in the same field, found while auditing:

- `dictionary/i18n.ts` listed `{ code: 'in', name: 'भारतीय' }` — Devanagari for
  "Indian", the same non-language label just translated. Now `हिन्दी`, so the
  dictionary and the locale agree.
- `locale/tc.ts` had `中文(繁體)` — a full-width `(` closed with a half-width
  `)`, while the dictionary already had it right. Fixed at the source and in
  the three comments repeating it.
- Comments reading `// Indian (हिन्दी)` now read `// Hindi (हिन्दी)`.

The commit's other half — Tajik `tj` -> `tg` — is deliberately not mirrored.
Our locale codes are Bitrix24 portal codes, not ISO 639-1 (`in`, `kz`, `ua`,
`vn`, `sc`, `tc`, `br`, `la`), which is why the repository carries an explicit
ISO<->Bitrix24 mapping. Renaming any of them would break every consumer
passing a Bitrix24 language code.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JS8ypVfQSFzYVZzkTHhURb
@IgorShevchik
IgorShevchik merged commit b084ccb into main Aug 11, 2026
1 check passed
@IgorShevchik
IgorShevchik deleted the sync/nuxt-e333e8d branch August 11, 2026 13:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants