Time Format Consistency logo
Time Format Consistency Free

Ensuring consistent time formats across translations

Get

Requires Crowdin account

var timeRegex = /\b(1[0-2]|0?[1-9]):?([0-5][0-9])? ?(am|pm)?\b/gi;

var sourceTimes = (crowdin.source.match(timeRegex) || []).filter(Boolean);
var translationTimes = (crowdin.translation.match(timeRegex) || []).filter(Boolean);

var check = JSON.stringify(sourceTimes.sort()) === JSON.stringify(translationTimes.sort());

var result = {
  success: check
};

if (!check) {
  result.message = 'The time 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:time-format-consistency