angular-docs-cn/packages/common
Pete Bacon Darwin a3c44124ab build: support generating global locale files from CLDR data (#33523)
In order to support adding locales during compile-time
inlining of translations (i.e. after the TS build has completed),
we need to be able to attach the locale to the global scope.

This commit modifies CLDR extraction to emit additional "global"
locale files that appear in the `@angular/common/locales/global` folder.

These files are of the form:

```
(function() {
  const root = typeof globalThis !== 'undefined' && globalThis ||
      typeof global !== 'undefined' && global || typeof window !== 'undefined' && window;
  root.ng = root.ng || {};
  root.ng.common = root.ng.common || {};
  root.ng.common.locale = root.ng.common.locale || {};
  const u = undefined;
  function plural(n) {
    if (n === 1) return 1;
    return 5;
  }
  root.ng.common.locale['xx-yy'] = [...];
})();
```

The IIFE will ensure that `ng.common.locale` exists and attach the
given locale (and its "extras") to it using it "normalized" locale
name.

* "extras": in the UMD module locale files the "extra" locale data,
currently the day period rules, and extended day period data, are
stored in separate files under the "common/locales/extra" folder.

* "normalized": Angular references locales using a normalized form,
which is lower case with `_` replaced by `-`. For example:
`en_UK` => `en-uk`.

PR Close #33523
2019-11-05 17:26:59 +00:00
..
http docs: clarify http header api doc (#33038) 2019-10-14 23:45:45 +00:00
locales build: support generating global locale files from CLDR data (#33523) 2019-11-05 17:26:59 +00:00
src docs(common): Remove async pipe from ngFor example (#33378) 2019-10-31 23:47:28 +00:00
test fix(common): remove deprecated support for intl API (#29250) 2019-10-17 20:44:17 -04:00
testing build: TypeScript 3.5 upgrade (#31615) 2019-07-25 17:05:23 -07:00
upgrade test(upgrade): add unit tests for AngularJSUrlCodec's parse method (#32976) 2019-10-03 09:55:26 -07:00
BUILD.bazel build: convert entry_point to label (#30627) 2019-06-11 00:03:11 +00:00
PACKAGE.md docs: add package doc files (#26047) 2018-10-05 15:42:14 -07:00
index.ts refactor: move angular source to /packages rather than modules/@angular 2017-03-08 16:29:27 -08:00
package.json build: support generating global locale files from CLDR data (#33523) 2019-11-05 17:26:59 +00:00
public_api.ts build: add bazel test rules for more packages (#21053) 2017-12-22 13:10:51 -08:00