Add translation keys for "today", "yesterday" and "x days ago".

This commit is contained in:
N-Pex 2022-04-21 09:48:10 +02:00
parent d39f260261
commit 5d05dfd019
4 changed files with 25 additions and 20 deletions

View file

@ -87,16 +87,19 @@ export default {
// Assigns available language for ex 'zh_Hans' when browser header language is 'zh' or 'zh-HK'
this.availableJsonTranslation= LocalesArr[LocalesArr.findIndex(locale => locale.includes(lang))];
if (this.$i18n.messages[this.browserLanguage]) {
this.$store.commit("setLanguage", this.browserLanguage);
} else if (this.browserLanguage.includes("-")) {
if (this.$i18n.messages[lang]) {
this.$store.commit("setLanguage", lang);
if (!this.$store.state.language) {
// Set default language if not set already
if (this.$i18n.messages[this.browserLanguage]) {
this.$store.commit("setLanguage", this.browserLanguage);
} else if (this.browserLanguage.includes("-")) {
if (this.$i18n.messages[lang]) {
this.$store.commit("setLanguage", lang);
} else {
this.$store.commit("setLanguage", this.availableJsonTranslation);
}
} else {
this.$store.commit("setLanguage", this.availableJsonTranslation);
}
} else {
this.$store.commit("setLanguage", this.availableJsonTranslation);
}
// Set language