In order to prevent ill-format translation be putted to Zanata which might break on build stage or execution time, a project maintainer can suggest or even enforced the translation validation.
Related bug:
-
Validators: Validation to be performed.
-
HTML/XML tags: HTML/XML tags should be consistent.
-
XML entity reference: XML entry in correct format.
-
Java variables: java style ('{x}') variables are consistent.
-
Positional printf (XSI extension): positional printf style (%n$x) variables are consistent. It is conflict with printf.
-
Printf variables: print style (%x) variables are consistent. It is conflict with positional printf.
-
Leading/trailing newline (\n): Number of leading and trailing newline should be the same.
-
Tab characters: Number of tab character (\t) should be the same.
-
-
Validation levels: The degree of the validation is enforced. Default is Warning, except positional printf, which is Off.
-
Off: Validator is disabled.
-
Warning: Validation is recommended and enabled by default, translator can turn it off.
-
Error: Validation is enforced. Translator cannot save invalid messages.
-
-
Translator Validation Toggle: A toggle for translator to enable/disable Validator.
-
Invalid translation: A translation message that did not pass at least one enabled Validator.
-
Only project maintainer role can set the validation level for each validator.
-
Only translator role can toggle translator validation toggle.
Validation Level | Translation Validation Toggle Default | Can Translator Toggle |
---|---|---|
Off |
Disabled |
Yes |
Warning |
Enabled |
Yes |
Error |
Enabled |
No |
Validation Level | Translation Validation Toggle | Show Invalid Message | Save as Translated |
---|---|---|---|
Off |
Disabled |
No |
Yes |
Off |
Enabled |
As Warning |
Yes |
Warning |
Disabled |
No |
Yes |
Warning |
Enabled |
As Warning |
Yes |
Error |
Enabled Only |
As Error |
No |
During WebUI upload or client push, if an invalid translation is detected, depending on the validation level, following actions should be taken:
-
Level Off: No validation is executed, thus save as original state (Fuzzy is saved as fuzzy, Translated is saved as translated).
-
Level Warning: Warning is displayed, but still save as original state.
-
Level Error: Error is displayed, and invalid translation is skipped.
[Error] Validation <ValidatorName> failed: File: <Filename>, Message: "message"
[Warn] Validation <ValidatorName> failed: File: <Filename>, Message: "message"
However, valid translations in the same file should be save as original state. Following decision table summarizes the behavior:
Validation Level | Message State | Show Invalid Message | Save as |
---|---|---|---|
Off |
Fuzzy |
No |
Fuzzy |
Off |
Translated |
No |
Translated |
Warning |
Fuzzy |
As Warning |
Fuzzy |
Warning |
Translated |
As Warning |
Translated |
Error |
Fuzzy |
As Error |
Not Saved |
Error |
Translated |
As Error |
Not Saved |
Translations of the Project-Version are not automatically rescan for system performance reason. However, validators should be run during the pull and download.
Validation Level | Show Invalid Message | Save to File |
---|---|---|
Off |
No |
Yes |
Warning |
As Warning |
Yes |
Error |
As Error |
No |