mirror of
https://github.com/TeamPiped/Piped.git
synced 2024-11-26 23:47:25 +00:00
parent
187804f9a1
commit
1dbd1e375b
@ -46,7 +46,8 @@ export default {
|
|||||||
const App = this;
|
const App = this;
|
||||||
|
|
||||||
(async function () {
|
(async function () {
|
||||||
const locale = App.getPreferenceString("hl", App.defaultLangage);
|
const defaultLang = await App.defaultLangage;
|
||||||
|
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"
|
"./../node_modules/javascript-time-ago/locale/" + locale + ".json"
|
||||||
|
@ -357,7 +357,7 @@ export default {
|
|||||||
this.showComments = this.getPreferenceBoolean("comments", true);
|
this.showComments = this.getPreferenceBoolean("comments", true);
|
||||||
this.minimizeDescription = this.getPreferenceBoolean("minimizeDescription", false);
|
this.minimizeDescription = this.getPreferenceBoolean("minimizeDescription", false);
|
||||||
this.watchHistory = this.getPreferenceBoolean("watchHistory", false);
|
this.watchHistory = this.getPreferenceBoolean("watchHistory", false);
|
||||||
this.selectedLanguage = this.getPreferenceString("hl", this.defaultLangage);
|
this.selectedLanguage = this.getPreferenceString("hl", await this.defaultLangage);
|
||||||
this.enabledCodecs = this.getPreferenceString("enabledCodecs", "vp9,avc").split(",");
|
this.enabledCodecs = this.getPreferenceString("enabledCodecs", "vp9,avc").split(",");
|
||||||
this.disableLBRY = this.getPreferenceBoolean("disableLBRY", false);
|
this.disableLBRY = this.getPreferenceBoolean("disableLBRY", false);
|
||||||
this.proxyLBRY = this.getPreferenceBoolean("proxyLBRY", false);
|
this.proxyLBRY = this.getPreferenceBoolean("proxyLBRY", false);
|
||||||
@ -373,14 +373,14 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
onChange() {
|
async onChange() {
|
||||||
if (this.testLocalStorage) {
|
if (this.testLocalStorage) {
|
||||||
var shouldReload = false;
|
var shouldReload = false;
|
||||||
|
|
||||||
if (
|
if (
|
||||||
this.getPreferenceString("theme", "dark") !== this.selectedTheme ||
|
this.getPreferenceString("theme", "dark") !== this.selectedTheme ||
|
||||||
this.getPreferenceBoolean("watchHistory", false) != this.watchHistory ||
|
this.getPreferenceBoolean("watchHistory", false) != this.watchHistory ||
|
||||||
this.getPreferenceString("hl", this.defaultLangage) !== this.selectedLanguage ||
|
this.getPreferenceString("hl", await this.defaultLangage) !== this.selectedLanguage ||
|
||||||
this.getPreferenceString("enabledCodecs", "av1,vp9,avc") !== this.enabledCodecs.join(",")
|
this.getPreferenceString("enabledCodecs", "av1,vp9,avc") !== this.enabledCodecs.join(",")
|
||||||
)
|
)
|
||||||
shouldReload = true;
|
shouldReload = true;
|
||||||
|
@ -208,11 +208,11 @@ const mixin = {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
defaultLangage() {
|
async defaultLangage() {
|
||||||
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 {
|
||||||
require("@/locales/" + languages[i] + ".json");
|
await import("./locales/" + languages[i] + ".json");
|
||||||
return languages[i];
|
return languages[i];
|
||||||
} catch {
|
} catch {
|
||||||
continue;
|
continue;
|
||||||
|
Loading…
Reference in New Issue
Block a user