Open eschumacher-99 opened 16 hours ago
Indeed, this situation is not gracefully handled. On the other side I think this is a bad approach because it will become tricky once the target language has a different number of plurals. The PlaceholderCheck
could be updated to use PluralMapper
, but still, this can't handle 100% of cases with different number of plurals.
This issue has been put aside. It is currently unclear if it will ever be implemented as it seems to cover too narrow of a use case or doesn't seem to fit into Weblate.
Please try to clarify the use case or consider proposing something more generic to make it useful to more users.
Describe the issue
I encountered a bug in Weblate related to the placeholder check when handling plural forms. Specifically, when plural forms use variables that differ from those in the singular form, Weblate incorrectly validates the placeholders in the translation.
I already tried
Steps to reproduce the behavior
Create a translation entry with the following: Singular form: @(count) Stck. Plural form: @(otherVariable) Stck.
Use the placeholder check feature in Weblate: placeholders:r"@([^)]+)"
Attempt to translate both forms.
The placeholder check incorrectly validates the plural form. Weblate expects the variable @(count) in the plural form, marking @(otherVariable) as superfluous and @(count) as missing.
Expected behavior
The placeholder check should correctly recognize and validate the variables specific to each form (plural or singular). In this case, it should acknowledge @(otherVariable) as the appropriate variable for the plural form without expecting @(count).
Screenshots
Exception traceback
No response
How do you run Weblate?
PyPI module
Weblate versions
5.4.2
Weblate deploy checks
No response
Additional context
No response