mirror of
https://github.com/wekan/wekan.git
synced 2025-04-23 13:37:09 -04:00
Corrected source code so that it works correctly with reactiveCache #5000
This commit is contained in:
parent
0716eba84e
commit
38b1301258
1 changed files with 5 additions and 5 deletions
|
@ -47,13 +47,13 @@ export const TAPi18n = {
|
|||
async loadLanguage(language) {
|
||||
if (language in languages && 'load' in languages[language]) {
|
||||
let data = await languages[language].load();
|
||||
|
||||
let custom_translations = [];
|
||||
if (Meteor.isServer) {
|
||||
custom_translations = Translation.find({language: language}, {fields: { text: true, translationText: true }}).fetch();
|
||||
} else if (Meteor.isClient) {
|
||||
await Meteor.subscribe('translation', {language: language}, 0);
|
||||
custom_translations = ReactiveCache.getTranslations({language: language}, {fields: { text: true, translationText: true }});
|
||||
if (Meteor.isClient) {
|
||||
await Meteor.subscribe('translation', {language: language}, 0);
|
||||
}
|
||||
custom_translations = ReactiveCache.getTranslations({language: language}, {fields: { text: true, translationText: true }});
|
||||
|
||||
if (custom_translations && custom_translations.length > 0) {
|
||||
data = custom_translations.reduce((acc, cur) => (acc[cur.text]=cur.translationText, acc), data);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue