fix(dashboard): Make Japanese and Korean selectable and complete their translations - #5077
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
📝 WalkthroughWalkthroughThis PR adds Korean (ko) as a supported dashboard locale, alongside existing Japanese (ja) support. It updates the Lingui configuration and the Possibly related PRs
Suggested labels: Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 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 |
|
Dashboard Preview: https://admin-dashboard-e9ji9gsmx-vendure.vercel.app |
|
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@packages/dashboard/src/i18n/locales/ko.po`:
- Around line 2277-2278: Add the missing fieldName.priceWithTax entry to the
Japanese catalog in ja.po, using the appropriate Japanese translation. Ensure
the entry matches the explicit message ID introduced in the Korean catalog so
LanguageCode.ja resolves this field correctly.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: ac011840-e467-45fe-beaf-2be66a01c9b3
📒 Files selected for processing (4)
packages/dashboard/lingui.config.jspackages/dashboard/src/i18n/locales/ja.popackages/dashboard/src/i18n/locales/ko.popackages/dashboard/vite/constants.ts
| msgid "fieldName.priceWithTax" | ||
| msgstr "세금 포함 가격" |
There was a problem hiding this comment.
🗄️ Data Integrity & Integration | 🟡 Minor | ⚡ Quick win
Add fieldName.priceWithTax to the Japanese catalog.
packages/dashboard/src/i18n/locales/ko.po adds this message, but packages/dashboard/src/i18n/locales/ja.po has no matching entry. Because LanguageCode.ja is now a default language, this field will not resolve to a Japanese catalog translation. Regenerate ja.po or add the Japanese translation for this explicit ID.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@packages/dashboard/src/i18n/locales/ko.po` around lines 2277 - 2278, Add the
missing fieldName.priceWithTax entry to the Japanese catalog in ja.po, using the
appropriate Japanese translation. Ensure the entry matches the explicit message
ID introduced in the Korean catalog so LanguageCode.ja resolves this field
correctly.



Makes Japanese and Korean selectable in the Dashboard, and fills in every missing translation for both.
The problem
packages/dashboard/src/i18n/locales/ko.pois tracked and holds around 1,005 Korean translations, butkoappears in neither thelocalesarray inlingui.config.jsnordefaultAvailableLanguagesinvite/constants.ts. Solingui extractnever updated it, and the Display language selector could never offer it. The catalog was still being compiled into every build, because the Vite plugin reads the locales directory withreaddirSyncand compiles whatever.pofiles it finds — Korean has been shipping in the bundle all along with no way to select it.Japanese had half the same problem. It is in
lingui.config.js, soja.postayed current, but it was missing fromdefaultAvailableLanguages, so it could not be selected either.What changed
Enablement.
LanguageCode.jaandLanguageCode.koadded todefaultAvailableLanguages, and'ko'added to thelocalesarray so extraction maintains the catalog from now on.ko.pois regenerated, picking up the 327 messages that accumulated while it was frozen. No language-name mapping was needed —language-dialog.tsxresolves labels throughIntl.DisplayNames, so both appear with their native names automatically.Translations. 327 Korean and 44 Japanese strings. The translation commit is exactly 371 removed
msgstr ""lines and 371 added ones, with no msgid, reference comment, or header line touched, so it can be reviewed as pure translation content rather than catalog churn.Both languages are now the best-covered locales in the repo: Korean has no untranslated strings at all and Japanese has 11, all of them obsolete
#~entries for messages that no longer exist in the source. Every other locale sits between 34 and 104.Native-speaker review
Both catalogs were reviewed against the source code and the existing translations. That review found one genuine UI bug:
SizeandDimensionsare consecutive<TableHead>elements inasset-gallery.tsx, andFile Size/Dimensionsare adjacent labels inasset-properties.tsx. Both rendered identically — 크기 in Korean and サイズ in Japanese — so the asset list showed two adjacent columns with the same header over different data (formatFileSize(asset.fileSize)versus{asset.width} x {asset.height}). Every other locale already distinguished the two. Japanese now uses サイズ / 寸法; Korean uses 용량 / 크기, withFile Sizemoving to 파일 용량.The review also produced a few consistency corrections, and two back-corrections to translations that pre-date this PR, kept in their own commit:
Calculatorwas rendered as 計算機 / 계산기, which reads as a physical calculating device. In Vendure it names a pluggable shipping- or payment-cost strategy selected from a dropdown, so it is now 計算方法 / 계산 방식. The label is shared between the shipping-method and payment-method screens, so the replacement had to work for both.Dimensions, as described above.Verification
scripts/check-i18n-sync.sh, thedashboard i18n syncCI job, reports "i18n catalogs are in sync" and exits 0.lingui compilesucceeds, so every ICU message in both catalogs parses. This matters because the Vite plugin parses these catalogs at build time.lingui extractproduces an identical diffstat.audit-translations.jsreports 0 suspicious entries for both languages. Most other locales report between 1 and 34.@lingui/format-poparser.Two tooling gaps worth a follow-up
Both are in
scripts/translate/i18n-tool.jsand affect every locale, so they are not fixed here. Two entries had to be written intoko.poby hand as a result.isLatinOnlyTechTermexempts short verbatim Latin technical terms from the native-script guard, but its regex^[A-Za-z0-9 _\-./]+$has no colon. SoSKU:is rejected for Korean even though leaving it verbatim is correct, whichzh_Hansandjaboth already do. Adding:to the character class would make the guard behave as its own comment describes.escapeRegexescapes the msgid for PO format, turning"into\", and then for regex, but never escapes the backslash itself. The resulting pattern matches the unescaped text and never finds the entry.Duplicate value \"{trimmed}\" already existswas silently reported as "not found" rather than failing loudly.Separately,
packages/dashboard/plugin/constants.tsexports its owndefaultAvailableLanguagesanddefaultAvailableLocaleswhich nothing imports, and whose language list has drifted to 10 entries against the 28 invite/constants.ts.Follows on from #5075, which is where this work was originally split out from.
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.