From 35b30159e8d25473658ae66a076854b705d7ca1f Mon Sep 17 00:00:00 2001 From: Alan Date: Tue, 27 Aug 2019 10:07:38 +0200 Subject: [PATCH 1/2] docs: update i18n docs sample to cater for latest raw-loader version `raw-loader` version 2+ which is used in the CLI version 8 introduced a breaking change and now uses `export default` instead of `module.exports`. See: https://github.com/webpack-contrib/raw-loader/blob/master/CHANGELOG.md#200-2019-03-18 Closes #32333 --- aio/content/examples/i18n/doc-files/main.2.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aio/content/examples/i18n/doc-files/main.2.ts b/aio/content/examples/i18n/doc-files/main.2.ts index 0b68bc10fe5c9..5807e7b40f43b 100644 --- a/aio/content/examples/i18n/doc-files/main.2.ts +++ b/aio/content/examples/i18n/doc-files/main.2.ts @@ -12,7 +12,7 @@ if (environment.production) { // use the require method provided by webpack declare const require; // we use the webpack raw-loader to return the content as a string -const translations = require(`raw-loader!./locale/messages.fr.xlf`); +const translations = require('raw-loader!./locale/messages.fr.xlf').default; platformBrowserDynamic().bootstrapModule(AppModule, { providers: [ From 09ea2eb2acbbcbfaff6f8d58d0e477838d538f82 Mon Sep 17 00:00:00 2001 From: Alan Date: Tue, 27 Aug 2019 10:23:10 +0200 Subject: [PATCH 2/2] style: align i18n angular config --- aio/content/guide/i18n.md | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/aio/content/guide/i18n.md b/aio/content/guide/i18n.md index a55bc32a6bba5..42d9b6ed8efd8 100644 --- a/aio/content/guide/i18n.md +++ b/aio/content/guide/i18n.md @@ -707,22 +707,24 @@ the CLI configuration file, `angular.json`. "i18nLocale": "fr", "i18nMissingTranslation": "error", } -// ... -"serve": { - "builder": "@angular-devkit/build-angular:dev-server", - "options": { - "browserTarget": "my-project:build" + } }, - "configurations": { - "production": { - "browserTarget": "my-project:build:production" + ... + "serve": { + "builder": "@angular-devkit/build-angular:dev-server", + "options": { + "browserTarget": "my-project:build" }, - "fr": { - "browserTarget": "my-project:build:fr" + "configurations": { + "production": { + "browserTarget": "my-project:build:production" + }, + "fr": { + "browserTarget": "my-project:build:fr" + } } } -}, - +} ``` The same configuration options can also be provided through the CLI with your existing `production` configuration.