Added new function to add cumstom translation strings on Admin panel

This commit is contained in:
Yevhenii Pertiaka 2023-08-17 21:54:14 +09:00
parent 4153fe7d0d
commit b1525d4221
10 changed files with 599 additions and 2 deletions

View file

@ -0,0 +1,27 @@
import { ReactiveCache } from '/imports/reactiveCache';
Meteor.publish('translation', function(query, limit) {
check(query, Match.OneOf(Object, null));
check(limit, Number);
let ret = [];
const user = ReactiveCache.getCurrentUser();
if (user && user.isAdmin) {
ret = ReactiveCache.getTranslations(query,
{
limit,
sort: { modifiedAt: -1 },
fields: {
language: 1,
text: 1,
translationText: 1,
createdAt: 1,
}
},
true,
);
}
return ret;
});