Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect Placeholder Check for Plural Forms in Weblate #13016

Open
2 tasks done
eschumacher-99 opened this issue Nov 14, 2024 · 2 comments
Open
2 tasks done

Incorrect Placeholder Check for Plural Forms in Weblate #13016

eschumacher-99 opened this issue Nov 14, 2024 · 2 comments
Labels
enhancement Adding or requesting a new feature. undecided These features might not be implemented. Can be prioritized by sponsorship.

Comments

@eschumacher-99
Copy link

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

  • I've read and searched the documentation.
  • I've searched for similar filed issues in this repository.

Steps to reproduce the behavior

  1. Create a translation entry with the following:
    Singular form: @(count) Stck.
    Plural form: @(otherVariable) Stck.

  2. Use the placeholder check feature in Weblate:
    placeholders:r"@([^)]+)"

  3. Attempt to translate both forms.

  4. 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

image

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

@nijel
Copy link
Member

nijel commented Nov 14, 2024

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.

@nijel nijel added enhancement Adding or requesting a new feature. undecided These features might not be implemented. Can be prioritized by sponsorship. labels Nov 14, 2024
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Adding or requesting a new feature. undecided These features might not be implemented. Can be prioritized by sponsorship.
Projects
None yet
Development

No branches or pull requests

2 participants