Skip to content

Comments

Added localization build#2380

Open
sunghyunkang1111 wants to merge 4 commits intomasterfrom
DE_Localization_TSBuild
Open

Added localization build#2380
sunghyunkang1111 wants to merge 4 commits intomasterfrom
DE_Localization_TSBuild

Conversation

@sunghyunkang1111
Copy link
Contributor

@sunghyunkang1111 sunghyunkang1111 commented Feb 6, 2026

What this PR does

Introduces internationalization (i18n) support using react-i18next, applied to the SplashScreen as a proof-of-concept.

Option 1: String literal keys (no build step)

import { t } from "Localization/t";
t("splashScreen.title.default");

Pros

  1. No build step — t() infers valid keys from Resources.json via the ResourceKey type at compile time
  2. Simpler setup, fewer moving parts

Cons

  1. Raw strings — no autocomplete beyond what TS string unions provide
  2. No hover preview of English values
  3. Renaming a key in JSON requires find-and-replace across call sites

Option 2: Generated Keys const object

import { Keys } from "Localization/Keys.generated";
import { t } from "Localization/t";
t(Keys.splashScreen.title.default);

Pros

  1. Full autocomplete — Keys triggers IntelliSense through the whole key tree
  2. Hover shows English text — JSDoc on every leaf: /** Welcome to Azure Cosmos DB */
{4EED0A2B-2554-4394-9FCF-50FF2B6C7D98} 3. Rename-safe — changing a key in JSON + regenerating updates the const; TS errors surface all broken call sites

Cons

  1. Requires a generate step
  2. If not committing the generated file, initial compilation issue will surface while developing
  3. Need to wire regenerating the string types when hot-loading
  4. Need to maintain the generation script which uses few 3rd party libraries and some custom logic as well

@sunghyunkang1111 sunghyunkang1111 requested a review from a team as a code owner February 6, 2026 00:23
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