mirror of
https://github.com/documize/community.git
synced 2025-07-23 07:09:43 +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 } 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