mirror of
https://github.com/wekan/wekan.git
synced 2025-09-22 01:50:48 +02:00
Added new function to add cumstom translation strings on Admin panel
This commit is contained in:
parent
4153fe7d0d
commit
b1525d4221
10 changed files with 599 additions and 2 deletions
27
server/publications/translation.js
Normal file
27
server/publications/translation.js
Normal 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;
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue