Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
crtl opened this issue Oct 15, 2019 · 3 comments
Closed

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

crtl opened this issue Oct 15, 2019 · 3 comments

Comments

@crtl
Copy link

crtl commented Oct 15, 2019

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

@crtl crtl changed the title xlf alt-trans tag is used instead of target i18n xlf alt-trans tag is used instead of target Oct 15, 2019
@ngbot ngbot bot added this to the needsTriage milestone Oct 15, 2019
@petebacondarwin
Copy link
Member

@crtl can you confirm that this is with ivy disabled?

petebacondarwin added a commit to petebacondarwin/angular that referenced this issue Oct 28, 2019
The parser was accidentally reading the `target` tag
below the `alt-trans` target and overriding the correct
`target` tag.

(This already worked in `$localize` but a test has been
added to confirm.)

Fixes angular#33161
petebacondarwin added a commit to petebacondarwin/angular that referenced this issue Oct 28, 2019
The parser was accidentally reading the `target` tag
below the `alt-trans` target and overriding the correct
`target` tag.

(This already worked in `$localize` but a test has been
added to confirm.)

Fixes angular#33161
@petebacondarwin
Copy link
Member

#33450 will fix this.

petebacondarwin added a commit to petebacondarwin/angular that referenced this issue Oct 29, 2019
The parser was accidentally reading the `target` tag
below the `alt-trans` target and overriding the correct
`target` tag.

(This already worked in `$localize` but a test has been
added to confirm.)

Fixes angular#33161
petebacondarwin added a commit to petebacondarwin/angular that referenced this issue Oct 29, 2019
The parser was accidentally reading the `target` tag
below the `alt-trans` target and overriding the correct
`target` tag.

Fixes angular#33161
AndrewKushnir pushed a commit that referenced this issue Oct 29, 2019
The parser was accidentally reading the `target` tag
below the `alt-trans` target and overriding the correct
`target` tag.

Fixes #33161

PR Close #33464
matsko pushed a commit to matsko/angular that referenced this issue Oct 30, 2019
…3450)

The parser was accidentally reading the `target` tag
below the `alt-trans` target and overriding the correct
`target` tag.

(This already worked in `$localize` but a test has been
added to confirm.)

Fixes angular#33161

PR Close angular#33450
mohaxspb pushed a commit to mohaxspb/angular that referenced this issue Nov 7, 2019
…3450)

The parser was accidentally reading the `target` tag
below the `alt-trans` target and overriding the correct
`target` tag.

(This already worked in `$localize` but a test has been
added to confirm.)

Fixes angular#33161

PR Close angular#33450
mohaxspb pushed a commit to mohaxspb/angular that referenced this issue Nov 7, 2019
…3450)

The parser was accidentally reading the `target` tag
below the `alt-trans` target and overriding the correct
`target` tag.

(This already worked in `$localize` but a test has been
added to confirm.)

Fixes angular#33161

PR Close angular#33450
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Nov 29, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants