Merge branch 'hotfix/AW-195-fix-error' into 'main'

hotfix/AW-195-fix-error

See merge request witapp/aura-webapp!337
This commit is contained in:
Daniil Chemerkin 2024-08-28 21:27:43 +00:00
commit b961bffa0b
2 changed files with 7 additions and 1 deletions

View File

@ -15,6 +15,7 @@ import {
getTranslationJSON,
ELocalesPlacement,
language,
setLanguage,
} from "./locales";
import App from "./components/App";
import metricService from "./services/metric/metricService";
@ -27,6 +28,7 @@ pdfjs.GlobalWorkerOptions.workerSrc = `https://unpkg.com/pdfjs-dist@${pdfjs.vers
const environments = import.meta.env;
const init = async () => {
await setLanguage();
const api = createApi();
const currentPlacement = localStorage.getItem(
"locales-placement"

View File

@ -23,8 +23,12 @@ export const getClientLocale = async () => {
}
export const getClientTimezone = () => Intl.DateTimeFormat().resolvedOptions().timeZone
export const language = await getClientLocale()
export const fallbackLng = 'en'
export let language: string = fallbackLng;
export const setLanguage = async () => {
language = await getClientLocale();
};
const omitKeys = ['href', 'title', 'url_slug', 'type']
// const isWeb = (group: Elements.ElementGroup) => group.name === 'web'