Date Format Consistency logo
Date Format Consistency Free

Ensuring uniform date formats across all translations.

Get

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;
Categories
Tags
Works with
  • Crowdin Enterprise
Details

Released on Jun 3, 2023

Updated on Jul 17, 2024

Published by Awesome Crowdin

Identifier:date-format-consistency