WeblateOrg / WeblateOrg/weblate

Incorrect Placeholder Check for Plural Forms in Weblate

Open
#13,016 2 comments 0 reactions 0 assignees View on GitHub
enhancement Waiting for: Demand
Dominant language
Python
Stars
6.1k
Forks
1.4k
Avg merge
9h 53m
Merged PRs (30d)
395

Description

### 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

- [X] I've read and searched [the documentation](https://docs.weblate.org/).
- [X] 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](https://github.com/user-attachments/assets/eed8c086-d9af-4e99-a979-090a0f3e72e7)

### 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_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.