Skip to content

fix(compiler-cli): add fallback to xlf format to extractor - #16338

Closed
denyo wants to merge 2 commits into
angular:masterfrom
denyo:fix-xi18n-extraction-without-format
Closed

denyo wants to merge 2 commits into
angular:masterfrom
denyo:fix-xi18n-extraction-without-format

Conversation

@denyo

@denyo denyo commented Apr 26, 2017

Copy link
Copy Markdown
Contributor

What kind of change does this PR introduce?

[x] Bugfix

What is the current behavior?
Running ./node_modules/.bin/ng-xi18n to extract messages without the --i18nFormat parameter results in

TypeError: Cannot read property 'toLowerCase' of null
    at Extractor.serialize (/.../node_modules/@angular/compiler-cli/src/extractor.js:46:32)
    at /.../node_modules/@angular/compiler-cli/src/extractor.js:32:33
    at process._tickCallback (internal/process/next_tick.js:109:7)
    at Module.runMain (module.js:606:11)
    at run (bootstrap_node.js:393:7)
    at startup (bootstrap_node.js:150:9)
    at bootstrap_node.js:508:3
Extraction failed

What is the new behavior?
Running ./node_modules/.bin/ng-xi18n without a format works because it falls back to a default format of xlf as described in the Cookbook here: https://angular.io/docs/ts/latest/cookbook/i18n.html#!#ng-xi18n

Does this PR introduce a breaking change?

[x] No

@denyo

denyo commented Apr 27, 2017

Copy link
Copy Markdown
Contributor Author

I just realized that this is basically the same issue covered in #16273.

Comment thread packages/compiler-cli/src/extractor.ts Outdated
}

serialize(bundle: compiler.MessageBundle, formatName: string): string {
formatName = formatName || 'xlf';

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fix the call site instead. formatName is supposed to be a string here.

@vicb vicb added the action: cleanup The PR is in need of cleanup, either due to needing a rebase or in response to comments from reviews label Apr 27, 2017
@jasonaden

Copy link
Copy Markdown
Contributor

Thanks. Closing as fixed in #16273

@jasonaden jasonaden closed this May 10, 2017
@angular-automatic-lock-bot

Copy link
Copy Markdown

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 Sep 11, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

action: cleanup The PR is in need of cleanup, either due to needing a rebase or in response to comments from reviews cla: yes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants