Skip to content
This repository was archived by the owner on Dec 4, 2017. It is now read-only.

Commit d54d55c

Browse files
committed
Minor prose fixes to aot, i18n cookbooks
1 parent a91d805 commit d54d55c

File tree

3 files changed

+23
-25
lines changed

3 files changed

+23
-25
lines changed

public/docs/ts/latest/cookbook/aot-compiler.jade

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,8 @@ code-example(language="none" class="code-shell").
114114
`ngc` is a drop-in replacement for `tsc` and is configured much the same way.
115115

116116
`ngc` requires its own `tsconfig.json` with AOT-oriented settings.
117-
Copy the original `tsconfig.json` to a file called `tsconfig-aot.json`, then modify it to look as follows.
117+
Copy the original `src/tsconfig.json` to a file called `tsconfig-aot.json` (on the project root),
118+
then modify it to look as follows.
118119

119120
+makeExample('cb-aot-compiler/ts/tsconfig-aot.json', null, 'tsconfig-aot.json')(format='.')
120121

@@ -338,10 +339,10 @@ a#source-code
338339
cb-aot-compiler/ts/tsconfig-aot.json,
339340
cb-aot-compiler/ts/rollup-config.js`,
340341
null,
341-
`app/app.component.html,
342-
app/app.component.ts,
343-
main.ts,
344-
index.html,
342+
`src/app/app.component.html,
343+
src/app/app.component.ts,
344+
src/main.ts,
345+
src/index.html,
345346
tsconfig-aot.json,
346347
rollup-config.js`
347348
)
@@ -415,16 +416,15 @@ a#toh
415416
***index.html***
416417

417418
The JIT and AOT apps require their own `index.html` files because they setup and launch so differently.
418-
**Put the AOT version in the `/aot` folder** because two `index.html` files can't be in the same folder.
419419

420420
Here they are for comparison:
421421

422422
+makeTabs(
423-
`toh-6/ts/aot/index.html,
424-
toh-6/ts/src/index.html`,
423+
`toh-6/ts/src/index.html,
424+
toh-6/ts/src/index-jit.html`,
425425
null,
426-
`aot/index.html (AOT),
427-
index.html (JIT)`
426+
`src/index.html (AOT),
427+
src/index-jit.html (JIT)`
428428
)
429429

430430
:marked
@@ -441,7 +441,7 @@ a#toh
441441
are evident in these `main` files which can and should reside in the same folder:
442442

443443
+makeTabs(
444-
`toh-6/ts/src/app/main-aot.ts,
444+
`toh-6/ts/src/main-aot.ts,
445445
toh-6/ts/src/main.ts`,
446446
null,
447447
`main-aot.ts (AOT),
@@ -462,7 +462,7 @@ a#toh
462462
toh-6/ts/src/tsconfig.json`,
463463
null,
464464
`tsconfig-aot.json (AOT),
465-
tsconfig.json (JIT)`
465+
src/tsconfig.json (JIT)`
466466
)
467467

468468
.callout.is-helpful
@@ -500,14 +500,12 @@ a#toh
500500

501501
Compiling with AOT presupposes certain supporting files, most of them discussed above.
502502
+makeTabs(
503-
`toh-6/ts/aot/index.html,
504-
toh-6/ts/aot/bs-config.json,
503+
`toh-6/ts/src/index.html,
505504
toh-6/ts/copy-dist-files.js,
506505
toh-6/ts/rollup-config.js,
507506
toh-6/ts/tsconfig-aot.json`,
508507
null,
509-
`aot/index.html,
510-
aot/bs-config.json,
508+
`src/index.html,
511509
copy-dist-files.js,
512510
rollup-config.js,
513511
tsconfig-aot.json`)

public/docs/ts/latest/cookbook/i18n.jade

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -305,11 +305,11 @@ a#localization-folder
305305
Localization and internationalization are
306306
<a href="https://en.wikipedia.org/wiki/Internationalization_and_localization" target="_blank">different but closely related terms</a>.
307307
:marked
308-
This cookbook follows that suggestion. It has a `locale` folder under the project root.
308+
This cookbook follows that suggestion. It has a `locale` folder under the `src/`.
309309
Assets within the folder carry a filename extension that matches a language-culture code from a
310310
<a href="https://msdn.microsoft.com/en-us/library/ee825488(v=cs.20).aspx" target="_blank">well-known codeset</a>.
311311

312-
Make a copy of the `messages.xlf` file in the `locale` folder and
312+
Make a copy of the `messages.xlf` file, put it in the `locale` folder and
313313
rename it `messages.es.xlf`for the Spanish language translation.
314314
Do the same for each target language.
315315

@@ -321,13 +321,13 @@ a#localization-folder
321321
This sample file is easy to translate without a special editor or knowledge of Spanish.
322322
Open `messages.es.xlf` and find the first `<trans-unit>` section:
323323

324-
+makeExample('cb-i18n/ts/locale/messages.es.xlf.html', 'translated-hello', 'locale/messages.es.xlf (<trans-unit>)')(format=".")
324+
+makeExample('cb-i18n/ts/src/locale/messages.es.xlf.html', 'translated-hello', 'src/locale/messages.es.xlf (<trans-unit>)')(format=".")
325325
:marked
326326
This XML element represents the translation of the `<h1>` greeting tag you marked with the `i18n` attribute.
327327

328328
Using the _source_, _description_, and _meaning_ elements to guide your translation,
329329
replace the `<target/>` tag with the Spanish greeting:
330-
+makeExample('cb-i18n/ts/locale/messages.es.xlf.html', 'translated-hello', 'locale/messages.es.xlf (<trans-unit>, after translation)')(format=".")
330+
+makeExample('cb-i18n/ts/src/locale/messages.es.xlf.html', 'translated-hello', 'src/locale/messages.es.xlf (<trans-unit>, after translation)')(format=".")
331331

332332
.alert.is-important
333333
:marked
@@ -339,7 +339,7 @@ a#localization-folder
339339
:marked
340340
Translate the other text nodes the same way:
341341

342-
+makeExample('cb-i18n/ts/locale/messages.es.xlf.html', 'translated-other-nodes', 'locale/messages.es.xlf (<trans-unit>)')(format=".")
342+
+makeExample('cb-i18n/ts/src/locale/messages.es.xlf.html', 'translated-other-nodes', 'src/locale/messages.es.xlf (<trans-unit>)')(format=".")
343343

344344
a#translate-plural-select
345345
:marked
@@ -358,7 +358,7 @@ a#translate-plural-select
358358
### Translate _plural_
359359
To translate a `plural`, translate its ICU format match values:
360360

361-
+makeExample('cb-i18n/ts/locale/messages.es.xlf.html', 'translated-plural', 'locale/messages.es.xlf (<trans-unit>)')(format=".")
361+
+makeExample('cb-i18n/ts/src/locale/messages.es.xlf.html', 'translated-plural', 'src/locale/messages.es.xlf (<trans-unit>)')(format=".")
362362

363363
:marked
364364
### Translate _select_
@@ -373,17 +373,17 @@ a#translate-plural-select
373373
In place of the `select` is a placeholder, `<x id="ICU">`, that represents the `select` message.
374374
Translate the text and leave the placeholder where it is.
375375

376-
+makeExample('cb-i18n/ts/locale/messages.es.xlf.html', 'translate-select-1', 'locale/messages.es.xlf (<trans-unit>)')(format=".")
376+
+makeExample('cb-i18n/ts/src/locale/messages.es.xlf.html', 'translate-select-1', 'src/locale/messages.es.xlf (<trans-unit>)')(format=".")
377377

378378
:marked
379379
The second translation unit, immediately below the first one, contains the `select` message. Translate that.
380380

381-
+makeExample('cb-i18n/ts/locale/messages.es.xlf.html', 'translate-select-2', 'locale/messages.es.xlf (<trans-unit>)')(format=".")
381+
+makeExample('cb-i18n/ts/src/locale/messages.es.xlf.html', 'translate-select-2', 'src/locale/messages.es.xlf (<trans-unit>)')(format=".")
382382

383383
:marked
384384
Here they are together, after translation:
385385

386-
+makeExample('cb-i18n/ts/locale/messages.es.xlf.html', 'translated-select', 'locale/messages.es.xlf (<trans-unit>)')(format=".")
386+
+makeExample('cb-i18n/ts/src/locale/messages.es.xlf.html', 'translated-select', 'src/locale/messages.es.xlf (<trans-unit>)')(format=".")
387387

388388
.l-main-content
389389
:marked

0 commit comments

Comments
 (0)