Skip to content

Commit

Permalink
Migrating i18n to Keycloakify v7
Browse files Browse the repository at this point in the history
  • Loading branch information
garronej committed Mar 24, 2023
1 parent beca5e8 commit a6a7bfa
Showing 1 changed file with 33 additions and 45 deletions.
78 changes: 33 additions & 45 deletions src/ui/keycloak-theme/i18n.ts
@@ -1,48 +1,36 @@
import { useI18n as useI18nBase } from "keycloakify";
import { createUseI18n } from "keycloakify/login";

type Props = Omit<Parameters<typeof useI18nBase>[0], "extraMessages">;

export function useI18n(props: Props) {
const { kcContext } = props;
return useI18nBase({
kcContext,
"extraMessages": {
"en": {
"brand": "SILL",
"service title": "Socle interministériel de logiciels libres",
"home title": "Home - Socle interministériel de logiciels libres",
"back": "Back",
"alphanumericalCharsOnly": "Only alphanumerical characters",
"administrativeEmail": "Administrative Email",
"agencyName": "Agency Name",
"connect": "Connect",
"selfCredentials": "Or use your credentials",
"email": "Your personal email",
"email hint": "For example : name@example.com",
"password": "Your password",
"noAccount": "No account yet",
"backToLogin": "Back to login"
},
"fr": {
/* spell-checker: disable */
"brand": "SILL",
"service title": "Socle interministériel de logiciels libres",
"home title": "Acceuil - Socle interministériel de logiciels libres",
"back": "Retour",
"alphanumericalCharsOnly": "Caractère alphanumérique uniquement",
"administrativeEmail": "Email administratif",
"agencyName": "Nom du service de rattachement",
"connect": "Se connecter",
"selfCredentials": "Ou utiliser vos identifiants",
"email": "Votre email personnel",
"email hint": "Par exemple : nom@exemple.com",
"password": "Votre mot de passe",
"noAccount": "Pas encore de compte",
"backToLogin": "Retour à la connexion"
/* spell-checker: enable */
}
}
});
}
export const { useI18n } = createUseI18n({
"en": {
"home": "Home",
"back": "Back",
"alphanumericalCharsOnly": "Only alphanumerical characters",
"administrativeEmail": "Administrative Email",
"agencyName": "Agency Name",
"connect": "Connect",
"selfCredentials": "Or use your credentials",
"email": "Your personal email",
"email hint": "For example : name@example.com",
"password": "Your password",
"noAccount": "No account yet",
"backToLogin": "Back to login"
},
"fr": {
/* spell-checker: disable */
"home": "Acceuil",
"back": "Retour",
"alphanumericalCharsOnly": "Caractère alphanumérique uniquement",
"administrativeEmail": "Email administratif",
"agencyName": "Nom du service de rattachement",
"connect": "Se connecter",
"selfCredentials": "Ou utiliser vos identifiants",
"email": "Votre email personnel",
"email hint": "Par exemple : nom@exemple.com",
"password": "Votre mot de passe",
"noAccount": "Pas encore de compte",
"backToLogin": "Retour à la connexion"
/* spell-checker: enable */
}
});

export type I18n = NonNullable<ReturnType<typeof useI18n>>;

0 comments on commit a6a7bfa

Please sign in to comment.