You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#### <aname="3.3.1"/>3.3.1 Using locale as language
404
+
#### <aname="3.3.1"/>3.3.1 Changing locale and currency
405
+
To change locale at runtime, call the following method:
406
+
```TypeScript
407
+
this.locale.setCurrentLocale(language, country);
408
+
```
409
+
where `language` is the two-letter or three-letter code of the new language (ISO 639) and `country` is the two-letter, uppercase code of the new country (ISO 3166).
410
+
411
+
To change currency at runtime, call the following method:
412
+
```TypeScript
413
+
this.locale.setCurrentCurrency(currency);
414
+
```
415
+
where `currency` is the three-letter code of the new currency (ISO 4217).
416
+
417
+
#### <aname="3.3.2"/>3.3.2 Option: using locale as language
441
418
You can use different countries for the same language, calling `useLocaleAsLanguage` method at initialization of the `LocalizationService`:
442
419
```TypeScript
443
420
// Adds a new language (ISO 639 two-letter or three-letter code).
@@ -462,19 +439,6 @@ locale-ar-EG.json
462
439
...
463
440
```
464
441
465
-
#### <aname="3.3.2"/>3.3.2 Changing locale and currency
466
-
To change locale at runtime, call the following method:
467
-
```TypeScript
468
-
this.locale.setCurrentLocale(language, country);
469
-
```
470
-
where `language` is the two-letter or three-letter code of the new language (ISO 639) and `country` is the two-letter, uppercase code of the new country (ISO 3166).
471
-
472
-
To change currency at runtime, call the following method:
473
-
```TypeScript
474
-
this.locale.setCurrentCurrency(currency);
475
-
```
476
-
where `currency` is the three-letter code of the new currency (ISO 4217).
477
-
478
442
## <aname="4"/>4 Default locale
479
443
The default locale contains the current language and culture. It consists of:
480
444
*`language code`: the two-letter or three-letter code of the language (ISO 639);
@@ -700,6 +664,7 @@ Finally, import `ReactiveFormsModule` in `AppModule`.
700
664
### <a name="7.1"/>7.1 LocaleService
701
665
Property | Value
702
666
---------- | -----
667
+
`defaultLocaleChanged:EventEmitter<string>;` | Output for event default locale changed
703
668
`languageCodeChanged:EventEmitter<string>;` | Output for event current language code changed
704
669
`countryCodeChanged:EventEmitter<string>;` | Output for event current country code changed
705
670
`currencyCodeChanged:EventEmitter<string>;` | Output for event current currency code changed
@@ -732,7 +697,7 @@ Method | Function
732
697
### <a name="7.2"/>7.2 LocalizationService
733
698
Property | Value
734
699
---------- | -----
735
-
`translationChanged:EventEmitter<any>;` | Output for event translation changed
700
+
`translationChanged:EventEmitter<string>;` | Output for event translation changed
736
701
`languageCode:string;` | The language code for the service
737
702
`loadingMode:LoadingMode;` | The loading mode for the service
0 commit comments