diff --git a/app/appListeners.js b/app/appListeners.js index 9dc9f5a..1b946e4 100644 --- a/app/appListeners.js +++ b/app/appListeners.js @@ -14,7 +14,7 @@ export const appListeners = (app, state, emitter) => { emitter.on('set-language', newLanguage => { app.setSettingsItem('lang', newLanguage); state.language = newLanguage; - emitter.emit('render', () => { }); + emitter.emit('render'); }); app.checkIfLoggedIn(state).then(isLoggedIn => { diff --git a/app/i18n/index.js b/app/i18n/index.js index dd5ed5e..d4aa20f 100644 --- a/app/i18n/index.js +++ b/app/i18n/index.js @@ -7,7 +7,11 @@ export class I18n { default: en, en, }; - this.language = appState.language; + this.appState = appState; + } + + get language () { + return this.appState.language; } translate (section, phrase) { diff --git a/app/i18n/locales/en.json b/app/i18n/locales/en.json index 8037141..ae06199 100644 --- a/app/i18n/locales/en.json +++ b/app/i18n/locales/en.json @@ -8,7 +8,8 @@ "menu_account": "My Profile", "menu_logout": "Log Out", "footer_repo": "Repo", - "footer_chat": "Chat" + "footer_chat": "Chat", + "change_language": "Change Language" }, "home": { "logged_out_subtitle": "All the Book Buzz in Once Place", diff --git a/app/views/global.js b/app/views/global.js index e70e3bb..232ab3a 100644 --- a/app/views/global.js +++ b/app/views/global.js @@ -40,14 +40,30 @@ export const globalView = (state, emit, view) => {