Better locale default for status page.

This commit is contained in:
Kevin Petit 2021-10-07 17:59:15 +02:00
parent 7907c07034
commit 5b758a4e98

View File

@ -49,7 +49,10 @@ const languageList = {
const rtlLangs = ["fa"];
export const currentLocale = () => localStorage.locale || "en";
export const currentLocale = () => localStorage.locale
|| languageList[navigator.language] && navigator.language
|| languageList[navigator.language.substring(0, 2)] && navigator.language.substring(0, 2)
|| "en";
export const localeDirection = () => {
return rtlLangs.includes(currentLocale()) ? "rtl" : "ltr";