Skip to content

Commit

Permalink
feat: translation for already registered error
Browse files Browse the repository at this point in the history
  • Loading branch information
johannschopplich committed Jun 18, 2024
1 parent 5ce8e7b commit face11b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ export const TRANSLATIONS: Record<Locale, Messages> = {
'modal.fields.orderId.help': '<a href="https://app.lemonsqueezy.com/my-orders" target="_blank">Get your order number</a> from Lemon Squeezy or <a href="mailto:hello@kirby.tools">contact us</a> if you cannot find it.',
'modal.error.required.fields': 'Email address and order ID are required',
'modal.error.invalid.licenseKey': 'License key invalid for this plugin',
'modal.error.registered': 'License key already registered',
'activate': 'Activate',
'activated': 'Plugin activated',
},
Expand All @@ -16,6 +17,7 @@ export const TRANSLATIONS: Record<Locale, Messages> = {
'modal.fields.orderId.help': 'Rufe die <a href="https://app.lemonsqueezy.com/my-orders" target="_blank">Bestellnummer von Lemon Squeezy ab</a> oder <a href="mailto:hello@kirby.tools">kontaktiere uns</a>, wenn du sie nicht finden kannst.',
'modal.error.required.fields': 'E-Mail-Adresse und Bestellnummer sind notwendig',
'modal.error.invalid.licenseKey': 'Lizenzschlüssel ungültig für dieses Plugin',
'modal.error.registered': 'Lizenzschlüssel bereits registriert',
'activate': 'Aktivieren',
'activated': 'Plugin aktiviert',
},
Expand All @@ -24,6 +26,7 @@ export const TRANSLATIONS: Record<Locale, Messages> = {
'modal.fields.orderId.help': 'Obtenez votre numéro de commande sur <a href="https://app.lemonsqueezy.com/my-orders" target="_blank">Lemon Squeezy</a> ou <a href="mailto:hello@kirby.tools">contactez-nous</a> si vous ne le trouvez pas.',
'modal.error.required.fields': 'Adresse e-mail et numéro de commande requis',
'modal.error.invalid.licenseKey': 'Clé de licence invalide pour ce plugin',
'modal.error.registered': 'Clé de licence déjà enregistrée',
'activate': 'Activer',
'activated': 'Plugin activé',
},
Expand Down
3 changes: 3 additions & 0 deletions src/license.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,9 @@ export function useLicense({
if (message === 'License key not valid for this plugin') {
message = t('modal.error.invalid.licenseKey')!
}
else if (message === 'License key already registered') {
message = t('modal.error.registered')!
}
panel.notification.error(message)
return
}
Expand Down

0 comments on commit face11b

Please sign in to comment.