Skip to content

More than one file error for i18-next project with "base" source translations #18456

@lichtzeichner

Description

@lichtzeichner

Describe the issue

When trying to save the settings for my component, I'm getting this error message:

There is more than one file for English language: app/en.json, app/base.json Please adjust the file mask and use components for translating different resources.

The component is i18next based, and has the following file structure for translations:

app/
  |- base.json
  |- de.json
  |- en.json
...

base.json contains all new keys for translations, and preliminary texts written by software developers. de.json and en.json contain the final translations for their respective languages. In the weblate UI, this looks like this:

Image

The settings for this component are:

Setting Value
File Format Json Nested structure file
file mask app/*json
Language filter ^[^.]+$
Source Language English (Developer)
Monolingual base Language file app/base.json

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. Make sure the git repository referenced does not contain an en.json
  2. Create the component with the above settings
  3. Save it
  4. Now click on + to add the English language (weblate creates the en.json at the right place in the repository
  5. Open the settings, klick on save, get the initially mentioned error message

Expected behavior

Successfully saving the settings even if the en.json translation already exists

Screenshots

Image

Exception traceback

How do you run Weblate?

weblate.org service

Weblate versions

UI shows "5.16.2"

Weblate deploy checks

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Waiting for: TriageAssigned automatically for any new issue, needs attention from a Weblate member.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions