hotfix/AW-195-fix-error

This commit is contained in:
gofnnp 2024-08-29 01:25:00 +04:00
parent 2748500ac7
commit a7f334d92d
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'