Skip to content

Adding a translation will overwrite existing translations #1

Description

@florisg-infosupport

Describe the bug
If a translation key already exists, but the enduser is not aware and selects 'create new translation', then the existing values will be overwritten. This is not necessarily a problem for the main/original language, however all translated values are also reset to the original language.

To Reproduce
Steps to reproduce the behavior:

  1. make sure you have multiple language files configured(otherwise why use this tool)
  2. In a file select text "hello world"
  3. press ctrl + p and select the Transloco: Translate selected text
  4. set the key to "bug.helloworld". So far soo good.
  5. Change the texts in the language files for "bug.helloworld" to "hallo wereld" or "hi world".
  6. redo steps 1-3
  7. see that the text in the translation files has reset

Expected behavior
Either an error or warning should occur stating that the key already exists.
Or it should only apply the key to the selected text, without actually changing the translation files if the key matches.

Desktop (please complete the following information):
not applicable. Software verion: 0.5.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions