diff --git a/docs/index.md b/docs/index.md index 9c3b14fd..a2026876 100644 --- a/docs/index.md +++ b/docs/index.md @@ -14,7 +14,7 @@ It allows, in addition to translation, to localize numbers and dates of your app --- -> Library version: 4.1.2 - [Changelog](https://github.com/robisim74/angular-l10n/releases) +> Library version: 4.1.3 - [Changelog](https://github.com/robisim74/angular-l10n/releases)
@@ -64,4 +64,4 @@ and use global `ng.l10n` namespace. --- ### AoT compilation, Server Side Rendering & strict -This library is compatible with AoT compilation & Server Side Rendering. It also supports the `strict` TypeScript compiler option. +This library is compatible with AoT compilation & [Server Side Rendering](quick-start/#appendix-d-using-angular-universal). It also supports the `strict` TypeScript compiler option. diff --git a/docs/quick-start.md b/docs/quick-start.md index a4d546eb..53ca1bd4 100644 --- a/docs/quick-start.md +++ b/docs/quick-start.md @@ -326,9 +326,9 @@ import { Component, OnInit } from '@angular/core';

Subtitle

-

{{ today }}

-

{{ pi }}

-

{{ value }}

+

{{ today }}

+

{{ pi }}

+

{{ value }}

` diff --git a/docs/spec/api.md b/docs/spec/api.md index 6b64edb0..05dc66aa 100644 --- a/docs/spec/api.md +++ b/docs/spec/api.md @@ -36,7 +36,7 @@ Method | Function ### L10nLoader Method | Function ------ | -------- -`load(): Promise` | +`load(): Promise` | Loads l10n services
@@ -127,7 +127,7 @@ Method | Function ### ILocaleValidation Method | Function ------ | -------- -`parseNumber(s: string): number | null` | Converts a string to a number according to default locale +`parseNumber(s: string): number | null` | Converts a string to a number according to default locale. If the string cannot be converted to a number, returns NaN
diff --git a/docs/spec/configuration.md b/docs/spec/configuration.md index be3b940a..ea1a3b3d 100644 --- a/docs/spec/configuration.md +++ b/docs/spec/configuration.md @@ -397,7 +397,7 @@ Implement `LocaleStorage` class-interface and the `read` and `write` methods: /** * This method must contain the logic to read the storage. - * @param name 'defaultLocale' or 'currency' + * @param name 'defaultLocale', 'currency' or 'timezone' * @return A promise with the value of the given name */ public async read(name: string): Promise { @@ -407,7 +407,7 @@ Implement `LocaleStorage` class-interface and the `read` and `write` methods: /** * This method must contain the logic to write the storage. - * @param name 'defaultLocale' or 'currency' + * @param name 'defaultLocale', 'currency' or 'timezone' * @param value The value for the given name */ public async write(name: string, value: string): Promise { diff --git a/docs/spec/getting-the-translation.md b/docs/spec/getting-the-translation.md index 3c97d06c..cd402c89 100644 --- a/docs/spec/getting-the-translation.md +++ b/docs/spec/getting-the-translation.md @@ -248,11 +248,11 @@ L10nCurrency | `l10nCurrency` Directive | Type | Format | Html syntax --------- | ---- | ------ | ----------- -Translate | Message | String | `expr2` -L10nDate | Date | Date/Number/ISO string | `expr2` -L10nDecimal | Decimal | Number/string | `expr2` -L10nPercent | Percentage | Number/string | `expr2` -L10nCurrency | Currency | Number/string | `expr2` +Translate | Message | String | `expr2` +L10nDate | Date | Date/Number/ISO string | `expr2` +L10nDecimal | Decimal | Number/string | `expr2` +L10nPercent | Percentage | Number/string | `expr2` +L10nCurrency | Currency | Number/string | `expr2` > You can dynamically change parameters and expressions values as with pipes. How does it work? To observe the expression change (not the parameters), a `MutationObserver` is used: the observer is added only if detected in the browser. If you want to use this feature also reaching older browsers, we recommend using pipes. @@ -267,23 +267,23 @@ L10nCurrency | Currency | Number/string | ` ##### Parameters ```Html -

User notifications

+

User notifications

```
#### Dates & Numbers ```Html

{{ today }}

-

{{ today }}

+

{{ today }}

{{ value }}

-

{{ value }}

+

{{ value }}

{{ value }}

-

{{ value }}

+

{{ value }}

{{ value }}

-

{{ value }}

+

{{ value }}

```
@@ -295,17 +295,10 @@ All attributes will be translated according to the master directive: `l10nTransl > You can't dynamically change expressions in attributes. -If you need to translate only the attributes and there isn't a master key to translate, you should use pipes: -```Html - -``` - -> Why? Because the master directive tries to find anyway a key to translate, walking the DOM: this may cause unexpected behavior if other translation directives are present in the subtree. -
##### Parameters ```Html -

User notifications

+

User notifications

``` _Json_: ``` diff --git a/docs/spec/library-structure.md b/docs/spec/library-structure.md index 0f3572f3..a8276196 100644 --- a/docs/spec/library-structure.md +++ b/docs/spec/library-structure.md @@ -34,6 +34,6 @@ Class | Contract ### Main class-interfaces Class | Contract ----- | -------- -`LocaleStorage` | Class-interface to create a custom storage for default locale & currency +`LocaleStorage` | Class-interface to create a custom storage for default locale, currency & timezone `TranslationProvider` | Class-interface to create a custom provider for translation data `TranslationHandler` | Class-interface to create a custom handler for translated values diff --git a/docs/spec/validation.md b/docs/spec/validation.md index a6f79691..5bc37ab7 100644 --- a/docs/spec/validation.md +++ b/docs/spec/validation.md @@ -24,15 +24,15 @@ Directive | Selectors Directive | Validator | Options | Errors --------- | --------- | ------- | ------ -`L10nNumberValidator` | `l10nValidateNumber=[digitInfo]` | `[minValue]` `[maxValue]` | `format` or `minValue` or `maxValue` +`L10nNumberValidator` | `digits=[digitInfo]` | `[minValue]` `[maxValue]` | `format` or `minValue` or `maxValue` where `digitInfo` has the following format: `{minIntegerDigits}.{minFractionDigits}-{maxFractionDigits}`, and `minValue` and `maxValue` attributes are optional: ```Html - + ``` or, if you use variables: ```Html - + ``` The number can be entered with or without the thousands separator.