Categories
Requires Crowdin account
var sourceDateRegex = /\b\d{2}\/\d{2}\/\d{4}\b/g;
var translationDateRegex = /\b\d{2}-\d{2}-\d{4}\b/g;
var sourceDates = crowdin.source.match(sourceDateRegex) || [];
var translationDates = crowdin.translation.match(translationDateRegex) || [];
var check = sourceDates.length === translationDates.length;
var result = {
success: check
};
if (!check) {
result.message = 'The number of dates in the source text and translation do not match.';
}
return result;