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

Add disp attribute to XBM and XLIFF 1.2 too #17345

Closed
jaska45 opened this Issue Jun 8, 2017 · 10 comments

Comments

Projects
None yet
4 participants
@jaska45
Copy link

commented Jun 8, 2017

I'm submitting a ...

[ ] 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

When you run the extract tool to create XLIFF 2.0 there is this new neat feature that saves the variable or experssion inside an interpolation placeholder. If I have this

<p i18n>Hello {{name}}</p>

The following source element will be created.

<source>Hello <ph id="0" equiv="INTERPOLATION" disp="{{name}}"/></source>

This is very good because without it an essential information (e.g. variable name) would be lost. When disp is there the localization tool can show the pattern in a way that is much more descriptive. Here is a screenshot from a localization tool in the case where variable name coould be read.

xliff2

As you can see pattern with variable names are pretty easy to read and understand.

However if there are no disp attribute the localization tool can only get the placeholder index and the same project as above would look like this.

xmb

As you can see pattern with only index are harder to read and undestand. Developer can copensate this by adding commens (as seen on both screenshots) but it would be a bit illogical because instead of variable name he or she would have to use 0 or 1 ...

Expected behavior

Implement the same feature that is currently in XLIFF 2.0 to XBM and XLIFF 1.2 extractors.

Minimal reproduction of the problem with instructions

Extract any interpolated string first to XLIFF 2.0 and then either to XMB or XLIFF 1.2

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

Make localization easier.

Please tell us about your environment:

Windows 8.1, VS code 1.12.2

  • Angular version: 4.2.0-rc.2

  • Browser: all

  • Language: all

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

@ocombe

This comment has been minimized.

Copy link
Contributor

commented Jun 12, 2017

Thanks! I'll add it to the to do list if it is compatible with the xmb / xliff 1.2 specs

@jaska45

This comment has been minimized.

Copy link
Author

commented Jun 12, 2017

Thanks. In XLIFF 1.2 you could use equiv-text attribute. I don't know about XBM because it is so hard to get any information about that format.

@ocombe

This comment has been minimized.

Copy link
Contributor

commented Jun 12, 2017

yeah, there is no spec for XMB (I know, I've asked)

@jaska45

This comment has been minimized.

Copy link
Author

commented Jun 12, 2017

As far as I know only Angular uses XMB. I have never seen anybody else using it. XMB is XML (even without official DTD or schema) so it should be safe just add an extra attribute. Something like

<ph name="INTERPOLATION" disp="{{name}}">

@ocombe

This comment has been minimized.

Copy link
Contributor

commented Jun 12, 2017

Actually XMB/XTB was developed by google, for google. It is available for the public through some of google open source projects (closure, angular), but that's about it. The lack of spec isn't helping third party tools to support it...

@jaska45

This comment has been minimized.

Copy link
Author

commented Jun 12, 2017

Thanks. This is not that important because XLIFF 2.0 works fine :-)

I will continue testing the new features. Thank you for implementing them, It seems the the only really important missing piece is the source code (.ts) string extraction.

I am happy that Angular has this official I18N/L10N method. Most other JS platforms do not have and then you end up with several 3rd party implementations. Hard for developers, hard for localization tool vendors.

@ocombe

This comment has been minimized.

Copy link
Contributor

commented Jun 12, 2017

Yes, we're working hard on adding those crucial missing features! It's nice that some people like you test the new things and report bugs as well.

@panuruj

This comment has been minimized.

Copy link

commented Jul 12, 2017

@jaska45 I'm glad that XLIFF 2.0 is working out for you. Our team at Microsoft is using it extensively as well. By the way, what is the tool that you have on your screenshots?

ocombe added a commit to ocombe/angular that referenced this issue Jul 13, 2017

@jaska45

This comment has been minimized.

Copy link
Author

commented Jul 14, 2017

It is a new localization tool that is currently on beta. I will send you some information about it.

ocombe added a commit to ocombe/angular that referenced this issue Jul 19, 2017

ocombe added a commit to ocombe/angular that referenced this issue Jul 19, 2017

ocombe added a commit to ocombe/angular that referenced this issue Jul 19, 2017

ocombe added a commit to ocombe/angular that referenced this issue Jul 21, 2017

ocombe added a commit to ocombe/angular that referenced this issue Jul 21, 2017

ocombe added a commit to ocombe/angular that referenced this issue Jul 24, 2017

@mhevery mhevery closed this in b3085e9 Jul 25, 2017

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

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

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

@joelmarty

This comment has been minimized.

Copy link

commented Dec 1, 2017

@jaska45 i'm very interested in your localization tool too!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.