feat(i18n): add Korean locale and graceful fallback for missing locales - #12733
feat(i18n): add Korean locale and graceful fallback for missing locales#12733YeonghyeonKO wants to merge 2 commits into
Conversation
- Add ko.json with full Korean translations for all UI strings - Register Korean (한국어) in SUPPORTED_LANGUAGES - Add try-catch in loadLanguage() to gracefully fall back to English when a locale file is missing, preventing the "Unknown variable dynamic import" error The loadLanguage() function currently throws an unhandled error when the browser's language doesn't match any available locale file (e.g., navigator.language returns "ko" but ko.json doesn't exist). This causes a runtime crash on app startup for users with unsupported browser languages. Related: - langflow-ai#12226 (IBM Globalization Pipeline integration and i18n setup) - langflow-ai#12671 (disable automatic browser language detection) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
Important Review skippedAuto incremental reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
WalkthroughThe pull request adds Korean language support to the frontend application by registering the language in the supported languages list, implementing error handling for missing locale files during dynamic import, and providing a comprehensive Korean translation file. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Important Pre-merge checks failedPlease resolve all errors before merging. Addressing warnings is optional. ❌ Failed checks (1 error, 3 warnings)
✅ Passed checks (3 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
- "misc.playground": keep as "Playground" (proper noun, no translation) - "flow.statusInactive": "실행이 중단되었습니다." (more natural Korean) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
@RamGopalSrikar @Adam-Aghili @vjgit96 |
|
#12733 refer to this PR, language for korean not included yet. |
|
@RamGopalSrikar Right, this PR has two features:
|
|
Superseded by #13674, which is rebased onto current |
Summary
ko.jsonwith full Korean translations for all 388 UI strings한국어) inSUPPORTED_LANGUAGESconstantloadLanguage()to gracefully fall back to English when a locale file is missingProblem
When a user's browser language is set to Korean (
navigator.languagereturns"ko"), the app attempts to dynamically import./locales/ko.jsonwhich doesn't exist. This causes an unhandled runtime error:This crashes the app on startup for Korean-speaking users. The same issue affects any browser language not in the current locale set.
Fixes #12735
Changes
src/frontend/src/locales/ko.jsonja.jsonpattern)src/frontend/src/constants/languages.ts{ code: "ko", label: "한국어" }toSUPPORTED_LANGUAGESsrc/frontend/src/i18n.tsRelated Issues & Commits
loadLanguage()crashes on unsupported browser locale (missing fallback)chore(i18n): disable automatic browser language detection99ee7a3—feat(i18n): lazy-load non-English locale files via Vite dynamic importsThe
loadLanguage()fallback fix is complementary to #12671 — even with automatic detection disabled, users who manually select an unsupported language (or have a stalelocalStoragepreference) would still hit this error.Test Plan
th) → verify app falls back to English without errors🤖 Generated with Claude Code