feat(i18n): add translations for Khmer (km-KH)#2470
feat(i18n): add translations for Khmer (km-KH)#2470nidexingg wants to merge 7 commits intonpmx-dev:mainfrom
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
1 Skipped Deployment
|
|
Hello! Thank you for opening your first PR to npmx, @nidexingg! 🚀 Here’s what will happen next:
|
|
Important Review skippedReview was skipped as selected files did not have any reviewable changes. 💤 Files selected but had no reviewable changes (1)
⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
You can disable this status message by setting the Use the checkbox below for a quick retry:
📝 WalkthroughWalkthroughAdds Khmer locale support by registering Changes
Possibly related PRs
Suggested reviewers
🚥 Pre-merge checks | ✅ 2✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ 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 |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
ghostdevv
left a comment
There was a problem hiding this comment.
👋 Hey @nidexingg, thanks for adding Khmer support!
In lieu of a CodeRabbit review (it skipped this one), I had an LLM review the translation content. Here are its findings — have a look and let me know what makes sense and what doesn't.
1. Locale display name — likely incorrect
File: config/i18n.ts:219
The display name is currently ខេមរភាសា. The standard Khmer endonym used by the Cambodian government, Unicode CLDR, and Wikipedia is ភាសាខ្មែរ (Phéasa Khmêr). The current form uses a Pali/Sanskrit-derived root in a non-standard word order that isn't commonly seen in modern usage. Could you double-check this?
2. Thai script mixed into Khmer text
File: i18n/locales/km-KH.json:323
The common.scroll_to_top value is "រំកិលទៅលើកสุต" — the last few characters (สุต) are Thai script (U+0E2A, U+0E38, U+0E15), not Khmer. Thai and Khmer look similar but they're entirely different Unicode blocks. This looks like a copy-paste or machine translation artefact. Something like "រំកិលទៅខាងលើ" would be the expected Khmer.
3. Untranslated user-facing strings
Roughly 30 strings that other established locales (e.g. ja-JP) translate have been left in English here. A few examples:
| Key | Current value | Translated in ja-JP? |
|---|---|---|
provenance_section.transparency_log_entry |
Transparency log entry |
✅ 透明性ログエントリ |
trends.average_window |
Average window |
✅ 平均ウィンドウ |
trends.smoothing |
Smoothing |
✅ スムージング |
install_scripts.title |
Install Scripts |
✅ インストールスクリプト |
dependencies.title |
Dependency ({count}) | Dependencies ({count}) |
✅ 依存関係({count}) |
dependencies.list_label |
Package dependencies |
✅ パッケージの依存関係 |
access.title |
Team Access |
— |
chart_view_combined |
Combined view |
— |
(Note: strings like settings.title, blog.heading, nav.settings, colour names, and brand.heading are intentionally kept in lowercase English across all locales — those are fine.)
4. Minor: English plural suffixes (not blocking)
Khmer doesn't have grammatical plurals, so the pipe-separated forms like "{count} skill អាចប្រើបាន | {count} skills អាចប្រើបាន" don't strictly need to differ between the singular and plural side. There are about 38 instances of this. It's cosmetic and won't break anything, so not blocking — just worth being aware of for future tidying.
Items 1–3 should ideally be addressed before merging. Happy to help if anything's unclear!
…complete untranslated user-facing strings.
|
Hey @ghostdevv Thanks a lot for the detailed review — really appreciate the careful feedback! I’ve gone through and fixed the issues you highlighted:
|
km-KH (🇰🇭 Khmer: National language of Cambodia)
ghostdevv
left a comment
There was a problem hiding this comment.
thanks! A couple more things the LLM picked up on, let me know if any are wrong!
1. 🔴 Broken placeholder in a11y.approach.p2
File: i18n/locales/km-KH.json
The placeholder {about_link} doesn't match the interpolation key used by the app. Every other locale uses {about}:
| Locale | Value |
|---|---|
| km-KH | គេហទំព័រនេះគឺជាគម្រោង {about_link}។ ... |
| fr-FR | Ce site est un {about}. ... |
| ja-JP | このサイトは {about} です。... |
| This will cause the placeholder to render as literal text or be empty at runtime. | |
Fix: Replace {about_link} → {about}. |
2. 🟡 Wrong value for about.contributors.title
File: i18n/locales/km-KH.json
This key is a section heading ("Contributors"), but the Khmer value is a "show more" string with a {count} placeholder that this key never receives:
| Locale | Value |
|---|---|
| km-KH | ... និងអ្នកចូលរួមចំណែកចំនួន {count} នាក់ទៀត |
| fr-FR | Contributeurs |
| ja-JP | コントリビューター |
Fix: Change to a simple label like អ្នកចូលរួមចំណែក ("Contributors"). |
3. 🟢 Remaining untranslated strings (non-blocking)
There are ~49 keys where km-KH has pure-English values that other locales (e.g. ja-JP) translate. The contributor's argument about keeping developer jargon in English is reasonable for some terms, but a few are general UI labels:
nav.settings/settings.title→"settings"(ja-JP:設定)footer.keyboard_shortcuts→"keyboard shortcuts"(ja-JP:キーボードショートカット)a11y.footer_title→"a11y"(ja-JP:アクセシビリティ)compare.dependencies→"Dependencies"(ja-JP:依存関係)
…`about.contributors.title`.
|
@ghostdevv Kindly check the new PR. Thank you for your thorough review. |
🔗 Linked issue
N/A
🧭 Context
Currently,
npmx.devsupports several languages but lacks Khmer (Cambodian) localization. This limits accessibility for Khmer-speaking users. Adding Khmer language support improves inclusivity and aligns with the project’s internationalization goals.📚 Description
This PR adds full support for the Khmer language (
km) across thenpmx.devplatform.Changes include:
km.jsonto the localization folder containing Khmer translations for all existing UI keys.i18nconfiguration to include Khmer in the list of supported locales.Why this change is required:
Testing and validation:
Tradeoffs and follow-ups:
Additional notes:
AI tools were used to assist with translation verification, but all content has been manually reviewed and refined to ensure correctness and natural phrasing. The code, translation files, and documentation reflect my own understanding and intent for this contribution.