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 { kcContext } from "../kcContext";
|
||||
import { getBestMatchAmongKcLanguageTag } from "./KcLanguageTag";
|
||||
import { assert } from "evt/tools/typeSafety/assert";
|
||||
|
||||
export const { useKcLanguageTag } = createUseGlobalState(
|
||||
"kcLanguageTag",
|
||||
() => getBestMatchAmongKcLanguageTag((
|
||||
assert(kcContext !== undefined, "Page not served by KeyCloak"),
|
||||
kcContext.locale?.["current" as never] ??
|
||||
() => getBestMatchAmongKcLanguageTag(
|
||||
kcContext?.locale?.["current" as never] ??
|
||||
navigator.language
|
||||
)),
|
||||
),
|
||||
{ "persistance": "cookies" }
|
||||
);
|
||||
|
Loading…
x
Reference in New Issue
Block a user