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 XLIFF 2.0 serializer should add source files #16531

Closed
martinroob opened this Issue May 4, 2017 · 2 comments

Comments

Projects
None yet
3 participants
@martinroob

martinroob commented May 4, 2017

I'm submitting a ... (check one with "x")

[ ] bug report => search github for a similar issue or PR before submitting
[X] feature request
[ ] support request => Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question

Current behavior
Starting with angular 4.1 there is the new XLIFF 2.0 serializer available (#14185).
And there is also the new feature for writing a source reference into the xlf and xmb files (#14705).
But in XLIFF 2.0 this reference to source is not written.

Expected behavior
Add functionality for #14705 to the new XLIFF 2.0 serializer.

Minimal reproduction of the problem with instructions

What is the motivation / use case for changing the behavior?

Please tell us about your environment:

  • Angular version: 4.1.X

  • Browser: [all | Chrome XX | Firefox XX | IE XX | Safari XX | Mobile Chrome XX | Android X.X Web Browser | iOS XX Safari | iOS XX UIWebView | iOS XX WKWebView ]

  • Language: [all | TypeScript X.X | ES6/7 | ES5]

  • Node (for AoT issues): node --version =

@vicb vicb added the comp: i18n label May 4, 2017

@vicb vicb added the type: feature label May 4, 2017

@ocombe ocombe referenced this issue May 4, 2017

Open

[i18n] plans #16477

0 of 20 tasks complete
@martinroob

This comment has been minimized.

Show comment
Hide comment
@martinroob

martinroob May 5, 2017

Just as a hint for implemting it.
In principle this information should be stored in the resourceData part.
But this is very complex and difficult to use.

So it migth be easier to just put source file and line information to a note element.

Something like this:

    <unit id="1409816038285774052">
      <notes>
        <note category="description">description</note>
        <note category="meaning">meaning</note>
	<note category="location">/home/user/sampleapp/src/app/app.component.ts:10</note>
      </notes>
      <segment>
        <source>My text</source>
      </segment>
    </unit>

martinroob commented May 5, 2017

Just as a hint for implemting it.
In principle this information should be stored in the resourceData part.
But this is very complex and difficult to use.

So it migth be easier to just put source file and line information to a note element.

Something like this:

    <unit id="1409816038285774052">
      <notes>
        <note category="description">description</note>
        <note category="meaning">meaning</note>
	<note category="location">/home/user/sampleapp/src/app/app.component.ts:10</note>
      </notes>
      <segment>
        <source>My text</source>
      </segment>
    </unit>

@martinroob martinroob closed this May 5, 2017

@martinroob

This comment has been minimized.

Show comment
Hide comment
@martinroob

martinroob May 5, 2017

Oops, I did not want to close it.

martinroob commented May 5, 2017

Oops, I did not want to close it.

@martinroob martinroob reopened this May 5, 2017

ocombe added a commit to ocombe/angular that referenced this issue May 15, 2017

fix(compiler): add location note to extracted xliff2 files
When we added the xliff2 serializer, we forgot to add the source location at the same time because both PR were merged at about the same time.
This PR adds a note with the location of source files to the xliff2 units of extracted files.

Fixes  #16531

ocombe added a commit to ocombe/angular that referenced this issue May 15, 2017

fix(compiler): add location note to extracted xliff2 files
When we added the xliff2 serializer, we forgot to add the source location at the same time because both PR were merged at about the same time.
This PR adds a note with the location of source files to the xliff2 units of extracted files.

Fixes  #16531

ocombe added a commit to ocombe/angular that referenced this issue May 17, 2017

fix(compiler): add location note to extracted xliff2 files
When we added the xliff2 serializer, we forgot to add the source location at the same time because both PR were merged at about the same time.
This PR adds a note with the location of source files to the xliff2 units of extracted files.
There is no clear definition of where to store the location of the source files in the official XLIFF 2.0 specification (http://docs.oasis-open.org/xliff/xliff-core/v2.0/os/xliff-core-v2.0-os.html) so we decided to add it to the notes section, since it was simple to implement/understand and already present for meaning/description.
The location note is defined like this: `<note category="location">path/to/file.ts:1,2</note>`. It gives the path, followed by start line, and last line if different from the start line.

Fixes  #16531

ocombe added a commit to ocombe/angular that referenced this issue May 17, 2017

fix(compiler): add location note to extracted xliff2 files
Add source location as a note tag as `<note category="location">path/to/file.ts:start_line[,end_line]</note>`.
`[,end_line]` part is optional and specified only if the end line is different from the start line.

Fixes  #16531

ocombe added a commit to ocombe/angular that referenced this issue May 18, 2017

feat(compiler): add location note to extracted xliff2 files
Add source location as a note tag as `<note category="location">path/to/file.ts:start_line[,end_line]</note>`.
`[,end_line]` part is optional and specified only if the end line is different from the start line.

Fixes  #16531

@chuckjaz chuckjaz closed this in 08dfe91 May 22, 2017

asnowwolf added a commit to asnowwolf/angular that referenced this issue Aug 11, 2017

feat(compiler): add location note to extracted xliff2 files (#16791)
Add source location as a note tag as `<note category="location">path/to/file.ts:start_line[,end_line]</note>`.
`[,end_line]` part is optional and specified only if the end line is different from the start line.

Fixes  #16531

juleskremer added a commit to juleskremer/angular that referenced this issue Aug 28, 2017

feat(compiler): add location note to extracted xliff2 files (#16791)
Add source location as a note tag as `<note category="location">path/to/file.ts:start_line[,end_line]</note>`.
`[,end_line]` part is optional and specified only if the end line is different from the start line.

Fixes  #16531
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment