Skip to content
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

fix(localizations): Force interpolation for socialButtonsBlockButtonManyInView #4887

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .changeset/lemon-ducks-hug.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@clerk/localizations': patch
'@clerk/types': patch
---

Update `socialButtonsBlockButtonManyInView` to only accept `'${string}{{provider|titleize}}${string}'` or `undefined`.
2 changes: 1 addition & 1 deletion packages/localizations/src/be-BY.ts
Original file line number Diff line number Diff line change
Expand Up @@ -547,7 +547,7 @@ export const beBY: LocalizationResource = {
},
},
socialButtonsBlockButton: 'Працягнуць з дапамогай {{provider|titleize}}',
socialButtonsBlockButtonManyInView: 'Увядзіце дадатковыя спосабы ўваходу',
socialButtonsBlockButtonManyInView: undefined,
Copy link
Member

Choose a reason for hiding this comment

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

@panteliselef Why don't we do the following for all localizations?

Suggested change
socialButtonsBlockButtonManyInView: undefined,
socialButtonsBlockButtonManyInView: '{{provider|titleize}}',

Copy link
Member Author

Choose a reason for hiding this comment

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

@anagstef if left undefined it will use the one defined in en-US right ?

Copy link
Member

Choose a reason for hiding this comment

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

Yes, but there is a risk that someone will try to translate this wrong in the future again.

Copy link
Member Author

Choose a reason for hiding this comment

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

i'm confused, but Typescript will not let them.


unstable__errors: {
already_a_member_in_organization: 'Вы ўжо з’яўляецеся членам гэтай арганізацыі.',
Expand Down
2 changes: 1 addition & 1 deletion packages/localizations/src/cs-CZ.ts
Original file line number Diff line number Diff line change
Expand Up @@ -540,7 +540,7 @@ export const csCZ: LocalizationResource = {
},
},
socialButtonsBlockButton: 'Pokračovat s {{provider|titleize}}',
socialButtonsBlockButtonManyInView: 'Máme více možností přihlášení.',
socialButtonsBlockButtonManyInView: undefined,
unstable__errors: {
already_a_member_in_organization: 'Již jste členem organizace.',
captcha_invalid:
Expand Down
2 changes: 1 addition & 1 deletion packages/localizations/src/da-DK.ts
Original file line number Diff line number Diff line change
Expand Up @@ -542,7 +542,7 @@ export const daDK: LocalizationResource = {
},
},
socialButtonsBlockButton: 'Forsæt med {{provider|titleize}}',
socialButtonsBlockButtonManyInView: 'Vælg en metode til at fortsætte',
socialButtonsBlockButtonManyInView: undefined,
unstable__errors: {
already_a_member_in_organization: undefined,
captcha_invalid:
Expand Down
3 changes: 1 addition & 2 deletions packages/localizations/src/de-DE.ts
Original file line number Diff line number Diff line change
Expand Up @@ -547,8 +547,7 @@ export const deDE: LocalizationResource = {
},
},
socialButtonsBlockButton: 'Weiter mit {{provider|titleize}}',
socialButtonsBlockButtonManyInView:
'Zu viele Buttons angezeigt. Reduzieren Sie die Anzahl der Buttons, um fortzufahren.',
socialButtonsBlockButtonManyInView: undefined,
unstable__errors: {
already_a_member_in_organization: 'Sie sind bereits Mitglied in dieser Organisation.',
captcha_invalid:
Expand Down
2 changes: 1 addition & 1 deletion packages/localizations/src/es-ES.ts
Original file line number Diff line number Diff line change
Expand Up @@ -549,7 +549,7 @@ export const esES: LocalizationResource = {
},
},
socialButtonsBlockButton: 'Continuar con {{provider|titleize}}',
socialButtonsBlockButtonManyInView: 'Demasiados botones sociales visibles. Desplázate para ver más.',
socialButtonsBlockButtonManyInView: undefined,
unstable__errors: {
already_a_member_in_organization: '{{email}} ya es miembro de la organización.',
captcha_invalid:
Expand Down
2 changes: 1 addition & 1 deletion packages/localizations/src/fr-FR.ts
Original file line number Diff line number Diff line change
Expand Up @@ -548,7 +548,7 @@ export const frFR: LocalizationResource = {
},
},
socialButtonsBlockButton: 'Continuer avec {{provider|titleize}}',
socialButtonsBlockButtonManyInView: 'Afficher plus de boutons sociaux',
socialButtonsBlockButtonManyInView: undefined,
unstable__errors: {
already_a_member_in_organization: 'Vous êtes déjà membre de cette organisation.',
captcha_invalid:
Expand Down
3 changes: 1 addition & 2 deletions packages/localizations/src/it-IT.ts
Original file line number Diff line number Diff line change
Expand Up @@ -543,8 +543,7 @@ export const itIT: LocalizationResource = {
},
},
socialButtonsBlockButton: 'Continua con {{provider|titleize}}',
socialButtonsBlockButtonManyInView: 'Continua con uno dei seguenti provider',

socialButtonsBlockButtonManyInView: undefined,
unstable__errors: {
already_a_member_in_organization: 'Sei già un membro di questa organizzazione.',
captcha_invalid:
Expand Down
2 changes: 1 addition & 1 deletion packages/localizations/src/pt-PT.ts
Original file line number Diff line number Diff line change
Expand Up @@ -543,7 +543,7 @@ export const ptPT: LocalizationResource = {
},
},
socialButtonsBlockButton: 'Continuar com {{provider|titleize}}',
socialButtonsBlockButtonManyInView: 'Escolha uma das opções abaixo',
socialButtonsBlockButtonManyInView: undefined,
unstable__errors: {
already_a_member_in_organization: 'Já é membro nesta organização.',
captcha_invalid:
Expand Down
7 changes: 6 additions & 1 deletion packages/types/src/localization.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,12 @@ type _LocalizationResource = {
[r: string]: LocalizationValue;
};
socialButtonsBlockButton: LocalizationValue;
socialButtonsBlockButtonManyInView: LocalizationValue;
/**
* It should be used to provide a shorter variation of `socialButtonsBlockButton`.
* It is explicitly typed, in order to avoid contributions that use LLM tools to generate
* translations that misinterpret the correct usage of this property.
*/
socialButtonsBlockButtonManyInView: `${string}{{provider|titleize}}${string}`;
dividerText: LocalizationValue;
formFieldLabel__emailAddress: LocalizationValue;
formFieldLabel__emailAddresses: LocalizationValue;
Expand Down
Loading