Skip to content

Commit 4e3cb0a

Browse files
authored
fix(ui,localizations): Localize API keys revoke confirmation input (#8258)
1 parent 51f8104 commit 4e3cb0a

File tree

4 files changed

+13
-3
lines changed

4 files changed

+13
-3
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
'@clerk/localizations': patch
3+
'@clerk/shared': patch
4+
'@clerk/clerk-js': patch
5+
---
6+
7+
Fixed API keys "Revoke" confirmation modal being stuck disabled when using a localization.

packages/localizations/src/en-US.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ export const enUS: LocalizationResource = {
3636
menuAction__revoke: 'Revoke key',
3737
revokeConfirmation: {
3838
confirmationText: 'Revoke',
39+
inputLabel: 'Type "Revoke" to confirm',
3940
formButtonPrimary__revoke: 'Revoke key',
4041
formHint: 'Are you sure you want to delete this Secret key?',
4142
formTitle: 'Revoke "{{apiKeyName}}" secret key?',

packages/shared/src/types/localization.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1287,6 +1287,7 @@ export type __internal_LocalizationResource = {
12871287
formHint: LocalizationValue;
12881288
formButtonPrimary__revoke: LocalizationValue;
12891289
confirmationText: LocalizationValue;
1290+
inputLabel: LocalizationValue;
12901291
};
12911292
lastUsed__seconds: LocalizationValue<'seconds'>;
12921293
lastUsed__minutes: LocalizationValue<'minutes'>;

packages/ui/src/components/APIKeys/RevokeAPIKeyConfirmationModal.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,13 @@ export const RevokeAPIKeyConfirmationModal = ({
3434

3535
const revokeField = useFormControl('apiKeyRevokeConfirmation', '', {
3636
type: 'text',
37-
label: `Type "Revoke" to confirm`,
38-
placeholder: 'Revoke',
37+
label: localizationKeys('apiKeys.revokeConfirmation.inputLabel'),
38+
placeholder: localizationKeys('apiKeys.revokeConfirmation.confirmationText'),
3939
isRequired: true,
4040
});
4141

42-
const canSubmit = revokeField.value === t(localizationKeys('apiKeys.revokeConfirmation.confirmationText'));
42+
const canSubmit =
43+
revokeField.value === (t(localizationKeys('apiKeys.revokeConfirmation.confirmationText')) || 'Revoke');
4344

4445
const handleClose = () => {
4546
onClose();

0 commit comments

Comments
 (0)