angular-docs-cn/packages
Pete Bacon Darwin b741a1c3e7 fix(ivy): i18n - update the compiler to output `MessageId`s (#32594)
Now that the `$localize` translations are `MessageId` based the
compiler must render `MessageId`s in its generated `$localize` code.
This is because the `MessageId` used by the compiler is computed
from information that does not get passed through to the `$localize`
tagged string.

For example, the generated code for the following template

```html
<div id="static" i18n-title="m|d" title="introduction"></div>
```

will contain these localization statements

```ts
if (ngI18nClosureMode) {
  /**
    * @desc d
    * @meaning m
    */
  const MSG_EXTERNAL_8809028065680254561$$APP_SPEC_TS_1 = goog.getMsg("introduction");
  I18N_1 = MSG_EXTERNAL_8809028065680254561$$APP_SPEC_TS_1;
}
else {
  I18N_1 = $localize \`:m|d@@8809028065680254561:introduction\`;
}
```

Since `$localize` is not able to accurately regenerate the source-message
(and so the `MessageId`) from the generated code, it must rely upon the
`MessageId` being provided explicitly in the generated code.

The compiler now prepends all localized messages with a "metadata block"
containing the id (and the meaning and description if defined).

Note that this metadata block will also allow translation file extraction
from the compiled code - rather than relying on the legacy ViewEngine
extraction code. (This will be implemented post-v9).

Although these metadata blocks add to the initial code size, compile-time
inlining will completely remove these strings and so will not impact on
production bundle size.

PR Close #32594
2019-09-17 09:17:45 -07:00
..
animations refactor(core): Migrate TestBed.get to TestBed.inject (#32382) 2019-09-09 19:10:54 -04:00
bazel feat(bazel): support ts_library targets as entry-points for ng_package (#32610) 2019-09-13 13:23:55 -07:00
benchpress build: TypeScript 3.5 upgrade (#31615) 2019-07-25 17:05:23 -07:00
common refactor(ivy): remove styling state storage and introduce direct style writing (#32591) 2019-09-16 14:12:48 -07:00
compiler fix(ivy): i18n - update the compiler to output `MessageId`s (#32594) 2019-09-17 09:17:45 -07:00
compiler-cli fix(ivy): i18n - update the compiler to output `MessageId`s (#32594) 2019-09-17 09:17:45 -07:00
core fix(ivy): i18n - update the compiler to output `MessageId`s (#32594) 2019-09-17 09:17:45 -07:00
docs
elements fix(elements): handle falsy initial value (#31604) 2019-07-18 14:26:37 -07:00
examples refactor(bazel): remove @angular/bazel protractor rule now provided by @bazel/protractor (#32485) 2019-09-10 15:19:31 -04:00
forms docs(forms): correct parameter names in jsdoc (#32530) 2019-09-09 15:55:42 -04:00
http refactor: Move `dom_adapter.ts` to `@angular/common` (#32154) 2019-08-29 21:51:56 -07:00
language-service fix(compiler-cli): fix typo in diagnostic template info. (#32684) 2019-09-16 08:59:48 -07:00
localize fix(ivy): i18n - use `MessageId` for matching translations (#32594) 2019-09-17 09:17:44 -07:00
platform-browser fix(core): initialize global ngDevMode without toplevel side effects (#32079) 2019-09-11 20:31:14 -04:00
platform-browser-dynamic refactor(core): Migrate TestBed.get to TestBed.inject (#32382) 2019-09-09 19:10:54 -04:00
platform-server refactor(core): move Meta methods that only have one version from DomAdapter (#32408) 2019-09-03 11:59:39 -07:00
platform-webworker refactor(core): move Meta methods that only have one version from DomAdapter (#32408) 2019-09-03 11:59:39 -07:00
platform-webworker-dynamic build: convert entry_point to label (#30627) 2019-06-11 00:03:11 +00:00
private/testing test(ivy): add onlyInIvy perf counter expectations (#30339) 2019-05-09 11:22:00 -07:00
router docs: fix typos in the routing and testing documentation (#32329) 2019-09-10 07:58:44 -04:00
service-worker refactor(core): Migrate TestBed.get to TestBed.inject (#32382) 2019-09-09 19:10:54 -04:00
upgrade refactor(core): Migrate TestBed.get to TestBed.inject (#32382) 2019-09-09 19:10:54 -04:00
zone.js fix(zone.js): a path traversal attack in test (#32392) 2019-08-30 12:44:46 -07:00
BUILD.bazel refactor(core): ensure compatibility with typescript strict flag (#30993) 2019-07-18 14:21:25 -07:00
README.md
empty.ts
goog.d.ts fix(ivy): use goog.LOCALE for Closure Compiler to define default LOCALE_ID (#31519) 2019-07-16 13:02:10 -04:00
license-banner.txt build: bump year (#27880) 2019-01-11 11:15:59 -08:00
system.d.ts
tsconfig-build-no-strict.json refactor(core): ensure compatibility with typescript strict flag (#30993) 2019-07-18 14:21:25 -07:00
tsconfig-build.json refactor(core): ensure compatibility with typescript strict flag (#30993) 2019-07-18 14:21:25 -07:00
tsconfig-test.json refactor: fix typescript strict flag failures in all tests (#30993) 2019-07-18 14:21:26 -07:00
tsconfig.json test(language-service): Make tests better by adding more assertions (#32630) 2019-09-12 10:23:51 -07:00
types.d.ts build: switch to typescript's es2015 typings (#28570) 2019-02-06 14:17:55 -05:00

README.md

Angular

The sources for this package are in the main Angular repo. Please file issues and pull requests against that repo.

License: MIT