mirror of
https://github.com/louislam/uptime-kuma.git
synced 2025-08-21 05:55:45 +08:00
Fixed Change Language Direction In Setting Page
This commit is contained in:
@@ -2,6 +2,7 @@ import dayjs from "dayjs";
|
||||
import timezone from "dayjs/plugin/timezone";
|
||||
import utc from "dayjs/plugin/utc";
|
||||
import timezones from "timezones-list";
|
||||
import { localeDirection, currentLocale } from "./i18n";
|
||||
|
||||
dayjs.extend(utc);
|
||||
dayjs.extend(timezone);
|
||||
@@ -30,7 +31,7 @@ export function timezoneList() {
|
||||
time: getTimezoneOffset(timezone.tzCode),
|
||||
});
|
||||
} catch (e) {
|
||||
console.log("Skip Timezone: " + timezone.tzCode);
|
||||
// Skipping not supported timezone.tzCode by dayjs
|
||||
}
|
||||
}
|
||||
|
||||
@@ -48,3 +49,9 @@ export function timezoneList() {
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
export function setPageLocale() {
|
||||
const html = document.documentElement
|
||||
html.setAttribute('lang', currentLocale() )
|
||||
html.setAttribute('dir', localeDirection() )
|
||||
}
|
Reference in New Issue
Block a user