refactor: generate i18n files in common/locales (#18907)
PR Close #18907
This commit is contained in:
parent
6970396c01
commit
535c7bb60c
@ -1,6 +1,6 @@
|
|||||||
// #docregion import-locale
|
// #docregion import-locale
|
||||||
import { registerLocaleData } from '@angular/common';
|
import { registerLocaleData } from '@angular/common';
|
||||||
import localeFr from '@angular/common/i18n_data/locale_fr';
|
import localeFr from '@angular/common/locales/fr';
|
||||||
|
|
||||||
registerLocaleData(localeFr);
|
registerLocaleData(localeFr);
|
||||||
// #enddocregion import-locale
|
// #enddocregion import-locale
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
// #docregion import-locale-extra
|
// #docregion import-locale-extra
|
||||||
import { registerLocaleData } from '@angular/common';
|
import { registerLocaleData } from '@angular/common';
|
||||||
import localeEnGB from '@angular/common/i18n_data/locale_en-GB';
|
import localeEnGB from '@angular/common/locales/en-GB';
|
||||||
import localeEnGBExtra from '@angular/common/i18n_data/extra/locale_en-GB';
|
import localeEnGBExtra from '@angular/common/locales/extra/en-GB';
|
||||||
|
|
||||||
registerLocaleData(localeEnGB, localeEnGBExtra);
|
registerLocaleData(localeEnGB, localeEnGBExtra);
|
||||||
// #enddocregion import-locale-extra
|
// #enddocregion import-locale-extra
|
||||||
|
@ -53,9 +53,9 @@ By default Angular only contains locale data for the language `en-US`, if you se
|
|||||||
|
|
||||||
<div class="l-sub-section">
|
<div class="l-sub-section">
|
||||||
|
|
||||||
Note that the files in `@angular/common/i18n_data` contain most of the locale data that you will
|
Note that the files in `@angular/common/locales` contain most of the locale data that you will
|
||||||
need, but some advanced formatting options might only be available in the extra dataset that you can
|
need, but some advanced formatting options might only be available in the extra dataset that you can
|
||||||
import from `@angular/common/i18n_data/extra`:
|
import from `@angular/common/locales/extra`:
|
||||||
|
|
||||||
<code-example path="i18n/src/app/app.locale_data_extra.ts" region="import-locale-extra" title="src/app/app.locale_data_extra.ts" linenums="false">
|
<code-example path="i18n/src/app/app.locale_data_extra.ts" region="import-locale-extra" title="src/app/app.locale_data_extra.ts" linenums="false">
|
||||||
</code-example>
|
</code-example>
|
||||||
|
2
build.sh
2
build.sh
@ -86,7 +86,7 @@ done
|
|||||||
#######################################
|
#######################################
|
||||||
isIgnoredDirectory() {
|
isIgnoredDirectory() {
|
||||||
name=$(basename ${1})
|
name=$(basename ${1})
|
||||||
if [[ -f "${1}" || "${name}" == "src" || "${name}" == "test" || "${name}" == "integrationtest" || "${name}" == "i18n_data" ]]; then
|
if [[ -f "${1}" || "${name}" == "src" || "${name}" == "test" || "${name}" == "integrationtest" || "${name}" == "locales" ]]; then
|
||||||
return 0
|
return 0
|
||||||
else
|
else
|
||||||
return 1
|
return 1
|
||||||
|
@ -17,7 +17,7 @@
|
|||||||
"node_modules/@angular/bazel/**",
|
"node_modules/@angular/bazel/**",
|
||||||
"node_modules/@angular/compiler-cli/**",
|
"node_modules/@angular/compiler-cli/**",
|
||||||
// Workaround bug introduced by 079d884
|
// Workaround bug introduced by 079d884
|
||||||
"node_modules/@angular/common/i18n_data*",
|
"node_modules/@angular/common/locales/**",
|
||||||
"node_modules/@angular/tsc-wrapped/**"
|
"node_modules/@angular/tsc-wrapped/**"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user