File tree 2 files changed +7
-16
lines changed
2 files changed +7
-16
lines changed Original file line number Diff line number Diff line change @@ -9,7 +9,6 @@ let SYNCED_DBS_LIST_KEY = 'SYNCED_DBS_LIST_KEY';
9
9
let LAST_ACTIVEUSER_KEY = 'LAST_ACTIVEUSER_KEY';
10
10
let AUTOLOGIN_USER_KEY = 'AUTOLOGIN_USER_KEY';
11
11
let GRID_DIMENSIONS_KEY = 'AG_GRID_DIMENSIONS_KEY';
12
- let USED_LOCALES_KEY = 'AG_USED_LOCALES_KEY';
13
12
let CURRENT_VERSION_KEY = 'AG_CURRENT_VERSION_KEY';
14
13
let APP_SETTINGS = 'AG_APP_SETTINGS';
15
14
let USER_SETTINGS = 'AG_USER_SETTINGS';
@@ -316,18 +315,6 @@ localStorageService.getLastGridDimensions = function () {
316
315
return json ? JSON.parse(json) : {};
317
316
};
318
317
319
- localStorageService.addUsedLocales = function (toAddArray) {
320
- let json = localStorageService.get(USED_LOCALES_KEY);
321
- let array = json ? JSON.parse(json) : [];
322
- array = [...new Set(array.concat(toAddArray))];
323
- localStorageService.save(USED_LOCALES_KEY, JSON.stringify(array));
324
- };
325
-
326
- localStorageService.getUsedLocales = function () {
327
- let json = localStorageService.get(USED_LOCALES_KEY);
328
- return json ? JSON.parse(json) : [];
329
- };
330
-
331
318
localStorageService.getCurrentAppVersion = function () {
332
319
return localStorageService.get(CURRENT_VERSION_KEY);
333
320
};
Original file line number Diff line number Diff line change 159
159
chosenLocale: i18nService.isCurrentContentLangEN() ? 'de' : 'en',
160
160
GridActionSpeakCustom: GridActionSpeakCustom,
161
161
allLanguages: i18nService.getAllLanguages(),
162
- usedLocales: localStorageService.getUsedLocales() ,
162
+ usedLocales: [] ,
163
163
changedGrids: [],
164
164
shouldShowMap: {} // element-id or action-id => boolean, tells if element should be shown in translate view
165
165
}
191
191
methods: {
192
192
save() {
193
193
let thiz = this;
194
- let data = thiz.gridData || thiz.allGrids[0];
195
- localStorageService.addUsedLocales(Object.keys(data.label));
196
194
dataService.saveGrids(JSON.parse(JSON.stringify(thiz.changedGrids))).then(() => {
197
195
thiz.$emit('reload');
198
196
thiz.$emit('close');
288
286
let anyLabel = Object.keys(element.label).some(lang => !!element.label[lang]);
289
287
let hasImage = element.image && (element.image.url || element.image.data);
290
288
this.shouldShowMap[element.id] = anyLabel || hasImage;
289
+ for (let lang of Object.keys(element.label)) {
290
+ if (!this.usedLocales.includes(lang) && !!element.label[lang]) {
291
+ this.usedLocales.push(lang);
292
+ }
293
+ }
291
294
}
292
295
}
296
+ this.usedLocales.sort((a, b) => this.getLocaleTranslation(a).localeCompare(this.getLocaleTranslation(b)));
293
297
});
294
298
}
295
299
}
You can’t perform that action at this time.
0 commit comments