WeblateOrg / WeblateOrg/weblate

Weblate machine translation replaces plural translations with empty strings

Open
#15,969 7 comments 0 reactions 0 assignees View on GitHub
Area: Automatic translation Waiting for: Demand
Dominant language
Python
Stars
6.1k
Forks
1.4k
Avg merge
9h 53m
Merged PRs (30d)
395

Description

### Describe the issue

We have discovered that if you have a Gettext component (where the translation keys are the source strings) and have a source string that is used in both a *pluralized* and *non-pluralized* translation, the Weblate machine translation component replaces the singlar or plural form of the *pluralized* source string with an empty string because the non-pluralized source string misses either the singular or plural form. This causes constant automatic changes when using multiple automatic translation add-ons (with different providers), because the Weblate machine translation replaces existing translations with empty strings.

### 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 component (it's probably required to use Gettext to reproduce)
2. Have 2 translations, one pluralized and the other non-pluralized. For example, use the word "hour". Create a translation with source string with "hour" and another pluralized translation with source strings "hour" and "hours" for plural.
3. Configure the Weblate machine translation
4. Watch the Weblate machine translation suggesting empty strings as translation in the pluralized translation, because the non-pluralized translation "hour" does not have a translation for "hours".

### Expected behavior

Weblate should not replace singular or plural forms of the pluralized translation with empty strings from non-pluralized translations.

### Screenshots

Image

Image

Image

Image

Image

### Exception traceback

```pytb

```

### How do you run Weblate?

Docker container

### Weblate versions

5.13

### Weblate deploy checks

```shell

```

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