There is no reason not to let use translations outside of keycloak
This commit is contained in:
parent
305d5b7328
commit
6222850453
@ -2,14 +2,12 @@
|
|||||||
import { createUseGlobalState } from "powerhooks";
|
import { createUseGlobalState } from "powerhooks";
|
||||||
import { kcContext } from "../kcContext";
|
import { kcContext } from "../kcContext";
|
||||||
import { getBestMatchAmongKcLanguageTag } from "./KcLanguageTag";
|
import { getBestMatchAmongKcLanguageTag } from "./KcLanguageTag";
|
||||||
import { assert } from "evt/tools/typeSafety/assert";
|
|
||||||
|
|
||||||
export const { useKcLanguageTag } = createUseGlobalState(
|
export const { useKcLanguageTag } = createUseGlobalState(
|
||||||
"kcLanguageTag",
|
"kcLanguageTag",
|
||||||
() => getBestMatchAmongKcLanguageTag((
|
() => getBestMatchAmongKcLanguageTag(
|
||||||
assert(kcContext !== undefined, "Page not served by KeyCloak"),
|
kcContext?.locale?.["current" as never] ??
|
||||||
kcContext.locale?.["current" as never] ??
|
|
||||||
navigator.language
|
navigator.language
|
||||||
)),
|
),
|
||||||
{ "persistance": "cookies" }
|
{ "persistance": "cookies" }
|
||||||
);
|
);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user