From 6affdb520b378b743e5928c669913d7b3c40f3ff Mon Sep 17 00:00:00 2001 From: Roberto Simonetti Date: Mon, 12 Nov 2018 15:20:15 +0100 Subject: [PATCH] Update docs --- docs/index.md | 2 +- docs/spec/api.md | 2 +- docs/spec/configuration.md | 18 ++++++++++++++++++ docs/spec/lazy-loading.md | 4 ++-- package.json | 2 +- 5 files changed, 23 insertions(+), 5 deletions(-) diff --git a/docs/index.md b/docs/index.md index b1454a70..e3c2f336 100644 --- a/docs/index.md +++ b/docs/index.md @@ -10,7 +10,7 @@ It allows, in addition to translation, to localize numbers and dates of your app --- -Library version: 6.3.1 - [Changelog](https://github.com/robisim74/angular-l10n/releases) +Library version: 6.4.0 - [Changelog](https://github.com/robisim74/angular-l10n/releases) --- diff --git a/docs/spec/api.md b/docs/spec/api.md index ab9db5c9..a83ae24f 100644 --- a/docs/spec/api.md +++ b/docs/spec/api.md @@ -55,8 +55,8 @@ Method | Function `getLanguageDirection(languageCode?: string): string` | `getCurrentLanguage(): string` | `getCurrentCountry(): string` | -`getCurrentLocale(): string` | Returns the well formatted locale as {languageCode}[-scriptCode][-countryCode] `getCurrentScript(): string` | +`getCurrentLocale(): string` | Returns the well formatted locale as {languageCode}[-scriptCode][-countryCode] `getCurrentNumberingSystem(): string` | `getCurrentCalendar(): string` | `getDefaultLocale(): string` | diff --git a/docs/spec/configuration.md b/docs/spec/configuration.md index 2ac788ba..c9bc0bed 100644 --- a/docs/spec/configuration.md +++ b/docs/spec/configuration.md @@ -123,6 +123,7 @@ Property | Value `storage?: StorageStrategy` | Defines the storage to be used for language, default locale & currency `cookieExpiration?: number` | If the cookie expiration is omitted, the cookie becomes a session cookie `localizedRouting?: ISOCode[]` | Enables localized routing with the provided ISO codes +`localizedRoutingOptions?: LocalizedRoutingOptions` | Options for localized routing ### TranslationConfig Property | Value @@ -553,3 +554,20 @@ You can use the Sitemap to tell Google all of the locale variants for each URL: ``` For more info, visit [Search Console Help - International](https://support.google.com/webmasters/topic/2370587?hl=en&ref_topic=4598733) + +### Options + +#### Default routing +If you don't want a localized routing for default language or locale, you can enable it during the configuration: +```TypeScript +const l10nConfig: L10nConfig = { + locale: { + ... + localizedRouting: [ISOCode.Language, /* ISOCode.Script, */ /* ISOCode.Country */], + localizedRoutingOptions: { + defaultRouting: true + } + }, + ... +}; +``` diff --git a/docs/spec/lazy-loading.md b/docs/spec/lazy-loading.md index 21f68fce..1df6ee14 100644 --- a/docs/spec/lazy-loading.md +++ b/docs/spec/lazy-loading.md @@ -28,8 +28,8 @@ const l10nConfig: L10nConfig = { }) export class ListModule { - constructor(public l10nLoader: L10nLoader) { - this.l10nLoader.load(); + constructor(public translation: TranslationService) { + this.translation.init(); } } diff --git a/package.json b/package.json index 069ef2f3..9daf65e1 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "angular-l10n", "private": true, - "version": "6.3.1", + "version": "6.4.0", "description": "An Angular library to translate messages, dates and numbers", "main": "./bundles/angular-l10n.umd.js", "module": "./fesm5/angular-l10n.js",