diff --git a/core/i18n/localize.go b/core/i18n/localize.go index 82513154..36be7303 100644 --- a/core/i18n/localize.go +++ b/core/i18n/localize.go @@ -25,7 +25,6 @@ var localeMap map[string]map[string]string // SupportedLocales returns array of locales. func SupportedLocales() (locales []string) { locales = append(locales, "en-US") - locales = append(locales, "de-DE") return } diff --git a/gui/app/components/customize/general-settings.js b/gui/app/components/customize/general-settings.js index fcc0a5f5..6c9d6ede 100644 --- a/gui/app/components/customize/general-settings.js +++ b/gui/app/components/customize/general-settings.js @@ -10,6 +10,7 @@ // https://documize.com import $ from 'jquery'; +import { A } from '@ember/array'; import { empty, and } from '@ember/object/computed'; import { isEmpty } from '@ember/utils'; import { set } from '@ember/object'; @@ -30,17 +31,17 @@ export default Component.extend(Notifier, { hasTitleInputError: and('titleEmpty', 'titleError'), hasMessageInputError: and('messageEmpty', 'messageError'), hasConversionEndpointInputError: and('conversionEndpointEmpty', 'conversionEndpointError'), - locale: {}, - locales: null, + locale: { name: '' }, + locales: A([]), - init() { - this._super(...arguments); + init(...args) { + this._super(...args); let l = this.get('appMeta.locales'); - let t = []; + let t = A([]); l.forEach((locale) => { - t.pushObject( {name: locale} ); + t.pushObject({ name: locale }); }); this.set('locales', t); @@ -51,7 +52,8 @@ export default Component.extend(Notifier, { this.set('maxTags', this.get('model.general.maxTags')); this.set('domain', this.get('model.general.domain')); - this.set('locale', { name: this.get('model.general.locale') }); + + this.set('locale', this.locales.findBy('name', this.get('model.general.locale'))); }, didInsertElement() { diff --git a/gui/app/components/user/user-profile.js b/gui/app/components/user/user-profile.js index dda617c4..cc1a8185 100644 --- a/gui/app/components/user/user-profile.js +++ b/gui/app/components/user/user-profile.js @@ -10,6 +10,7 @@ // https://documize.com import $ from 'jquery'; +import { A } from '@ember/array'; import { empty } from '@ember/object/computed'; import { computed, set } from '@ember/object'; import { isPresent, isEqual, isEmpty } from '@ember/utils'; @@ -46,7 +47,7 @@ export default Component.extend(AuthProvider, { return ''; } }), - locale: {}, + locale: { name: '' }, locales: null, init() { @@ -54,7 +55,7 @@ export default Component.extend(AuthProvider, { this.password = { password: "", confirmation: "" }; let l = this.get('appMeta.locales'); - let t = []; + let t = A([]); l.forEach((locale) => { t.pushObject( {name: locale} ); @@ -66,7 +67,7 @@ export default Component.extend(AuthProvider, { didReceiveAttrs() { this._super(...arguments); - this.set('locale', { name: this.get('model.locale') }); + this.set('locale', this.locales.findBy('name', this.get('model.locale'))); }, actions: { diff --git a/gui/app/templates/components/section/pdf/type-editor.hbs b/gui/app/templates/components/section/pdf/type-editor.hbs index f85fb543..25fea395 100644 --- a/gui/app/templates/components/section/pdf/type-editor.hbs +++ b/gui/app/templates/components/section/pdf/type-editor.hbs @@ -1,25 +1,25 @@ {{#section/base-editor-inline document=document folder=folder page=page tip=(localize 'section_pdf') isDirty=(action "isDirty") onCancel=(action "onCancel") onAction=(action "onAction")}}
- + {{input type="text" class="form-control mousetrap" placeholder="click upload button below" value=pdfName readonly=true}} {{localize 'section_pdf_upload_explain'}}
- + {{input type="number" class="form-control mousetrap" placeholder="e.g. 700" value=pdfOption.height}} {{localize 'section_pdf_height_explain'}}
- + {{input type="number" class="form-control mousetrap" placeholder="e.g. 1" value=pdfOption.startPage}} {{localize 'section_pdf_start_explain'}}
- +