diff --git a/gui/app/components/customize/search-index.js b/gui/app/components/customize/search-index.js index 77d43c9b..e9a1761f 100644 --- a/gui/app/components/customize/search-index.js +++ b/gui/app/components/customize/search-index.js @@ -15,14 +15,21 @@ import Component from '@ember/component'; export default Component.extend(Notifier, { appMeta: service(), - buttonLabel: 'Rebuild', + i18n: service(), + buttonLabel: '', + + init() { + this._super(...arguments); + this.buttonLabel = this.i18n.localize('search_reindex_rebuild'); + }, actions: { reindex() { - this.set('buttonLabel', 'Running...'); - this.notifyInfo("Starting search re-index process"); + this.set('buttonLabel', this.i18n.localize('running')); + this.notifyInfo(this.i18n.localize('search_reindex_start')); this.get('reindex')(() => { - this.notifySuccess("Search re-indexing complete"); + this.notifySuccess(this.i18n.localize('search_reindex_finish')); + this.set('buttonLabel', this.i18n.localize('search_reindex_rebuild')); }); } } diff --git a/gui/app/services/i18n.js b/gui/app/services/i18n.js index 68b382c3..1fac5375 100644 --- a/gui/app/services/i18n.js +++ b/gui/app/services/i18n.js @@ -21,8 +21,6 @@ export default Service.extend({ }, localize(key, ...args) { - console.log(this.session.locale); - let str = ""; switch(this.session.locale) { @@ -33,13 +31,15 @@ export default Service.extend({ str = this.langs.enUS[key]; } - if (str === "") { - console.log("i18n miss", key); - return; + if (_.isUndefined(str)) { + console.log(">>>>>>>>>>>> i18n missed key", key); + return `!${key}!`; } - for (let i = 0; i < args.length; i++) { - str = str.replace(`{${i+1}}`, args[i]); + if (args) { + for (let i = 0; i < args.length; i++) { + str = str.replace(`{${i+1}}`, args[i]); + } } return str; diff --git a/gui/app/templates/components/customize/auth-settings.hbs b/gui/app/templates/components/customize/auth-settings.hbs index 6454397f..ed235616 100644 --- a/gui/app/templates/components/customize/auth-settings.hbs +++ b/gui/app/templates/components/customize/auth-settings.hbs @@ -4,28 +4,28 @@