theme.keycloak.v2.admin.resources.assets.useLocale-BsnKjfE6.js.map Maven / Gradle / Ivy
{"version":3,"file":"useLocale-BsnKjfE6.js","sources":["../../src/utils/useLocale.ts"],"sourcesContent":["import { useMemo } from \"react\";\nimport { useRealm } from \"../context/realm-context/RealmContext\";\nimport { DEFAULT_LOCALE } from \"../i18n/i18n\";\n\nexport default function useLocale() {\n const { realmRepresentation: realm } = useRealm();\n\n const defaultSupportedLocales = useMemo(() => {\n return realm?.supportedLocales?.length\n ? realm.supportedLocales\n : [DEFAULT_LOCALE];\n }, [realm]);\n\n const defaultLocales = useMemo(() => {\n return realm?.defaultLocale?.length ? [realm.defaultLocale] : [];\n }, [realm]);\n\n const combinedLocales = useMemo(() => {\n return Array.from(new Set([...defaultLocales, ...defaultSupportedLocales]));\n }, [defaultLocales, defaultSupportedLocales]);\n\n return combinedLocales;\n}\n"],"names":["useLocale","realm","useRealm","defaultSupportedLocales","useMemo","DEFAULT_LOCALE","defaultLocales"],"mappings":"+EAIA,SAAwBA,GAAY,CAClC,KAAM,CAAE,oBAAqBC,CAAM,EAAIC,EAAS,EAE1CC,EAA0BC,EAAQ,IAC/BH,GAAO,kBAAkB,OAC5BA,EAAM,iBACN,CAACI,CAAc,EAClB,CAACJ,CAAK,CAAC,EAEJK,EAAiBF,EAAQ,IACtBH,GAAO,eAAe,OAAS,CAACA,EAAM,aAAa,EAAI,GAC7D,CAACA,CAAK,CAAC,EAMH,OAJiBG,EAAQ,IACvB,MAAM,KAAK,IAAI,IAAI,CAAC,GAAGE,EAAgB,GAAGH,CAAuB,CAAC,CAAC,EACzE,CAACG,EAAgBH,CAAuB,CAAC,CAG9C"}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy