i18n need to be passed as props if we want to be able to ovewrite

This commit is contained in:
Joseph Garrone
2024-06-09 11:20:45 +02:00
parent 2015882688
commit 7a040935e9
57 changed files with 310 additions and 246 deletions

View File

@ -6,10 +6,10 @@ import { getKcClsx } from "keycloakify/login/lib/kcClsx";
import { useInsertScriptTags } from "keycloakify/tools/useInsertScriptTags";
import { useInsertLinkTags } from "keycloakify/tools/useInsertLinkTags";
import { useSetClassName } from "keycloakify/tools/useSetClassName";
import type { I18n } from "./i18n";
import type { KcContext } from "./KcContext";
import { useI18n } from "./i18n";
export default function Template(props: TemplateProps<KcContext>) {
export default function Template(props: TemplateProps<KcContext, I18n>) {
const {
displayInfo = false,
displayMessage = true,
@ -21,6 +21,7 @@ export default function Template(props: TemplateProps<KcContext>) {
documentTitle,
bodyClassName,
kcContext,
i18n,
doUseDefaultCss,
classes,
children
@ -28,7 +29,7 @@ export default function Template(props: TemplateProps<KcContext>) {
const { kcClsx } = getKcClsx({ doUseDefaultCss, classes });
const { msg, msgStr, getChangeLocalUrl, labelBySupportedLanguageTag, currentLanguageTag } = useI18n({ kcContext });
const { msg, msgStr, getChangeLocalUrl, labelBySupportedLanguageTag, currentLanguageTag } = i18n;
const { realm, locale, auth, url, message, isAppInitiatedAction, authenticationSession, scripts } = kcContext;