Line Count Check logo
Line Count Check BetaFree

Ensure your translations maintain a controlled number of lines.

Get

Requires Crowdin account

var maxLines = 2; // Define the maximum allowed number of lines

var result = {
  success: false
};

if (crowdin.contentType === 'text/plain') {
  var translation = crowdin.translation;
  var lines = translation.split('\n');
  var lineCount = lines.length;

  if (lineCount > maxLines) {
    result.message = 'The translation has too many lines: ' + lineCount + ' (max allowed is ' + maxLines + ')';
    result.fixes = [];
  } else {
    result.success = true;
  }
} else {
  result.message = 'Max. Lines check: This QA check does not handle ICU and Plurals.';
  result.fixes = [];
}

return result;
Categories
Tags
Works with
  • Crowdin Enterprise
Details

Released on Jul 26, 2024

Updated on Jul 26, 2024

Published by Awesome Crowdin

Identifier:line-count-check