Skip to content

i18n xlf alt-trans tag is used instead of target #33161

@crtl

Description

@crtl

🐞 bug report

Affected Package

@angular/i18n

Description

After extracting the translations as xlf files and editing them in my translation tool angular cannot use the translations correctly anymore. The translation tool adds tags inside the document which angular then reads instead of the actual translation.

In the following example angular displays Content (trans-unit > alt-trans > target) instead of Weiter (trans-unit > target)

🔬 Minimal Reproduction

<!-- messages.de.xml -->
<trans-unit datatype="html" approved="no" id="registration.submit">
   <source>
      Continue
   </source>
   <target state="translated" xml:lang="de">Weiter</target>
   <context-group purpose="location">
      <context context-type="sourcefile">src/app/auth/registration-form/registration-form.component.html</context>
      <context context-type="linenumber">69</context>
   </context-group>
   <?sid 1110954287-0?>
   <alt-trans origin="autoFuzzy" tool="Swordfish" match-quality="71" ts="63">
      <source xml:lang="en">Content</source>
      <target state="translated" xml:lang="de">Content</target>
   </alt-trans>
</trans-unit>
<button type="submit" class="btn btn-submit" i18n="@@registration.submit">
   Continue
</button>

🌍 Your Environment

Angular Version:

Package                           Version
-----------------------------------------------------------
@angular-devkit/architect         0.803.4
@angular-devkit/build-angular     0.803.4
@angular-devkit/build-optimizer   0.803.4
@angular-devkit/build-webpack     0.803.4
@angular-devkit/core              8.3.4
@angular-devkit/schematics        8.3.6
@angular/cli                      8.3.6
@ngtools/webpack                  8.3.4
@schematics/angular               8.3.6
@schematics/update                0.803.6
rxjs                              6.4.0
typescript                        3.5.3
webpack                           4.39.2




Anything else relevant?
Swordfish III used for translations.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: i18nIssues related to localization and internationalization

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions