feat: add ar, fi, nb, ta, vi locales to dynamic checkout#265
Open
charles-elissa-cko wants to merge 1 commit into
Open
feat: add ar, fi, nb, ta, vi locales to dynamic checkout#265charles-elissa-cko wants to merge 1 commit into
charles-elissa-cko wants to merge 1 commit into
Conversation
Add translations for Arabic, Finnish, Norwegian Bokmål, Tamil, and Vietnamese. Arabic gets RTL layout support via a `dir="rtl"` attribute on the widget wrapper plus accompanying style overrides. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
This PR adds five new translation locales to the Dynamic Checkout widget (ar, fi, nb, ta, vi) and introduces RTL layout handling for Arabic by setting dir="rtl" on the widget wrapper, with corresponding CSS overrides.
Changes:
- Added new locale translation files for ar, fi, nb, ta, vi.
- Registered the new locales in
references.tsandTranslations.localeTranslationsMap. - Added RTL handling for Arabic via
dir="rtl"on the widget wrapper and RTL-specific style overrides. - Bumped package version to 1.9.6.
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/dynamic-checkout/utils/translations.ts | Registers the five new locales in the translation map. |
| src/dynamic-checkout/styles/default.ts | Adds RTL CSS overrides intended for Arabic. |
| src/dynamic-checkout/references.ts | Adds TS reference paths for the new locale files. |
| src/dynamic-checkout/locales/ar.ts | Adds Arabic translations (used with RTL). |
| src/dynamic-checkout/locales/fi.ts | Adds Finnish translations. |
| src/dynamic-checkout/locales/nb.ts | Adds Norwegian Bokmål translations. |
| src/dynamic-checkout/locales/ta.ts | Adds Tamil translations. |
| src/dynamic-checkout/locales/vi.ts | Adds Vietnamese translations. |
| src/dynamic-checkout/dynamic-checkout.ts | Sets dir="rtl" on the widget wrapper when locale is ar. |
| package.json | Bumps version from 1.9.5 to 1.9.6. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+933
to
+957
| /* Right-to-left layout overrides (e.g. Arabic locale) */ | ||
| [dir="rtl"] .dco-payment-method-button-wrapper { | ||
| padding-right: 0; | ||
| padding-left: 10px; | ||
| } | ||
|
|
||
| [dir="rtl"] .dco-payment-method-card-form-input-cvc { | ||
| padding-right: 0; | ||
| padding-left: 40px; | ||
| } | ||
|
|
||
| [dir="rtl"] .dco-card-cvc-icon { | ||
| right: auto; | ||
| left: 10px; | ||
| } | ||
|
|
||
| [dir="rtl"] .dco-card-scheme-logo { | ||
| right: auto; | ||
| left: 10px; | ||
| } | ||
|
|
||
| [dir="rtl"] .dco-delete-payment-method-button { | ||
| margin-left: 0; | ||
| margin-right: auto; | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds translations for five new locales to the dynamic checkout:
Arabic includes RTL layout support: a
dir="rtl"attribute is set on the widget wrapper when the locale isar, with accompanying style overrides for payment-method buttons, the CVC input/icon, scheme logos, and the delete-payment-method button.Changes
src/dynamic-checkout/locales/references.tsand theTranslations.localeTranslationsMapdynamic-checkout.tsand[dir="rtl"]style overrides instyles/default.ts🤖 Generated with Claude Code