Add translation keys for "today", "yesterday" and "x days ago".
This commit is contained in:
parent
d39f260261
commit
5d05dfd019
4 changed files with 25 additions and 20 deletions
17
src/App.vue
17
src/App.vue
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue