Repository navigation
fix(ivy): i18n - correctly parse XLIFF placeholders - #34155
Closed
petebacondarwin wants to merge 1 commit into
Closed
petebacondarwin wants to merge 1 commit into
petebacondarwin wants to merge 1 commit into
Conversation
|
|
The ViewEngine translation extractor does not convert `-` to `_` for placeholders that represent custom elements. For example `<app-component>` gets converted to placeholders like `START_TAG_APP-COMPONENT`. In `$localize` placeholders are expected to be snake-case, not kebab-case. So we must normalize them when parsing a translation file that might have been created via the View Engine translation extractor. The `$localize` extraction code will normalize these placeholders when creating translation files in the first place. Fixes angular#34151
petebacondarwin
force-pushed
the
i18n-placeholders
branch
from
November 30, 2019 07:58
7894e98 to
a8399a1
Compare
petebacondarwin
marked this pull request as ready for review
November 30, 2019 07:59
|
Thanks for fixing, BTW, you wrote
Means there might be Ivy message extractor as well which should not have such problem, how to use it? Now for non-AngularCLI project I use this snippet to extract messages from template HTML: const {DEFAULT_INTERPOLATION_CONFIG, HtmlParser, MessageBundle, Xliff} = require('@angular/compiler');
//...
catalog.updateFromTemplate(html, relative, DEFAULT_INTERPOLATION_CONFIG);
//... |
Contributor
Author
|
The next-generation message extraction is still a WIP which will land after v9.0.0 - see #32912 |
mhevery
pushed a commit
that referenced
this pull request
Dec 2, 2019
The ViewEngine translation extractor does not convert `-` to `_` for placeholders that represent custom elements. For example `<app-component>` gets converted to placeholders like `START_TAG_APP-COMPONENT`. In `$localize` placeholders are expected to be snake-case, not kebab-case. So we must normalize them when parsing a translation file that might have been created via the View Engine translation extractor. The `$localize` extraction code will normalize these placeholders when creating translation files in the first place. Fixes #34151 PR Close #34155
|
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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The ViewEngine translation extractor does not convert
-to_forplaceholders that represent custom elements. For example
<app-component>gets converted to placeholders likeSTART_TAG_APP-COMPONENT.In
$localizeplaceholders are expected to be snake-case,not kebab-case. So we must normalize them when parsing
a translation file that might have been created via the View
Engine translation extractor.
The
$localizeextraction code will normalize theseplaceholders when creating translation files in the first
place.
Fixes #34151