Skip to content

chore(locales): normalize Korean to ko, keep kr as back-compat alias#79

Merged
InstaZDLL merged 1 commit into
mainfrom
chore/i18n-normalize-korean-locale
May 20, 2026
Merged

chore(locales): normalize Korean to ko, keep kr as back-compat alias#79
InstaZDLL merged 1 commit into
mainfrom
chore/i18n-normalize-korean-locale

Conversation

@InstaZDLL
Copy link
Copy Markdown
Owner

@InstaZDLL InstaZDLL commented May 20, 2026

Summary

The Korean locale shipped under the wrong code kr — that's the ISO 3166-1 country code for South Korea, not the language code. Canonical ISO 639-1 is ko. The repo carried src/i18n/locales/kr.json while exposing the language in the UI as ko, and the loader mapped both codes to the same file. This dual-code setup confused every new contributor and was flagged by Qodo on PR #69.

Changes

  • git mv src/i18n/locales/kr.json src/i18n/locales/ko.json — history follows the rename.
  • localeLoaders drops the duplicate kr entry; the alias map already redirects kr -> ko at detection time, so any inbound kr still loads the Korean strings.
  • One-time localStorage migration: a stored waveflow-language === "kr" is rewritten to "ko" on startup. convertDetectedLanguage already normalised the code at read time, so this is purely about cleaning up the persisted token (DevTools, future migrations see the canonical value).
  • supportedLngs keeps "kr" so any code path that calls i18n.changeLanguage("kr") directly still resolves — belt-and-suspenders alongside the alias map.
  • CLAUDE.md updated: locale list shows ko (canonical), with a sentence explaining the legacy kr alias.

Test plan

  • Fresh launch: language selector lists Korean as 한국어, picks ko, app loads Korean strings.
  • Profile with localStorage["waveflow-language"] === "kr" (simulate via DevTools): on next launch, the stored value becomes "ko" and Korean strings still load.
  • Browser detector reports ko-KR / kr / ko → all resolve to ko via normalizeSupportedLanguageCode.
  • bun run typecheck and bun run lint pass.

The Korean locale shipped under the wrong code `kr` (that's ISO 3166-1
country, not language). Canonical ISO 639-1 is `ko`. The shipped file
was `kr.json` and `localeLoaders` mapped both `ko` and `kr` to it,
which `SUPPORTED_LANGUAGES` exposed under `ko` — a dual-code setup
that confused every new contributor and was flagged in code review.

- Rename `src/i18n/locales/kr.json` -> `ko.json` (via `git mv` so the
  history follows).
- Drop the duplicate `kr` entry from `localeLoaders`; the alias map
  already redirects `kr` -> `ko` at detection time.
- Migrate persisted `localStorage["waveflow-language"] === "kr"` to
  `"ko"` once at startup so DevTools / future migrations see the
  canonical value. `convertDetectedLanguage` already normalised on
  read, so this is purely about cleaning up the stored token.
- Keep `kr` in `supportedLngs` so any direct `i18n.changeLanguage("kr")`
  still resolves (belt-and-suspenders alongside the alias map).
- Update `CLAUDE.md` to reflect the new canonical code.
@qodo-code-review
Copy link
Copy Markdown

Qodo reviews are paused for this user.

Troubleshooting steps vary by plan Learn more →

On a Teams plan?
Reviews resume once this user has a paid seat and their Git account is linked in Qodo.
Link Git account →

Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center?
These require an Enterprise plan - Contact us
Contact us →

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 20, 2026

Warning

Rate limit exceeded

@InstaZDLL has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 22 minutes and 52 seconds before requesting another review.

You’ve run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 96e2e682-b762-49c4-a4b5-dda8434561bc

📥 Commits

Reviewing files that changed from the base of the PR and between 0b691c4 and 93c3ca3.

📒 Files selected for processing (3)
  • CLAUDE.md
  • src/i18n/index.ts
  • src/i18n/locales/ko.json
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chore/i18n-normalize-korean-locale

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions github-actions Bot added scope: frontend React/Vite frontend (src/) scope: i18n Translations (src/i18n/) scope: docs Docs, README, assets type: chore Maintenance size: s 10-50 lines labels May 20, 2026
@InstaZDLL InstaZDLL self-assigned this May 20, 2026
@InstaZDLL InstaZDLL merged commit baac76a into main May 20, 2026
13 of 14 checks passed
@InstaZDLL InstaZDLL deleted the chore/i18n-normalize-korean-locale branch May 20, 2026 21:23
@codacy-production
Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 0 complexity · 0 duplication

Metric Results
Complexity 0
Duplication 0

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

scope: docs Docs, README, assets scope: frontend React/Vite frontend (src/) scope: i18n Translations (src/i18n/) size: s 10-50 lines type: chore Maintenance

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant