Uppercase Consistency Check logo
Uppercase Consistency Check Free

Maintaining the integrity of uppercase words in translations

Get

Requires Crowdin account

var sourceUppercaseMatches = crowdin.source.match(/\b([A-Z]+)\b/g) || [];
var translationText = crowdin.translation;

var check = true;
var missingMatches = [];

for (var i = 0; i < sourceUppercaseMatches.length; i++) {
    if (translationText.indexOf(sourceUppercaseMatches[i]) === -1) {
        check = false;
        missingMatches.push(sourceUppercaseMatches[i]);
    }
}

var result = {
  success: check
};

if (!check) {
  result.message = 'The uppercase words ' + missingMatches.join(', ') + ' from the source text are missing in the translation';
}

return result;
Categories
Tags
Works with
  • Crowdin Enterprise
Details

Released on Jun 3, 2023

Updated on Jul 17, 2024

Published by Awesome Crowdin

Identifier:uppercase-consistency-check