mirror of
https://github.com/TeamPiped/Piped.git
synced 2024-08-14 23:57:27 +00:00
Fix vite from complaining about import analysis.
This commit is contained in:
parent
b5b238656b
commit
ce48bd55f1
2 changed files with 4 additions and 4 deletions
|
@ -63,9 +63,9 @@ 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(
|
const localeTime = await import(`../node_modules/javascript-time-ago/locale/${locale}.json`).then(
|
||||||
"./../node_modules/javascript-time-ago/locale/" + locale + ".json"
|
module => module.default,
|
||||||
).then(module => module.default);
|
);
|
||||||
App.TimeAgo.addLocale(localeTime);
|
App.TimeAgo.addLocale(localeTime);
|
||||||
App.TimeAgoConfig.locale = locale;
|
App.TimeAgoConfig.locale = locale;
|
||||||
}
|
}
|
||||||
|
|
|
@ -253,7 +253,7 @@ const mixin = {
|
||||||
const languages = window.navigator.languages;
|
const languages = window.navigator.languages;
|
||||||
for (let i = 0; i < languages.length; i++) {
|
for (let i = 0; i < languages.length; i++) {
|
||||||
try {
|
try {
|
||||||
await import("./locales/" + languages[i] + ".json");
|
await import(`./locales/${languages[i]}.json`);
|
||||||
return languages[i];
|
return languages[i];
|
||||||
} catch {
|
} catch {
|
||||||
continue;
|
continue;
|
||||||
|
|
Loading…
Reference in a new issue