Closed nicolassaleron closed 2 years ago
Do you mean that, in the "Bad code sample", the translator should get an error about exceeding the length at the point of creating the XLIFF file? I don't see how AL itself can know that the translation will exceed the length.
Thanks for reporting this issue. Sorry we haven’t completed it yet, but we’ve had to prioritize elsewhere. We’re planning to give the CodeCop engine and its rules an overhaul in a future major release. Thanks for your patience.
Rules are currently checking if Text or Code variable/fields matches in length. We have warning when we assign a Text[250] to Code[20] for instance. This is not the case for Labels.
Title Rules are currently checking if Text or Code variable/fields matches in length. We have warning when we assign a Text[250] to Code[20] for instance. This is not the case for Labels..
Description Rules are currently checking if Text or Code variable/fields matches in length. We have warning when we assign a Text[250] to Code[20] for instance. This is not the case for Labels.
Reason for the rule When we translate a label, we do not have the full context. If the English version of the label might respect the length of all usages of the label, it happens that the translation can be longer. In that case, an runtime error occurs due to the translation. A new rule could warn us if the label is used in a context where the length should be limited. In that case, a warning should be raised if the MaxLength is not set or if the MaxLength is greater than the length of the assignment.
Bad code sample Example of what bad code the rule should catch:
Good code sample Example of what code should look like:
Good and bad practices for fixing the rule ./.
Remarks ./.