@@ -91,7 +91,7 @@ a(id="i18n-directive")
9191:marked
9292 ### i18n directive
9393
94- The i18n directive is what tells Angular where it should inject the translations.
94+ The ` i18n` directive is what tells Angular where it should inject the translations.
9595 It is used by both the JiT and the AoT approaches.
9696
9797 We simply add the attribute `i18n` to an element and the content string will be replaced when necessary.
@@ -128,7 +128,7 @@ a(id="i18n-plural-pipe")
128128
129129.alert.is-important
130130 :marked
131- The plural pipe is not yet supported by the ng-xi18n messages extractor.
131+ The ng-xi18n messages extractor doesn't support the plural pipe right now.
132132
133133
134134a( id ="i18n-select-pipe" )
@@ -144,7 +144,7 @@ a(id="i18n-select-pipe")
144144+ makeExample('i18n/ts-snippets/i18n.config.snippets.ts' , 'i18n-select-pipe' )( format ="." )
145145.alert.is-important
146146 :marked
147- The select pipe is not yet supported by the ng-xi18n messages extractor .
147+ The ng-xi18n messages extractor doesn't support the select pipe right now .
148148
149149
150150a( id ="extract" )
@@ -163,14 +163,15 @@ a(id="ng-xi18n")
163163 To use it, the first thing that we have to do is to install it:
164164
165165code-example( language ="sh" ) .
166- npm install @angular/compiler-cli --save
166+ npm install @angular/compiler-cli
@angular/platform-server [email protected] --save
167167
168168:marked
169- Like `ngc`, `ng-xi18n` is based on `tsc`, the TypeScript compiler. It uses the file `tsconfig.json` to determine where
170- are our files. We have to make sure that we have defined the parameter `files` so that it knows what is the entry point
171- of our application.
169+ Like `ngc`, `ng-xi18n` is based on `tsc`, the TypeScript compiler.
172170
173- + makeExample('i18n/ts-snippets/i18n.config.snippets.ts' , 'tsconfig1' )( format ="." )
171+ Let's edit our `tsconfig.json` file and add the `angularCompilerOptions` with `genDir` pointing to the folder where we
172+ want `ng-xi18n` to generate the file.
173+
174+ + makeExample('i18n/ts-snippets/i18n.config.snippets.ts' , 'tsconfig' )( format ="." )
174175
175176:marked
176177 We can then use the `ng-xi18n` binary to generate a file named `messages.xlf` at the root of our application.
@@ -187,11 +188,6 @@ code-example(language="sh").
187188
188189:marked
189190 If we want to generate this `messages.xlf` file somewhere in particular, `ng-xi18n` uses the same parameters as `ngc`.
190-
191- Let's edit our `tsconfig.json` file and add the `angularCompilerOptions` with `genDir` pointing to the folder where we
192- want `ng-xi18n` to generate the file.
193-
194- + makeExample('i18n/ts-snippets/i18n.config.snippets.ts' , 'tsconfig2' )( format ="." )
195191
196192:marked
197193 The generated `messages.xlf` file uses by default the format `XML Localisation Interchange File Format` (XLIFF, version 1.2).
@@ -225,7 +221,7 @@ a(id="translate")
225221
226222.alert.is-helpful
227223 :marked
228- Using a versionning system such as `GIT` can help us find out easily what new translations have been generated by
224+ Using a versioning system such as `GIT` can help us find out easily what new translations have been generated by
229225 the messages extractor.
230226
231227a( id ="use-jit" )
@@ -238,7 +234,7 @@ a(id="use-jit")
238234 Angular 2 understand `xlf` and `xmb` formats, but we have to provide these message into our application.
239235 To do that we will have to define a few providers at bootstrap time.
240236
241- Let's say that we have the following bootstrap file:
237+ Having the following bootstrap file:
242238
243239+ makeExample('i18n/ts-snippets/i18n.config.snippets.ts' , 'bootstrap' )( format ="." )
244240
@@ -291,7 +287,7 @@ a(id="use-aot")
291287 If we want to generate precompiled files for our french translations, we will use:
292288
293289code-example( language ="sh" ) .
294- ngc --i18nFile=./src /i18n/messages.fr.xlf --locale=fr --i18nFormat=xlf
290+ ngc --i18nFile=./app /i18n/messages.fr.xlf --locale=fr --i18nFormat=xlf
295291
296292.alert.is-helpful
297293 :marked
0 commit comments