mirror of
https://github.com/documize/community.git
synced 2025-07-24 23:59:47 +02:00
Select language for server and per user
This commit is contained in:
parent
4494ace0a2
commit
e81cbad385
5 changed files with 18 additions and 16 deletions
|
@ -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() {
|
||||
|
|
|
@ -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: {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue