mirror of
https://github.com/TeamPiped/Piped.git
synced 2024-11-10 02:08:21 +00:00
parent
e19fbca300
commit
a5b5b94b43
@ -63,6 +63,13 @@ export default {
|
||||
|
||||
(async function() {
|
||||
const locale = App.getPreferenceString("hl", App.defaultLangage);
|
||||
if (locale !== App.TimeAgoConfig.locale) {
|
||||
const localeTime = await import("javascript-time-ago/locale/" + locale + ".json").then(
|
||||
module => module.default,
|
||||
);
|
||||
App.TimeAgo.addLocale(localeTime);
|
||||
App.TimeAgoConfig.locale = locale;
|
||||
}
|
||||
if (window.i18n.global.locale.value !== locale) {
|
||||
if (!window.i18n.global.availableLocales.includes(locale)) {
|
||||
const messages = await import("@/locales/" + locale + ".json").then(module => module.default);
|
||||
|
@ -225,6 +225,12 @@ const mixin = {
|
||||
return "en";
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
TimeAgo: TimeAgo,
|
||||
TimeAgoConfig: timeAgo,
|
||||
};
|
||||
},
|
||||
};
|
||||
|
||||
const i18n = createI18n({
|
||||
|
Loading…
Reference in New Issue
Block a user