WeblateOrg / WeblateOrg/weblate

Incorrect export & re-import of plural strings in non-Gettext formats

Open
#17,407 3 comments 0 reactions 0 assignees View on GitHub
Area: File format support Waiting for: Demand
Dominant language
Python
Stars
6.1k
Forks
1.4k
Avg merge
9h 53m
Merged PRs (30d)
395

Description

### Describe the issue

When working with strings that contain plural forms, Weblate incorrectly exports them to several non-Gettext formats (such as JSON, XLIFF, TBX, etc.).

While Gettext (.po) exports are generated correctly, the exported non-Gettext files contain invalid or incomplete plural data.

Additionally, when these exported files are imported back into Weblate, the translations become corrupted.

### 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. Export plural strings to a non-Gettext format (e.g. JSON, XLIFF, TBX, JSON).
2. Import the exported file back into Weblate.
3. Check the affected strings and their plural forms.

### Expected behavior

Plural strings should be exported correctly to all supported formats, following the format specification.

### Screenshots

### **source**
Image

### **exported data (xliff)**
Image

### **re-import result (xliff)**
Image

### **exported data (json)**
Image

### **re-import result (json)**
Image

### Exception traceback

```pytb

```

### How do you run Weblate?

Docker container

### Weblate versions

Weblate 5.14.3

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