feat(compiler) : i18n explicit ID#13272
Conversation
|
@vicb I created new PR, because I'm not very good at rebasing. Now you have a clean PR. |
0350625 to
bde38c5
Compare
There was a problem hiding this comment.
what do you think or renaming i18nInfo to msgInfo / msgMeta ?
There was a problem hiding this comment.
_parseMessageMeta would look better, WDYT ?
There was a problem hiding this comment.
please return an obj now, would be clerarer
There was a problem hiding this comment.
Please look for @@ first.
- split left part on | for m|d,
- right part is id
add const MEANING_SEPARATOR = "|" and const ID_SEPARATOR = "@@"
There was a problem hiding this comment.
add trailing "," here please - and maybe move id first (this is the important part)
|
Thanks ! I have added a last round of comments. To rebase, update your master branch from upstream (or origin whatever it is name) and do a Also please remove the WS before the colon in |
|
Also we discussed about an issue/PR on the doc repo, any progress on that front ? |
bde38c5 to
8f8af59
Compare
|
@vicb see the angular.io PR => docs(compiler): add doc + examples for i18n explicit ID option |
8f8af59 to
129d9c7
Compare
There was a problem hiding this comment.
simplify, something like:
const idIndex = i18n.indexOf(ID_SEPARATOR);
const [mAndD, id] = idIndex == -1 ? [i18n, ''] : [i18n.slice(0, idIndex), i18n.slice(idIndex + 2)];
const descIndex = i18n.indexOf('|');
const [meaning, description] = descIndex == -1 ? ['', mAndD] : [mAndD.slice(0, descIndex), i18n.slice(descIndex + 1)];
return {meaning, description, id};|
Thanks, this PRs looks good. Only a couple more changes before this can be merged. |
129d9c7 to
b868ce2
Compare
|
Thanks! it should get in tomorrow. |
|
Would this feature allow us to set IDs in our HTML/XLF files and avoid having to maintain IDs changing? |
|
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Please check if the PR fulfills these requirements
What kind of change does this PR introduce? (check one with "x")
What is the current behavior? (You can also link to an open issue here)
See [i18n] enable control over translation message ID
What is the new behavior?
Developer can now use specific ID in translations by adding a new "parameter" in the i18n attribute :
will produce for XMB :
Does this PR introduce a breaking change? (check one with "x")
If this PR contains a breaking change, please describe the impact and migration path for existing applications: ...
Other information: