-
Notifications
You must be signed in to change notification settings - Fork 392
chore(types, localizations): Rename payment sources to method methods #6959
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
chore(types, localizations): Rename payment sources to method methods #6959
Conversation
🦋 Changeset detectedLatest commit: 32eaab3 The changes in this PR will be included in the next version bump. This PR includes changesets to release 22 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
The latest updates on your projects. Learn more about Vercel for GitHub.
|
WalkthroughRenames payment "source(s)" to "method(s)" across types, exports, UI components, tests, and all localization files; moves localization namespace from Changes
Sequence Diagram(s)No sequence diagram — changes are key/localization renames and a re-export; control flow unchanged. Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Disabled knowledge base sources:
📒 Files selected for processing (4)
🚧 Files skipped from review as they are similar to previous changes (1)
🧰 Additional context used📓 Path-based instructions (7)**/*.{js,jsx,ts,tsx}📄 CodeRabbit inference engine (.cursor/rules/development.mdc)
Files:
**/*.{js,jsx,ts,tsx,json,css,scss,md,yaml,yml}📄 CodeRabbit inference engine (.cursor/rules/development.mdc)
Files:
packages/**/*.{ts,tsx}📄 CodeRabbit inference engine (.cursor/rules/development.mdc)
Files:
packages/**/*.{ts,tsx,d.ts}📄 CodeRabbit inference engine (.cursor/rules/development.mdc)
Files:
**/*.{ts,tsx}📄 CodeRabbit inference engine (.cursor/rules/development.mdc)
Files:
packages/localizations/**/*📄 CodeRabbit inference engine (.cursor/rules/monorepo.mdc)
Files:
**/*.{js,ts,tsx,jsx}📄 CodeRabbit inference engine (.cursor/rules/monorepo.mdc)
Files:
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
🔇 Additional comments (4)
Comment |
@clerk/agent-toolkit
@clerk/astro
@clerk/backend
@clerk/chrome-extension
@clerk/clerk-js
@clerk/dev-cli
@clerk/elements
@clerk/clerk-expo
@clerk/expo-passkeys
@clerk/express
@clerk/fastify
@clerk/localizations
@clerk/nextjs
@clerk/nuxt
@clerk/clerk-react
@clerk/react-router
@clerk/remix
@clerk/shared
@clerk/tanstack-react-start
@clerk/testing
@clerk/themes
@clerk/types
@clerk/upgrade
@clerk/vue
commit: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 11
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (25)
packages/localizations/src/kk-KZ.ts (1)
295-299
: Rename the leftover{{paymentSource}}
placeholder.
removeMethod.successMessage
still interpolates{{paymentSource}}
, so the UI will either show an empty value or a stale token after the rename. Update it to{{paymentMethod}}
to stay aligned with the new terminology.- successMessage: '{{paymentSource}} жойылды.', + successMessage: '{{paymentMethod}} жойылды.',packages/localizations/src/it-IT.ts (1)
302-308
: Fix variable name inconsistency in success message.Line 306 uses
{{paymentSource}}
instead of{{paymentMethod}}
, which is inconsistent with the PR's objective to rename payment sources to payment methods. The userProfile section (line 988) correctly uses{{paymentMethod}}
.Apply this diff:
removeMethod: { messageLine1: '{{identifier}} verrà rimosso da questo account.', messageLine2: 'Non potrai più utilizzare questo metodo di pagamento e gli abbonamenti ricorrenti che dipendono da esso non funzioneranno più.', - successMessage: '{{paymentSource}} è stato rimosso dal tuo account.', + successMessage: '{{paymentMethod}} è stato rimosso dal tuo account.', title: 'Rimuovi metodo di pagamento', },packages/localizations/src/ta-IN.ts (2)
287-303
: Update Tamil strings to reflect “payment method” terminology.These entries still reference “கட்டண மூலத்தை” (“payment source”), undermining the rename to “payment method”. Please refresh the wording accordingly.
paymentMethodsSection: { actionLabel__default: 'இயல்புநிலையாக்கு', actionLabel__remove: 'நீக்கு', - add: 'புதிய கட்டண மூலத்தைச் சேர்க்கவும்', - addSubtitle: 'உங்கள் கணக்கில் புதிய கட்டண மூலத்தைச் சேர்க்கவும்.', + add: 'புதிய கட்டண முறையைச் சேர்க்கவும்', + addSubtitle: 'உங்கள் கணக்கில் புதிய கட்டண முறையைச் சேர்க்கவும்.', cancelButton: 'ரத்து செய்', formButtonPrimary__add: 'கட்டண முறையைச் சேர்', formButtonPrimary__pay: '{{amount}} செலுத்து', payWithTestCardButton: undefined, removeMethod: { messageLine1: '{{identifier}} இந்த கணக்கிலிருந்து நீக்கப்படும்.', messageLine2: - 'இந்த கட்டண மூலத்தை இனி பயன்படுத்த முடியாது மற்றும் அதைச் சார்ந்த எந்த தொடர் சந்தாக்களும் இனி செயல்படாது.', + 'இந்த கட்டண முறையை இனி பயன்படுத்த முடியாது மற்றும் அதைச் சார்ந்த எந்த தொடர் சந்தாக்களும் இனி செயல்படாது.', successMessage: '{{paymentMethod}} உங்கள் கணக்கிலிருந்து நீக்கப்பட்டது.', - title: 'கட்டண மூலத்தை நீக்கு', + title: 'கட்டண முறையை நீக்கு', }, title: 'கிடைக்கும் விருப்பங்கள்', },
983-999
: Align user profile billing strings with the new terminology.The user-profile billing section still says “கட்டண மூலத்தை”. Please update these to “கட்டண முறையை” so the UI matches the renamed keys.
paymentMethodsSection: { actionLabel__default: 'இயல்புநிலையாக்கு', actionLabel__remove: 'நீக்கு', - add: 'புதிய கட்டண மூலத்தைச் சேர்க்கவும்', - addSubtitle: 'உங்கள் கணக்கில் புதிய கட்டண மூலத்தைச் சேர்க்கவும்.', + add: 'புதிய கட்டண முறையைச் சேர்க்கவும்', + addSubtitle: 'உங்கள் கணக்கில் புதிய கட்டண முறையைச் சேர்க்கவும்.', cancelButton: 'ரத்து செய்', formButtonPrimary__add: 'கட்டண முறையைச் சேர்', formButtonPrimary__pay: '{{amount}} செலுத்து', payWithTestCardButton: undefined, removeMethod: { messageLine1: '{{identifier}} இந்த கணக்கிலிருந்து நீக்கப்படும்.', messageLine2: - 'இந்த கட்டண மூலத்தை இனி பயன்படுத்த முடியாது மற்றும் அதைச் சார்ந்த எந்த தொடர் சந்தாக்களும் இனி செயல்படாது.', + 'இந்த கட்டண முறையை இனி பயன்படுத்த முடியாது மற்றும் அதைச் சார்ந்த எந்த தொடர் சந்தாக்களும் இனி செயல்படாது.', successMessage: '{{paymentMethod}} உங்கள் கணக்கிலிருந்து நீக்கப்பட்டது.', - title: 'கட்டண மூலத்தை நீக்கு', + title: 'கட்டண முறையை நீக்கு', }, title: 'கிடைக்கும் விருப்பங்கள்', },packages/localizations/src/vi-VN.ts (2)
290-307
: Update Vietnamese translation to match the terminology change.The key has been correctly renamed from
paymentSourcesSection
topaymentMethodsSection
and the interpolation variable in line 303 correctly uses{{paymentMethod}}
. However, line 302 still contains the Vietnamese text "nguồn thanh toán" (payment source) which is inconsistent with the rename initiative. For consistency with the new "payment method" terminology used throughout the rest of the file (e.g., lines 73, 128, 293, 296, 304, 306), this should be updated to "phương thức thanh toán" (payment method).Apply this diff to update the Vietnamese translation:
messageLine1: '{{identifier}} sẽ bị xóa khỏi tài khoản này.', messageLine2: - 'Bạn sẽ không còn thể sử dụng nguồn thanh toán này và bất kỳ đăng ký lặp lại nào phụ thuộc vào nó sẽ không còn hoạt động.', + 'Bạn sẽ không còn thể sử dụng phương thức thanh toán này và bất kỳ đăng ký lặp lại nào phụ thuộc vào nó sẽ không còn hoạt động.', successMessage: '{{paymentMethod}} đã bị xóa khỏi tài khoản của bạn.',
973-990
: Update Vietnamese translation to match the terminology change.Similar to the organizationProfile section, line 985 still contains "nguồn thanh toán" (payment source) in the Vietnamese text, which is inconsistent with the rename from "payment source" to "payment method". This should be updated to "phương thức thanh toán" to maintain consistency.
Apply this diff to update the Vietnamese translation:
messageLine1: '{{identifier}} sẽ bị xóa khỏi tài khoản này.', messageLine2: - 'Bạn sẽ không còn thể sử dụng nguồn thanh toán này và bất kỳ đăng ký lặp lại nào phụ thuộc vào nó sẽ không còn hoạt động.', + 'Bạn sẽ không còn thể sử dụng phương thức thanh toán này và bất kỳ đăng ký lặp lại nào phụ thuộc vào nó sẽ không còn hoạt động.', successMessage: '{{paymentMethod}} đã bị xóa khỏi tài khoản của bạn.',packages/localizations/src/bn-IN.ts (2)
289-290
: Bengali translations need updating to match new terminology.The Bengali translations still reference "পেমেন্ট উৎস" (payment source) instead of "পেমেন্ট পদ্ধতি" (payment method), which is inconsistent with the structural changes renaming "sources" to "methods".
Apply this diff to update the translations:
- add: 'নতুন পেমেন্ট উৎস যোগ করুন', - addSubtitle: 'আপনার অ্যাকাউন্টে একটি নতুন পেমেন্ট উৎস যোগ করুন।', + add: 'নতুন পেমেন্ট পদ্ধতি যোগ করুন', + addSubtitle: 'আপনার অ্যাকাউন্টে একটি নতুন পেমেন্ট পদ্ধতি যোগ করুন।',
295-301
: Bengali translations need updating to match new terminology.The Bengali translations in the
removeMethod
section still reference "পেমেন্ট উৎস" (payment source) instead of "পেমেন্ট পদ্ধতি" (payment method).Apply this diff to update the translations:
removeMethod: { messageLine1: '{{identifier}} এই অ্যাকাউন্ট থেকে সরানো হবে।', messageLine2: - 'আপনি আর এই পেমেন্ট উৎস ব্যবহার করতে পারবেন না এবং এর উপর নির্ভরশীল যেকোনো আবর্তক সাবস্ক্রিপশন আর কাজ করবে না।', + 'আপনি আর এই পেমেন্ট পদ্ধতি ব্যবহার করতে পারবেন না এবং এর উপর নির্ভরশীল যেকোনো আবর্তক সাবস্ক্রিপশন আর কাজ করবে না।', successMessage: '{{paymentSource}} আপনার অ্যাকাউন্ট থেকে সরানো হয়েছে।', - title: 'পেমেন্ট উৎস সরান', + title: 'পেমেন্ট পদ্ধতি সরান', },Note: Line 299 uses the interpolation variable
{{paymentSource}}
which might need updating in the calling code to use{{paymentMethod}}
instead, but that's outside the scope of this localization file.packages/localizations/src/ms-MY.ts (2)
286-303
: Update Malay translations to match the new "payment method" terminology.The structural changes from
paymentSourcesSection
topaymentMethodsSection
andremoveResource
toremoveMethod
are correct. However, the Malay translations still reference the old terminology "sumber pembayaran" (payment source) instead of "kaedah pembayaran" (payment method).Apply this diff to update the translations:
paymentMethodsSection: { actionLabel__default: 'Jadikan lalai', actionLabel__remove: 'Keluarkan', - add: 'Tambah sumber pembayaran baharu', - addSubtitle: 'Tambah sumber pembayaran baharu ke akaun anda.', + add: 'Tambah kaedah pembayaran baharu', + addSubtitle: 'Tambah kaedah pembayaran baharu ke akaun anda.', cancelButton: 'Batal', formButtonPrimary__add: 'Tambah Kaedah Pembayaran', formButtonPrimary__pay: 'Bayar {{amount}}', payWithTestCardButton: undefined, removeMethod: { messageLine1: '{{identifier}} akan dikeluarkan dari akaun ini.', messageLine2: - 'Anda tidak akan dapat menggunakan sumber pembayaran ini lagi dan langganan berulang yang bergantung padanya tidak akan berfungsi lagi.', + 'Anda tidak akan dapat menggunakan kaedah pembayaran ini lagi dan langganan berulang yang bergantung padanya tidak akan berfungsi lagi.', successMessage: '{{paymentMethod}} telah dikeluarkan dari akaun anda.', - title: 'Keluarkan sumber pembayaran', + title: 'Keluarkan kaedah pembayaran', }, title: 'Pilihan tersedia', },
981-998
: Update Malay translations in userProfile to match the new "payment method" terminology.Similar to the organizationProfile section, the userProfile billingPage translations still use "sumber pembayaran" (payment source) instead of "kaedah pembayaran" (payment method).
Apply this diff to update the translations:
paymentMethodsSection: { actionLabel__default: 'Jadikan lalai', actionLabel__remove: 'Keluarkan', - add: 'Tambah sumber pembayaran baharu', - addSubtitle: 'Tambah sumber pembayaran baharu ke akaun anda.', + add: 'Tambah kaedah pembayaran baharu', + addSubtitle: 'Tambah kaedah pembayaran baharu ke akaun anda.', cancelButton: 'Batal', formButtonPrimary__add: 'Tambah Kaedah Pembayaran', formButtonPrimary__pay: 'Bayar {{amount}}', payWithTestCardButton: undefined, removeMethod: { messageLine1: '{{identifier}} akan dikeluarkan dari akaun ini.', messageLine2: - 'Anda tidak akan dapat menggunakan sumber pembayaran ini lagi dan langganan berulang yang bergantung padanya tidak akan berfungsi lagi.', + 'Anda tidak akan dapat menggunakan kaedah pembayaran ini lagi dan langganan berulang yang bergantung padanya tidak akan berfungsi lagi.', successMessage: '{{paymentMethod}} telah dikeluarkan dari akaun anda.', - title: 'Keluarkan sumber pembayaran', + title: 'Keluarkan kaedah pembayaran', }, title: 'Pilihan tersedia', },packages/localizations/src/te-IN.ts (2)
285-302
: Telugu translations still use "payment source" terminology.While the key names have been correctly renamed from
paymentSourcesSection
topaymentMethodsSection
and fromremoveResource
toremoveMethod
, the actual Telugu translations still reference "చెల్లింపు మూలాన్ని" (payment source) on lines 288, 289, 297, and 299.Update these translations to use "చెల్లింపు పద్ధతి" (payment method) for consistency with the renamed keys.
Apply this diff to update the Telugu translations:
- add: 'కొత్త చెల్లింపు మూలాన్ని జోడించండి', - addSubtitle: 'మీ ఖాతాకు కొత్త చెల్లింపు మూలాన్ని జోడించండి.', + add: 'కొత్త చెల్లింపు పద్ధతిని జోడించండి', + addSubtitle: 'మీ ఖాతాకు కొత్త చెల్లింపు పద్ధతిని జోడించండి.', cancelButton: 'రద్దు చేయండి', formButtonPrimary__add: 'చెల్లింపు పద్ధతిని జోడించండి', formButtonPrimary__pay: '{{amount}} చెల్లించండి', payWithTestCardButton: undefined, removeMethod: { messageLine1: '{{identifier}} ఈ ఖాతా నుండి తొలగించబడుతుంది.', messageLine2: - 'మీరు ఇకపై ఈ చెల్లింపు మూలాన్ని ఉపయోగించలేరు మరియు దానిపై ఆధారపడిన పునరావృత సబ్స్క్రిప్షన్లు ఇకపై పనిచేయవు.', + 'మీరు ఇకపై ఈ చెల్లింపు పద్ధతిని ఉపయోగించలేరు మరియు దానిపై ఆధారపడిన పునరావృత సబ్స్క్రిప్షన్లు ఇకపై పనిచేయవు.', successMessage: '{{paymentMethod}} మీ ఖాతా నుండి తొలగించబడింది.', - title: 'చెల్లింపు మూలాన్ని తొలగించండి', + title: 'చెల్లింపు పద్ధతిని తొలగించండి', },
978-995
: Telugu translations still use "payment source" terminology (userProfile section).Similar to the
organizationProfile.billingPage
section, theuserProfile.billingPage.paymentMethodsSection
has the same inconsistency. The Telugu translations on lines 981, 982, 990, and 992 still reference "చెల్లింపు మూలాన్ని" (payment source) instead of "చెల్లింపు పద్ధతి" (payment method).Apply this diff to update the Telugu translations:
- add: 'కొత్త చెల్లింపు మూలాన్ని జోడించండి', - addSubtitle: 'మీ ఖాతాకు కొత్త చెల్లింపు మూలాన్ని జోడించండి.', + add: 'కొత్త చెల్లింపు పద్ధతిని జోడించండి', + addSubtitle: 'మీ ఖాతాకు కొత్త చెల్లింపు పద్ధతిని జోడించండి.', cancelButton: 'రద్దు చేయండి', formButtonPrimary__add: 'చెల్లింపు పద్ధతిని జోడించండి', formButtonPrimary__pay: '{{amount}} చెల్లించండి', payWithTestCardButton: undefined, removeMethod: { messageLine1: '{{identifier}} ఈ ఖాతా నుండి తొలగించబడుతుంది.', messageLine2: - 'మీరు ఇకపై ఈ చెల్లింపు మూలాన్ని ఉపయోగించలేరు మరియు దానిపై ఆధారపడిన పునరావృత సబ్స్క్రిప్షన్లు ఇకపై పనిచేయవు.', + 'మీరు ఇకపై ఈ చెల్లింపు పద్ధతిని ఉపయోగించలేరు మరియు దానిపై ఆధారపడిన పునరావృత సబ్స్క్రిప్షన్లు ఇకపై పనిచేయవు.', successMessage: '{{paymentMethod}} మీ ఖాతా నుండి తొలగించబడింది.', - title: 'చెల్లింపు మూలాన్ని తొలగించండి', + title: 'చెల్లింపు పద్ధతిని తొలగించండి', },packages/localizations/src/sr-RS.ts (1)
71-982
: Ensure all locale files use the newpaymentMethod
keys
OldpaymentSource
references remain in:
- packages/localizations/src/kk-KZ.ts
- packages/localizations/src/it-IT.ts
- packages/localizations/src/cs-CZ.ts
- packages/localizations/src/bn-IN.ts
Rename those to match the newbilling.paymentMethod
structure in every locale.packages/localizations/src/es-UY.ts (1)
978-994
: Replace remaining{{paymentSource}}
references in localization files
- kk-KZ.ts:297
- it-IT.ts:306
- bn-IN.ts:299
- cs-CZ.ts:303, 990
Update these placeholders to use
{{paymentMethod}}
.packages/localizations/src/nb-NO.ts (1)
71-175
: Rename leftoverpaymentSource
references topaymentMethod
Several code and localization files still use the old “paymentSource” terminology and must be updated to match your renames:
- packages/types/src/billing.ts:
paymentSourceId
→paymentMethodId
(and update JSDoc).- packages/shared/src/react/hooks/useCheckout.ts: state and props named
paymentSource
.- Localization files (kk-KZ.ts, it-IT.ts, cs-CZ.ts, bn-IN.ts): replace
{{paymentSource}}
and keys liketitle: 'Odebrat platební metodu'
to use “method” nomenclature.- packages/clerk-js/src/ui/components/Checkout/CheckoutForm.tsx & its tests: rename
paymentSourceId
and related props/parameters topaymentMethodId
.packages/localizations/src/bg-BG.ts (1)
965-981
: Replace ‘paymentSource’ with ‘paymentMethod’ in locale success messages
The following locale files still use{{paymentSource}}
and should be updated to{{paymentMethod}}
for consistency:
- it-IT.ts:306
- kk-KZ.ts:297
- cs-CZ.ts:303, 990
- bn-IN.ts:299
packages/localizations/src/fa-IR.ts (3)
291-308
: Fix inconsistent terminology in Persian translation.Line 303 still uses the old term "منبع پرداخت" (payment source) instead of the updated "روش پرداخت" (payment method). This is inconsistent with the PR's objective to rename payment sources to payment methods throughout the codebase.
Apply this diff to fix the terminology:
removeMethod: { messageLine1: '{{identifier}} از این حساب حذف خواهد شد.', messageLine2: - 'شما دیگر نمیتوانید از این منبع پرداخت استفاده کنید و هرگونه اشتراک دورهای وابسته به آن دیگر کار نخواهد کرد.', + 'شما دیگر نمیتوانید از این روش پرداخت استفاده کنید و هرگونه اشتراک دورهای وابسته به آن دیگر کار نخواهد کرد.', successMessage: '{{paymentMethod}} از حساب شما حذف شده است.', title: 'حذف روش پرداخت', },
976-993
: Fix inconsistent terminology in Persian translation (duplicate issue).Line 988 has the same issue as line 303 - it still uses "منبع پرداخت" (payment source) instead of "روش پرداخت" (payment method).
Apply this diff to fix the terminology:
removeMethod: { messageLine1: '{{identifier}} از این حساب حذف خواهد شد.', messageLine2: - 'شما دیگر نمیتوانید از این منبع پرداخت استفاده کنید و هرگونه اشتراک دورهای وابسته به آن دیگر کار نخواهد کرد.', + 'شما دیگر نمیتوانید از این روش پرداخت استفاده کنید و هرگونه اشتراک دورهای وابسته به آن دیگر کار نخواهد کرد.', successMessage: '{{paymentMethod}} از حساب شما حذف شده است.', title: 'حذف روش پرداخت', },
291-308
: Replace remaining paymentSource references in localization files
Occurrences ofpaymentSource
remain in several locale files (e.g., kk-KZ.ts:297, it-IT.ts:306, bn-IN.ts:299, cs-CZ.ts:303/990). Update them topaymentMethod
for consistency.packages/clerk-js/src/ui/components/Subscriptions/SubscriptionsList.tsx (1)
53-68
: Fix the sorting comparator to return 0 for equal elements.The sorting logic returns
1
for all cases where both subscriptions have the same status (both active or both inactive). This violates the comparator contract and can lead to unstable sorting behavior. It should return0
when elements are equal.Apply this diff to fix the sorting logic:
const sortedSubscriptions = useMemo( () => subscriptionItems.sort((a, b) => { // always put active subscriptions first if (a.status === 'active' && b.status !== 'active') { return -1; } if (b.status === 'active' && a.status !== 'active') { return 1; } - return 1; + return 0; }), [subscriptionItems], );packages/localizations/src/cs-CZ.ts (3)
299-305
: Critical: Inconsistent terminology inremoveMethod
dialog.Lines 302-303 still reference "payment source" instead of "payment method":
- Line 302: Czech text says "platební zdroj" (payment source)
- Line 303: Variable
{{paymentSource}}
should be{{paymentMethod}}
This contradicts the PR's objective to rename sources to methods.
Apply this diff:
removeMethod: { messageLine1: '{{identifier}} bude odstraněn z tohoto účtu.', messageLine2: - 'Tento platební zdroj již nebudete moci používat a veškerá opakující se předplatná, která na něm závisí, přestanou fungovat.', - successMessage: '{{paymentSource}} byl odstraněn z vašeho účtu.', + 'Tuto platební metodu již nebudete moci používat a veškerá opakující se předplatná, která na ní závisí, přestanou fungovat.', + successMessage: '{{paymentMethod}} byla odstraněna z vašeho účtu.', title: 'Odebrat platební metodu', },Note: Czech grammar adjustments made for gender agreement (payment method is feminine in Czech, so "která" and "odstraněna" instead of "který" and "odstraněn").
986-992
: Critical: Inconsistent terminology in user profileremoveMethod
dialog.Lines 989-990 have the same issue as the organization profile section—they still reference "payment source" instead of "payment method":
- Line 989: Czech text says "platební zdroj" (payment source)
- Line 990: Variable
{{paymentSource}}
should be{{paymentMethod}}
Apply this diff:
removeMethod: { messageLine1: '{{identifier}} bude odstraněn z tohoto účtu.', messageLine2: - 'Tento platební zdroj již nebudete moci používat a veškerá opakující se předplatná, která na něm závisí, přestanou fungovat.', - successMessage: '{{paymentSource}} byl odstraněn z vašeho účtu.', + 'Tuto platební metodu již nebudete moci používat a veškerá opakující se předplatná, která na ní závisí, přestanou fungovat.', + successMessage: '{{paymentMethod}} byla odstraněna z vašeho účtu.', title: 'Odebrat platební metodu', },Note: Czech grammar adjustments made for gender agreement (payment method is feminine in Czech).
290-307
: Replace “zdroj” with “metodu” in cs-CZ removeMethod dialogs
In packages/localizations/src/cs-CZ.ts (lines 300–304 and 987–991), update messageLine2 from
'Tento platební zdroj již nebudete…'
to
'Tuto platební metodu již nebudete…'packages/localizations/src/hi-IN.ts (1)
289-301
: Update Hindi strings to say “भुगतान विधि”, not “भुगतान स्रोत”.We renamed the feature from “payment source” to “payment method”, but the Hindi copy here still says “भुगतान स्रोत” (in
add
,addSubtitle
,title
,removeMethod.*
, etc.). This reintroduces the old terminology and will surface the wrong phrasing in both the org and user billing pages. Please swap these occurrences to the updated term (e.g., “भुगतान विधि”) so the UI matches the new naming.Also applies to: 978-991
packages/localizations/src/zh-CN.ts (1)
71-175
: Rename legacyremoveResource
keys and verifycommerce.
references
- Replace all
removeResource
entries inpackages/localizations/src/*
withremoveMethod
to match the new billing namespace.- Re-run the legacy key scan for
commerce.
using both.ts
and.tsx
files (e.g.,rg -nP --type=ts --type-add 'tsx:*.tsx' --type=tsx "localizationKeys\(['\"]commerce\."
) to ensure no leftover references.
🧹 Nitpick comments (3)
packages/localizations/src/te-IN.ts (1)
71-125
: Translation values are undefined for new payment method keys.The new
billing.addPaymentMethod__label
andbilling.paymentMethods__label
keys haveundefined
values. While this is acceptable for initial structural changes, ensure these Telugu translations are provided before the PR is merged.packages/clerk-js/src/ui/components/SubscriptionDetails/index.tsx (1)
548-551
: Consider localizing the "/" separator for consistency.While the "/" separator is a common symbol, for complete localization consistency, consider extracting it to a localization key or using a locale-aware formatting approach.
Example:
- {fee.amountFormatted} /{' '} - {t(localizationKeys(`billing.${subscription.planPeriod === 'month' ? 'month' : 'year'}`))} + {t(localizationKeys('billing.pricePerPeriod', { + price: fee.amountFormatted, + period: subscription.planPeriod === 'month' ? 'month' : 'year' + }))}packages/clerk-js/src/ui/components/PaymentMethods/TestPaymentMethod.tsx (1)
41-64
: Localization keys updated to billing.paymentMethod. — good*Add an explicit return type to comply with TS guidelines.
As per coding guidelines, add an explicit return type:
-export const TestPaymentMethod = () => { +export const TestPaymentMethod = (): JSX.Element => {Optional: For full i18n compliance, consider localizing the sample card number and expiry (e.g., add keys under billing.paymentMethod.dev.sampleCardNumber / sampleExpiry) instead of hard-coded strings.
'@clerk/types': minor | ||
--- | ||
|
||
[Billing Beta] Rename payment sources to method methods. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix typo in changeset description.
"method methods" should be "payment methods".
Apply this diff:
-[Billing Beta] Rename payment sources to method methods.
+[Billing Beta] Rename payment sources to payment methods.
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
[Billing Beta] Rename payment sources to method methods. | |
[Billing Beta] Rename payment sources to payment methods. |
🤖 Prompt for AI Agents
.changeset/sad-bikes-tan.md around line 7: the changeset description contains a
typo "method methods" instead of "payment methods"; update that line to read
"[Billing Beta] Rename payment sources to payment methods." so the description
is correct and consistent.
packages/clerk-js/src/ui/components/PaymentAttempts/PaymentAttemptPage.tsx
Show resolved
Hide resolved
packages/clerk-js/src/ui/components/PaymentAttempts/PaymentAttemptPage.tsx
Show resolved
Hide resolved
packages/clerk-js/src/ui/components/PaymentAttempts/PaymentAttemptPage.tsx
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
♻️ Duplicate comments (2)
packages/clerk-js/src/ui/components/Checkout/__tests__/Checkout.test.tsx (2)
127-127
: LGTM! Consistent use of role-based queries.This continues the pattern of using accessible role-based queries established in other tests, which is a best practice for React Testing Library.
192-192
: LGTM! Maintaining consistent role-based query pattern.The use of
getByRole('heading', { name: 'Checkout' })
is consistent with the approach used throughout this test file, following React Testing Library best practices.
🧹 Nitpick comments (1)
packages/clerk-js/src/ui/components/Checkout/__tests__/Checkout.test.tsx (1)
111-111
: Inconsistent destructuring order.The destructuring order here is
getByRole, baseElement
, while other tests in this file (lines 38, 72, 172) usebaseElement, getByRole
. Consider maintaining consistent destructuring order for better code readability.Apply this diff to align with the pattern used elsewhere in the file:
- const { getByRole, baseElement } = render( + const { baseElement, getByRole } = render(
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Disabled knowledge base sources:
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (1)
packages/clerk-js/src/ui/components/Checkout/__tests__/Checkout.test.tsx
(6 hunks)
🧰 Additional context used
📓 Path-based instructions (13)
packages/clerk-js/src/ui/**/*.{ts,tsx}
📄 CodeRabbit inference engine (.cursor/rules/clerk-js-ui.mdc)
packages/clerk-js/src/ui/**/*.{ts,tsx}
: Element descriptors should always be camelCase
Use element descriptors in UI components to enable consistent theming and styling via appearance.elements
Element descriptors should generate unique, stable CSS classes for theming
Element descriptors should handle state classes (e.g., cl-loading, cl-active, cl-error, cl-open) automatically based on component state
Do not render hard-coded values; all user-facing strings must be localized using provided localization methods
Use the useLocalizations hook and localizationKeys utility for all text and error messages
Use the styled system (sx prop, theme tokens, responsive values) for custom component styling
Use useCardState for card-level state, useFormState for form-level state, and useLoadingStatus for loading states
Always use handleError utility for API errors and use translateError for localized error messages
Use useFormControl for form field state, implement proper validation, and handle loading and error states in forms
Use localization keys for all form labels and placeholders
Use element descriptors for consistent styling and follow the theme token system
Use the Card and FormContainer patterns for consistent UI structure
Files:
packages/clerk-js/src/ui/components/Checkout/__tests__/Checkout.test.tsx
**/*.{js,jsx,ts,tsx}
📄 CodeRabbit inference engine (.cursor/rules/development.mdc)
**/*.{js,jsx,ts,tsx}
: All code must pass ESLint checks with the project's configuration
Follow established naming conventions (PascalCase for components, camelCase for variables)
Maintain comprehensive JSDoc comments for public APIs
Use dynamic imports for optional features
All public APIs must be documented with JSDoc
Provide meaningful error messages to developers
Include error recovery suggestions where applicable
Log errors appropriately for debugging
Lazy load components and features when possible
Implement proper caching strategies
Use efficient data structures and algorithms
Profile and optimize critical paths
Validate all inputs and sanitize outputs
Implement proper logging with different levels
Files:
packages/clerk-js/src/ui/components/Checkout/__tests__/Checkout.test.tsx
**/*.{js,jsx,ts,tsx,json,css,scss,md,yaml,yml}
📄 CodeRabbit inference engine (.cursor/rules/development.mdc)
Use Prettier for consistent code formatting
Files:
packages/clerk-js/src/ui/components/Checkout/__tests__/Checkout.test.tsx
packages/**/*.{ts,tsx}
📄 CodeRabbit inference engine (.cursor/rules/development.mdc)
TypeScript is required for all packages
Files:
packages/clerk-js/src/ui/components/Checkout/__tests__/Checkout.test.tsx
packages/**/*.{ts,tsx,d.ts}
📄 CodeRabbit inference engine (.cursor/rules/development.mdc)
Packages should export TypeScript types alongside runtime code
Files:
packages/clerk-js/src/ui/components/Checkout/__tests__/Checkout.test.tsx
**/*.{ts,tsx}
📄 CodeRabbit inference engine (.cursor/rules/development.mdc)
Use proper TypeScript error types
**/*.{ts,tsx}
: Always define explicit return types for functions, especially public APIs
Use proper type annotations for variables and parameters where inference isn't clear
Avoidany
type - preferunknown
when type is uncertain, then narrow with type guards
Useinterface
for object shapes that might be extended
Usetype
for unions, primitives, and computed types
Preferreadonly
properties for immutable data structures
Useprivate
for internal implementation details
Useprotected
for inheritance hierarchies
Usepublic
explicitly for clarity in public APIs
Preferreadonly
for properties that shouldn't change after construction
Prefer composition and interfaces over deep inheritance chains
Use mixins for shared behavior across unrelated classes
Implement dependency injection for loose coupling
Let TypeScript infer when types are obvious
Useconst assertions
for literal types:as const
Usesatisfies
operator for type checking without widening
Use mapped types for transforming object types
Use conditional types for type-level logic
Leverage template literal types for string manipulation
Use ES6 imports/exports consistently
Use default exports sparingly, prefer named exports
Use type-only imports:import type { ... } from ...
Noany
types without justification
Proper error handling with typed errors
Consistent use ofreadonly
for immutable data
Proper generic constraints
No unused type parameters
Proper use of utility types instead of manual type construction
Type-only imports where possible
Proper tree-shaking friendly exports
No circular dependencies
Efficient type computations (avoid deep recursion)
Files:
packages/clerk-js/src/ui/components/Checkout/__tests__/Checkout.test.tsx
**/*.{jsx,tsx}
📄 CodeRabbit inference engine (.cursor/rules/development.mdc)
**/*.{jsx,tsx}
: Use error boundaries in React components
Minimize re-renders in React components
**/*.{jsx,tsx}
: Always use functional components with hooks instead of class components
Follow PascalCase naming for components:UserProfile
,NavigationMenu
Keep components focused on a single responsibility - split large components
Limit component size to 150-200 lines; extract logic into custom hooks
Use composition over inheritance - prefer smaller, composable components
Export components as named exports for better tree-shaking
One component per file with matching filename and component name
Use useState for simple state management
Use useReducer for complex state logic
Implement proper state initialization
Use proper state updates with callbacks
Implement proper state cleanup
Use Context API for theme/authentication
Implement proper state selectors
Use proper state normalization
Implement proper state persistence
Use React.memo for expensive components
Implement proper useCallback for handlers
Use proper useMemo for expensive computations
Implement proper virtualization for lists
Use proper code splitting with React.lazy
Implement proper cleanup in useEffect
Use proper refs for DOM access
Implement proper event listener cleanup
Use proper abort controllers for fetch
Implement proper subscription cleanup
Use proper HTML elements
Implement proper ARIA attributes
Use proper heading hierarchy
Implement proper form labels
Use proper button types
Implement proper focus management
Use proper keyboard shortcuts
Implement proper tab order
Use proper skip links
Implement proper focus traps
Implement proper error boundaries
Use proper error logging
Implement proper error recovery
Use proper error messages
Implement proper error fallbacks
Use proper form validation
Implement proper error states
Use proper error messages
Implement proper form submission
Use proper form reset
Use proper component naming
Implement proper file naming
Use proper prop naming
Implement proper...
Files:
packages/clerk-js/src/ui/components/Checkout/__tests__/Checkout.test.tsx
packages/**/*.{test,spec}.{js,jsx,ts,tsx}
📄 CodeRabbit inference engine (.cursor/rules/monorepo.mdc)
Unit tests should use Jest or Vitest as the test runner.
Files:
packages/clerk-js/src/ui/components/Checkout/__tests__/Checkout.test.tsx
packages/{clerk-js,elements,themes}/**/*.{test,spec}.{js,jsx,ts,tsx}
📄 CodeRabbit inference engine (.cursor/rules/monorepo.mdc)
Visual regression testing should be performed for UI components.
Files:
packages/clerk-js/src/ui/components/Checkout/__tests__/Checkout.test.tsx
**/*.{js,ts,tsx,jsx}
📄 CodeRabbit inference engine (.cursor/rules/monorepo.mdc)
Support multiple Clerk environment variables (CLERK_, NEXT_PUBLIC_CLERK_, etc.) for configuration.
Files:
packages/clerk-js/src/ui/components/Checkout/__tests__/Checkout.test.tsx
**/*.tsx
📄 CodeRabbit inference engine (.cursor/rules/react.mdc)
**/*.tsx
: Use proper type definitions for props and state
Leverage TypeScript's type inference where possible
Use proper event types for handlers
Implement proper generic types for reusable components
Use proper type guards for conditional rendering
Files:
packages/clerk-js/src/ui/components/Checkout/__tests__/Checkout.test.tsx
**/*.test.{jsx,tsx}
📄 CodeRabbit inference engine (.cursor/rules/react.mdc)
**/*.test.{jsx,tsx}
: Use React Testing Library
Test component behavior, not implementation
Use proper test queries
Implement proper test isolation
Use proper test coverage
Test component interactions
Use proper test data
Implement proper test setup
Use proper test cleanup
Implement proper test assertions
Use proper test structure
Files:
packages/clerk-js/src/ui/components/Checkout/__tests__/Checkout.test.tsx
**/__tests__/**/*.{ts,tsx}
📄 CodeRabbit inference engine (.cursor/rules/typescript.mdc)
**/__tests__/**/*.{ts,tsx}
: Create type-safe test builders/factories
Use branded types for test isolation
Implement proper mock types that match interfaces
Files:
packages/clerk-js/src/ui/components/Checkout/__tests__/Checkout.test.tsx
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (5)
- GitHub Check: Formatting | Dedupe | Changeset
- GitHub Check: Build Packages
- GitHub Check: Analyze (javascript-typescript)
- GitHub Check: semgrep-cloud-platform/scan
- GitHub Check: semgrep-cloud-platform/scan
🔇 Additional comments (3)
packages/clerk-js/src/ui/components/Checkout/__tests__/Checkout.test.tsx (3)
38-38
: LGTM! ExtractinggetByRole
for role-based queries.Extracting
getByRole
from the render result is a best practice for React Testing Library, enabling more accessible and semantic test queries.
56-56
: Role-based heading query improves accessibility testing.Using
getByRole('heading', { name: 'Checkout' })
follows React Testing Library best practices by querying elements based on their accessible role and name rather than implementation details like data attributes. This approach is more resilient to structural changes and better reflects how users interact with the component.Note: The test is now coupled to the English translation "Checkout". If tests run with different locales or if the translation changes, this assertion would need updating.
172-172
: LGTM! Consistent destructuring pattern.The destructuring order is consistent with other tests in this file, maintaining good code style.
Description
This PR introduces breaking changes to localization keys that relate to billing, previously known as commerce. It also renames payment sources to payment methods.
Checklist
pnpm test
runs as expected.pnpm build
runs as expected.Type of change
Summary by CodeRabbit
New Features
Localization
Chores
Tests