Merge pull request #143 from WebTools-NG/#94-Export-Episodes-as-well

Some housekeeping for translations
This commit is contained in:
Tommy Mikkelsen 2020-09-06 14:35:37 +02:00 committed by GitHub
commit 97f6c63e51
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 27 deletions

View file

@ -38,33 +38,15 @@ export default {
if (onlineLangs[i]['code'] == selLang) if (onlineLangs[i]['code'] == selLang)
{ {
if ( onlineLangs[i]['updated'] != selLangUpdated) if ( onlineLangs[i]['updated'] != selLangUpdated)
{ {
console.log('Ged update needed for : ' + onlineLangs[i]['name']) const bodyStr = i18n.t("Common.Home.LangUpdateMsg", [onlineLangs[i]['name']]) + '. ' + i18n.t("Common.Home.LangUpdateMsg2", [i18n.t("Common.Language.btnForce")]);
//const bodyStr = i18n.t("Common.Home.LangUpdateMsg") + '</br>' + i18n.t("Common.Home.LangUpdateMsg2"); this.$bvToast.toast(bodyStr, {
//const bodyStr = 'Test'
/* this.$bvToast.toast("Test"), {
// title: this.$t("Common.Home.LangUpdateTitle"),
title: "Ged title",
autoHideDelay: 3000,
solid: true,
//enableHtml: true,
variant: 'primary',
toaster: 'b-toaster-bottom-right'
} */
const bodyStr = i18n.t("Common.Home.LangUpdateMsg", [onlineLangs[i]['name']]) + '. ' + i18n.t("Common.Home.LangUpdateMsg2", [i18n.t("Common.Language.btnForce")]);
//this.$bvToast.toast(this.$t("Modules.ET.ErrorNoServerSelectedMsg"), {
this.$bvToast.toast(bodyStr, {
//title: this.$t("Modules.ET.ErrorNoServerSelectedTitle"),
title: this.$t("Common.Home.LangUpdateTitle"), title: this.$t("Common.Home.LangUpdateTitle"),
autoHideDelay: 400000, autoHideDelay: 400000,
solid: true, solid: true,
variant: 'primary', variant: 'primary',
toaster: 'b-toaster-bottom-right' toaster: 'b-toaster-bottom-right'
}); });
} }
} }
} }

View file

@ -106,9 +106,6 @@ export default {
this.olLangs = []; this.olLangs = [];
await this.$store.dispatch("updateAndSetLang", { "langCode": i18n.locale, "forceDownload": true}); await this.$store.dispatch("updateAndSetLang", { "langCode": i18n.locale, "forceDownload": true});
this.getOnlineLangs(); this.getOnlineLangs();
console.log('Ged lang time: ' + i18n.locale)
//const langTimeStamp = 'ged223344'
// Get timeStamp // Get timeStamp
let timeStamp = '' let timeStamp = ''
var onlineLangs = await this.$store.getters.getLanguages var onlineLangs = await this.$store.getters.getLanguages
@ -117,8 +114,7 @@ export default {
{ {
timeStamp = onlineLangs[i]['updated'] timeStamp = onlineLangs[i]['updated']
} }
} }
// Update settings with timestamp // Update settings with timestamp
wtconfig.set(`Languages.${i18n.locale}`, timeStamp) wtconfig.set(`Languages.${i18n.locale}`, timeStamp)
}, },
@ -137,6 +133,7 @@ export default {
}, },
onChange(event) { onChange(event) {
this.$store.dispatch('updateAndSetLang', { "langCode": event.target.value, "forceDownload": false}); this.$store.dispatch('updateAndSetLang', { "langCode": event.target.value, "forceDownload": false});
console.log('Ged lang skiftet')
} }
} }
} }

View file

@ -27,7 +27,7 @@ export const actions = {
} }
const res = await JSON.parse(fs.readFileSync(langFile, 'utf8')); const res = await JSON.parse(fs.readFileSync(langFile, 'utf8'));
i18n.setLocaleMessage(langCode, res) i18n.setLocaleMessage(langCode, res)
commit('SET_LANG', langCode) commit('SET_LANG', langCode)
} }
catch(e) { catch(e) {
console.log(e) console.log(e)