mirror of
https://github.com/wekan/wekan.git
synced 2026-11-24 09:59:47 -05:00
Repair relative ordering and destination dialog lifecycles, retain failed operations, and make checklist, rule and attachment controls keyboard accessible. Improve scaled layouts and reuse canonical translated labels. Add source-execution and Chromium/Firefox regression coverage, including awaiting background persistence before reload. Record implementation decisions and validation limits. Thanks to xet7 !
64 lines
1.3 KiB
JavaScript
64 lines
1.3 KiB
JavaScript
import { Mongo } from 'meteor/mongo';
|
|
import languages from '/imports/i18n/languages';
|
|
const { SimpleSchema } = require('/imports/simpleSchema');
|
|
|
|
const Translation = new Mongo.Collection('translation');
|
|
|
|
/**
|
|
* A Organization User in wekan
|
|
*/
|
|
Translation.attachSchema(
|
|
new SimpleSchema({
|
|
language: {
|
|
/**
|
|
* the language
|
|
*/
|
|
type: String,
|
|
max: 35,
|
|
allowedValues: [...new Set(Object.values(languages).map(language => language.tag))],
|
|
},
|
|
text: {
|
|
/**
|
|
* the text
|
|
*/
|
|
type: String,
|
|
},
|
|
translationText: {
|
|
/**
|
|
* the translation text
|
|
*/
|
|
type: String,
|
|
optional: true,
|
|
},
|
|
createdAt: {
|
|
/**
|
|
* creation date of the translation custom string
|
|
*/
|
|
type: Date,
|
|
// eslint-disable-next-line consistent-return
|
|
autoValue() {
|
|
if (this.isInsert) {
|
|
return new Date();
|
|
} else if (this.isUpsert) {
|
|
return { $setOnInsert: new Date() };
|
|
} else {
|
|
this.unset();
|
|
}
|
|
},
|
|
},
|
|
modifiedAt: {
|
|
type: Date,
|
|
// eslint-disable-next-line consistent-return
|
|
autoValue() {
|
|
if (this.isInsert || this.isUpsert || this.isUpdate) {
|
|
return new Date();
|
|
} else {
|
|
this.unset();
|
|
}
|
|
},
|
|
},
|
|
}),
|
|
);
|
|
|
|
export default Translation;
|