weblate icon indicating copy to clipboard operation
weblate copied to clipboard

propagate/[re]trigger checks on other units for a "translations must be unique" check

Open cloph opened this issue 5 years ago • 4 comments

Is your feature request related to a problem? Please describe. Currently/to my knowledge it is not possible to write a check that spans multiple units, for example: "all strings with context:"foo" must have unique strings in translation" – or rather while it is possible to write such a check, there is no way to way to trigger a recheck when any of the strings is updated. You can clear the check flag in the currently edited unit, but other strings flagged won't get rechecked/still would have the "duplicate translation" error assigned.

Describe the solution you'd like Be able to define a constraint on multiple units, be it by context, flag or some other existing property or on the current component, and have the check evaluated on all the units matching the constraint whenever a matching unit changes check-state.

Describe alternatives you've considered Alternatives would be to just trigger updatechecks in a cronjob constantly, but that to my knowledge cannot be limited to a specific check/has additional overhead and no immediate feedback.

Additional context Other solutions of course welcome, I might not be aware of another way that already can do what I want. (could need this in LibreOffice project - Calc function names need to have a unique translation for example. In our case it would also work be desirable (and/or sufficient, depending how you look at it) if it would limit the search for matching units to the current component. So "component-wide" check or "units matching a constraint" would both work for me.

cloph avatar May 14 '20 10:05 cloph

There already is Inconsistent check which does similar thing:

https://github.com/WeblateOrg/weblate/blob/f56352ccac00ca676fc4e47f69b8e0e82896aece/weblate/checks/consistency.py#L70-L93

That also uses the only constraint currently supported.

nijel avatar May 14 '20 13:05 nijel

There is also https://github.com/WeblateOrg/weblate/issues/1994 which pretty much describes same problem.

nijel avatar May 14 '20 13:05 nijel

Variant of this, the letter following a _ or & must be unique in the translation (provided it isn't a URL).

comradekingu avatar May 16 '20 19:05 comradekingu

@comradekingu It must be unique in single scope, what is something Weblate doesn't know without additional metadata.

nijel avatar May 17 '20 05:05 nijel