Slide 1

Slide 1 text

Piotr Lewandowski

Slide 2

Slide 2 text

INTERNATIONALIZATION I18N LOCALIZATION L10N

Slide 3

Slide 3 text

Localization Adapting product to region-desired „look and feel” ‍ Translator responsibility

Slide 4

Slide 4 text

No content

Slide 5

Slide 5 text

Internationalization Enables easy localization Developer responsibility

Slide 6

Slide 6 text

Right to left Dates Currencies Grammar forms Temperature Numbers Legal Translation Plurals Symbols Units Sorting

Slide 7

Slide 7 text

Dates Currencies Numbers Plurals Translation Grammar forms

Slide 8

Slide 8 text

Translation templates Formatting pipes ICU expressions

Slide 9

Slide 9 text

Re-use existing standards Don’t enforce process No rutime overhead

Slide 10

Slide 10 text

Hello, {{ name }}!

Last time seen at {{ lastVisited | date }}

Slide 11

Slide 11 text

No content

Slide 12

Slide 12 text

No content

Slide 13

Slide 13 text

Alicja { count, plural, =0 { nie złapała Pokémona } one { złapała Pokémona } few { złapała {{count}} Pokémony } many { złapała {{count}} Pokémonów } other { złapała Pokémonów: {{count}} } }

Alicja złapała 5 Pokémonów count = 5

Slide 14

Slide 14 text

Brawo, { gender, select, male { złapałeś Pokémona } female { złapałaś Pokémona } other { Pokémon został złapany } }

Brawo, złapałeś Pokémona gender = ' male' '...'

Slide 15

Slide 15 text

Hello, !

Hello, {{name}}!

Slide 16

Slide 16 text

Hello, !

Hello, {{name}}!

Slide 17

Slide 17 text

Angular is cool

Angular is cool

Generated ID hash Content change = ID change Custom ID Never changes

Slide 18

Slide 18 text

Mark HTML with i18n attributes Extract messages from HTML to XLIFF Copy & translate XLIFF Generate new app version for each language Outside Angular

Slide 19

Slide 19 text

No content

Slide 20

Slide 20 text

No content

Slide 21

Slide 21 text

No content

Slide 22

Slide 22 text

Currently... Everything at build time with AOT Duplicated builds for each locale Desired... ONE bundle for all locales Translating before application bootstraps

Slide 23

Slide 23 text

On the roadmap since 2.0 Planned for Angular 7 with Ivy compiler Already in master since June 2018

Slide 24

Slide 24 text

interface I18nDef { value: string; id?: string; meaning?: string; description?: string; }

Hello, Gdańsk!

interface I18nDef { value: 'Hello, Gdańsk!'; id?: 'page.header'; meaning?: undefined; description?: 'User profile'; }

Slide 25

Slide 25 text

PR #24037 205 review comments ☺ Loading BEFORE Angular bootstraps All locales in ONE bundle Choose: AOT or RunTime ❔ XLIFF has to be in JS bundle

Slide 26

Slide 26 text

No content

Slide 27

Slide 27 text

Currently... Everything in HTML Desired... Translation in services

Slide 28

Slide 28 text

Planned with Angular 7 with Ivy compiler Work in progress Polyfill already exists @ngx-translate/i18n-polyfill

Slide 29

Slide 29 text

constructor(i18n: I18n) { this.message = i18n('Speaking at meetup in {{myVar}} !', { myVar: 'Gdańsk, Poland' });

Slide 30

Slide 30 text

No content

Slide 31

Slide 31 text

Better docs Angular CLI support

Slide 32

Slide 32 text

Localize single module Better library support See #14331

Slide 33

Slide 33 text

Allow custom parsers, generators and loaders Possible JSON support

Slide 34

Slide 34 text

No content

Slide 35

Slide 35 text

Slide 36

Slide 36 text

✅ // tslint.json "i18n": [ true, "check-id", "check-text" ] * Requires codelyzer Optional, depending on your translation strategy

Slide 37

Slide 37 text

Angular i18n is cool

Slide 38

Slide 38 text

Angular i18n is cool

Slide 39

Slide 39 text

Slide 40

Slide 40 text

// package.json "scripts": { "build": "ng build && ng xi18n" },

Slide 41

Slide 41 text

Angular i18n is cool

Angular i18n is cool

...

Error: Could not mark an element as translatable inside a translatable section

Slide 42

Slide 42 text

Angular i18n is cool

Angular i18n is cool

...

Slide 43

Slide 43 text

Angular i18n is cool

Angular i18n is cool

...

Slide 44

Slide 44 text

No content

Slide 45

Slide 45 text

No content

Slide 46

Slide 46 text

Angular i18n: » Docs » Plans for v6 and v7 General: » On i18n and l10n » i18nGuy - Guidelines

Slide 47

Slide 47 text

Localization platforms: » Pootle » Transifex » POEditor » TextUnited Editors & scripts: » Virtaal » tiny ng-translator » ngx-i18nsupport (xliff merge)

Slide 48

Slide 48 text

Piotr Lewandowski THANK YOU DZIĘKUJĘ 谢谢