mirror of
https://github.com/TeamPiped/Piped.git
synced 2025-01-11 15:27:00 +00:00
parent
e425fbeed1
commit
a3382c2a4f
@ -67,12 +67,14 @@ export default {
|
|||||||
const defaultLang = await App.defaultLangage;
|
const defaultLang = await App.defaultLangage;
|
||||||
const locale = App.getPreferenceString("hl", defaultLang);
|
const locale = App.getPreferenceString("hl", defaultLang);
|
||||||
if (locale !== App.TimeAgoConfig.locale) {
|
if (locale !== App.TimeAgoConfig.locale) {
|
||||||
const localeTime = await import(`../node_modules/javascript-time-ago/locale/${locale}.json`).then(
|
const localeTime = await import(`../node_modules/javascript-time-ago/locale/${locale}.json`)
|
||||||
module => module.default,
|
.catch(() => null)
|
||||||
);
|
.then(module => module?.default);
|
||||||
|
if (localeTime) {
|
||||||
App.TimeAgo.addLocale(localeTime);
|
App.TimeAgo.addLocale(localeTime);
|
||||||
App.TimeAgoConfig.locale = locale;
|
App.TimeAgoConfig.locale = locale;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if (window.i18n.global.locale.value !== locale) {
|
if (window.i18n.global.locale.value !== locale) {
|
||||||
if (!window.i18n.global.availableLocales.includes(locale)) {
|
if (!window.i18n.global.availableLocales.includes(locale)) {
|
||||||
const messages = await import(`./locales/${locale}.json`).then(module => module.default);
|
const messages = await import(`./locales/${locale}.json`).then(module => module.default);
|
||||||
|
Loading…
Reference in New Issue
Block a user