daniel-sc / ng-extract-i18n-merge

Extract and merge i18n xliff translation files for angular projects.
MIT License
175 stars 18 forks source link

Sync target to changed source for initial state #22

Closed daniel-sc closed 2 years ago

daniel-sc commented 2 years ago

For translation units that are still untranslated (state="initial" / state="new") I would be convenient if a changed source text would be used immediately for the target text as well. This is especially usefull during initial development / before texts are communicated to 3rd parties.

Open question: should this be the default behavior?

daniel-sc commented 2 years ago

Problem: When using resetTranslationState: true (default) the following can/will happen:

  1. Starting with a translated text with correct state (final/translated)
  2. The first change of the text in the template will update the source text and change the state to "initial"/"new" (because of resetTranslationState: true)
  3. A subsequent change of the text in the template will will/would change the target to the new value --> the original translation would be lost :-(

==> solution only reset target when it was equal to source :)