Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: update i18n docs sample to cater for latest raw-loader version #32334

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion aio/content/examples/i18n/doc-files/main.2.ts
Expand Up @@ -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: [
Expand Down
26 changes: 14 additions & 12 deletions aio/content/guide/i18n.md
Expand Up @@ -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.
Expand Down