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

Feature: ability to add a meaning/description to an ICU messages #24080

Closed
jaska45 opened this issue May 23, 2018 · 10 comments
Closed

Feature: ability to add a meaning/description to an ICU messages #24080

jaska45 opened this issue May 23, 2018 · 10 comments
Labels
area: i18n feature: insufficient votes Label to add when the not a sufficient number of votes or comments from unique authors feature: votes required Feature request which is currently still in the voting phase feature Issue that requests a new feature
Milestone

Comments

@jaska45
Copy link

jaska45 commented May 23, 2018

I have the following string in a template

<p i18n="plural|">I have {ski, plural, one {{{ski}} ski} other {{{ski}} skis}} and {car, plural, one {{{car}} car} other {{{car}} cars}}.</p>

When I run xi18n three unit elements are created. Only the first one has the meaning attribute.

I'm submitting a...


[ ] Regression (a behavior that used to work and stopped working in a new release)
[x] Bug report  
[ ] Performance issue
[ ] Feature request
[ ] Documentation issue or request
[ ] Support request => Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question
[ ] Other... Please describe:

Current behavior

Meaning attribute is added only to the first unit element

Expected behavior

Meaning attribute should be added to all three unit elements

Minimal reproduction of the problem with instructions

Add the following p element into a template and run xi18n

Environment


Angular version: 6.0.2

Browser: all
@ngbot ngbot bot added this to the needsTriage milestone May 24, 2018
@vicb
Copy link
Contributor

vicb commented May 24, 2018

Please give a reproduction OR at least the exact template, the exact output and what output you expect. Thanks.

@jaska45
Copy link
Author

jaska45 commented May 25, 2018

https://plnkr.co/edit/UqTRzbqGRZcdnkjTiKBY?p=info

If you extract the string you will get three unit elements. Only first one has the meaning attribute. I tried to include XLIFF output here but this platform does not let me to include it such way that it would be readable.

I will make a screenshot about the out XLIFF and draw the issue.

@jaska45
Copy link
Author

jaska45 commented May 25, 2018

Here is the screenshot about XLIFF output.

untitled

As you can see the 2nd and 3rd unit elements do not have a meaning attribute. They do have the location attribute.

@jaska45
Copy link
Author

jaska45 commented May 25, 2018

This sample has another issue. In the template we have one logical string. However once extracted it is split to three different units. A localization tool must try to parse them back into the logical string but that might not be possible. In above sample all three units are extracted into consecutive unit elements. However if some other string anywhere in the app uses the string any any of these three parts there is a string collision and both instances are mapped together and one of these part my be located on totally different part of the XLIFF.

@vicb vicb changed the title meaning attribute not added to XLIFF unit element Feature: ability to add a meaning/description to an ICU messages May 25, 2018
@vicb vicb added the feature Issue that requests a new feature label May 25, 2018
@ngbot ngbot bot modified the milestones: needsTriage, Backlog May 25, 2018
@vicb
Copy link
Contributor

vicb commented May 25, 2018

Thanks for the clarification.
What happens when you have such a message a<p i18n="plural2|">I have {ski, plural, one {{{ski}} ski} other {{{ski}} skis}} and {car, plural, one {{{car}} car} other {{{car}} cars.}}.</p>

  • We extract a string for the first ICU message {ski, plural, one {{{ski}} ski} other {{{ski}} skis}}
  • We extract a string for the second ICU message {car, plural, one {{{car}} car} other {{{car}} cars.}}
  • We extract a string with placeholders in place of ICU: I have <ph ICU1> and <ph ref ICU2>.

Then I think that what you are asking is the ability to add meaning/description/id to the ICU messages. Is my understanding correct ? (If that is the case, we might have an opened issue tracking this already)

@jaska45
Copy link
Author

jaska45 commented May 25, 2018

Thanks. You got it right.

@saithis
Copy link

saithis commented Jul 2, 2018

@vicb Why is the message split into 3 parts in the first place? If I put them back together into one string after extraction, the translation still works.

Would it be possible to add an option to not split the message?

@angular-robot
Copy link
Contributor

angular-robot bot commented Jun 5, 2021

Just a heads up that we kicked off a community voting process for your feature request. There are 20 days until the voting process ends.

Find more details about Angular's feature request process in our documentation.

@angular-robot angular-robot bot added the feature: votes required Feature request which is currently still in the voting phase label Jun 5, 2021
@angular-robot
Copy link
Contributor

angular-robot bot commented Jun 25, 2021

Thank you for submitting your feature request! Looks like during the polling process it didn't collect a sufficient number of votes to move to the next stage.

We want to keep Angular rich and ergonomic and at the same time be mindful about its scope and learning journey. If you think your request could live outside Angular's scope, we'd encourage you to collaborate with the community on publishing it as an open source package.

You can find more details about the feature request process in our documentation.

@angular-robot angular-robot bot added the feature: insufficient votes Label to add when the not a sufficient number of votes or comments from unique authors label Jun 25, 2021
@alxhub alxhub closed this as completed Apr 14, 2022
@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 May 15, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area: i18n feature: insufficient votes Label to add when the not a sufficient number of votes or comments from unique authors feature: votes required Feature request which is currently still in the voting phase feature Issue that requests a new feature
Projects
None yet
Development

No branches or pull requests

5 participants