In the web UI of Zanata, the validation of "leading/trailing newline (\n)"
is described as "check for consistent leading and trailing newline (\n)".
But actually, besides checking the leading/trailing newline, the validation will also check whether the line numbers of the source string and translation string are exactly same. If the leading/trailing newline are same, but line numbers are not same, it will report error or warning.
I think, the validation of "leading/trailing newline (\n)" should not check the line numbers. If it's needed to check the line numbers, it's better to separate into two kinds of validations: leading/trailing newline (\n) and same line numbers. Separating into two kinds of validations will help users to config.
This makes sense to me. Both those checks are done by the same validator component, but they should be provided as separate options in the user interface so that they can be turned on and off independently.
the best approach to this is to separate the concept of a validator from the concept of a validation. In this case, the newlines validator would provide several validations (line count, leading newlines, trailing newlines, etc.) that could be turned on or off independently.
Performing multiple checks with the same validator avoids parsing the strings multiple times for very similar checks that require the same preparation.
Also relates to separating "validation" and "validator" concept.
What we discussed:
remove line count check in this validator.
check docs, label, reference for this validator.