max translator comment lengh of 255 in bin/twlight_i18n_lint.pl
@@ -23,13 +23,12 @@ foreach my $match (@newline_errors) {
print_error($message, $filename, $input, $match);
}
-# Check for messages not preceded by a translator comment.
-# These will not be picked up for localization.
+# Check for messages not preceded by a translator comment with a max length of 255 characters.
# Note the variable-width negative lookbehind, which has experimental support.
-# We're keeping it the pattern well within the limitations of the engine.
-my @missing_comment_errors = ($input =~ /(?<!# Translators:[^\n]{1,240}\n)([^\n]*(?<!_)_\((([ \t]*)?"[^\n]*"\n?)*([ \t]*)\)[^\n]\n)/sg);
-foreach my $match (@missing_comment_errors) {
- my $message = "Missing Translator comment";
+# We're keeping the pattern within the limitations of the engine.
+my @comment_errors = ($input =~ /(?<!# Translators:[^\n]{1,240}\n)([^\n]*(?<!_)_\((([ \t]*)?"[^\n]*"\n?)*([ \t]*)\)[^\n]\n)/sg);
+foreach my $match (@comment_errors) {
+ my $message = 'Missing or overlong (> 255 chars) translator comment';
print_error($message, $filename, $input, $match);
}
