Skip to content

chore: add more translations to dynamic checkout - #280

Merged
jakubjasinsky merged 1 commit into
masterfrom
jakub-dynamic-checkout-locales
Sep 24, 2026
Merged

jakubjasinsky merged 1 commit into
masterfrom
jakub-dynamic-checkout-locales

Conversation

@jakubjasinsky

@jakubjasinsky jakubjasinsky commented Sep 14, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Adds 19 more Dynamic Checkout locales and replaces the bare language-code lookup with a resolver that understands regional variants and legacy tags, so zh-TW and zh-CN stop collapsing into a single "zh" bucket.

Changes

  • New locales: bg, bn, cs, da, el, he, hi, id, kn, nl, ro, ru, sv, te, th, tr, uk, zh-cn, zh-tw. Every file mirrors the English key set exactly.
  • Translations.resolveLocale replaces getLanguageCode: tries the full normalized tag first, then the bare language, then falls back to en. Handles _ separators and mixed case.
  • Alias table for tags browsers still emit: in → id, iw → he, and the zh/zh-Hans/zh-Hant/zh-HK/zh-SG/zh-MO family → zh-cn/zh-tw.
  • he added to RTL locales.
  • Bumps version to 1.9.13.

Impact

  • Translations.getLanguageCode is removed. It was only used internally, but any consumer reaching into the ProcessOut namespace for it will break.
  • Merchants passing zh-TW now get Traditional Chinese instead of English. Any other previously unsupported tag now resolves to its new locale rather than falling back to English.

Copilot AI lite review requested due to automatic review settings September 14, 2026 16:15

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

A critical IE8 compatibility issue and a moderate extended-locale fallback issue remain unresolved.

Get a fresh assessment by requesting another Copilot review.

Pull request overview

Adds 19 Dynamic Checkout translations, locale aliases, fallback handling, RTL support, tests, and a package version bump.

Changes:

  • Registers new locale dictionaries and bundle references.
  • Expands locale resolution and translation coverage.
  • Adds locale-focused tests.
  • Review findings remain for IE8 compatibility and extended locale fallback.
File summaries
File Description
test/support/loadNamespace.ts Expands test locale metadata.
test/dynamic-checkout/translations.test.ts Tests locale registration and resolution.
test/dynamic-checkout/tokenize-only.test.ts Tests behavior across locale tags.
src/dynamic-checkout/utils/translations.ts Adds mappings, aliases, fallback, and RTL handling.
src/dynamic-checkout/references.ts Registers locale sources.
src/dynamic-checkout/locales/zh-tw.ts Traditional Chinese translations.
src/dynamic-checkout/locales/zh-cn.ts Simplified Chinese translations.
src/dynamic-checkout/locales/uk.ts Ukrainian translations.
src/dynamic-checkout/locales/tr.ts Turkish translations.
src/dynamic-checkout/locales/th.ts Thai translations.
src/dynamic-checkout/locales/te.ts Telugu translations.
src/dynamic-checkout/locales/sv.ts Swedish translations.
src/dynamic-checkout/locales/ru.ts Russian translations.
src/dynamic-checkout/locales/ro.ts Romanian translations.
src/dynamic-checkout/locales/nl.ts Dutch translations.
src/dynamic-checkout/locales/kn.ts Kannada translations.
src/dynamic-checkout/locales/id.ts Indonesian translations.
src/dynamic-checkout/locales/hi.ts Hindi translations.
src/dynamic-checkout/locales/he.ts Hebrew translations.
src/dynamic-checkout/locales/el.ts Greek translations.
src/dynamic-checkout/locales/da.ts Danish translations.
src/dynamic-checkout/locales/cs.ts Czech translations.
src/dynamic-checkout/locales/bn.ts Bengali translations.
src/dynamic-checkout/locales/bg.ts Bulgarian translations.
package.json Bumps the project version.
Review details
  • Files reviewed: 25/25 changed files
  • Comments generated: 2
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/dynamic-checkout/utils/translations.ts Outdated
Comment thread src/dynamic-checkout/utils/translations.ts Outdated
Comment thread package.json
@jakubjasinsky
jakubjasinsky force-pushed the jakub-dynamic-checkout-locales branch from ef97377 to daa9e7f Compare September 23, 2026 14:02
@jakubjasinsky
jakubjasinsky merged commit 5e09654 into master Sep 24, 2026
5 checks passed
@jakubjasinsky
jakubjasinsky deleted the jakub-dynamic-checkout-locales branch September 24, 2026 06:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

4 participants