camelCase Consistency Check logo
camelCase Consistency Check Free

Ensure the consistency of camelCase words in your translations

Get

Requires Crowdin account

var sourceCamelCaseMatches = crowdin.source.match(/([a-z]+[A-Z][a-zA-Z0-9]*)/g) || [];
var translationText = crowdin.translation;

var check = true;
var missingMatches = [];

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

var result = {
  success: check
};

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