Browse Source

docs(angular): use better examples

pull/3072/head
TheDiaval 7 years ago
parent
commit
f7c6c6f707
  1. 10
      docs/en/Angular/Localization/Index.md

10
docs/en/Angular/Localization/Index.md

@ -85,16 +85,16 @@ After that, you are able to use localization service.
> You can add interpolation parameters as arguments to `instant()` and `get()` methods. > You can add interpolation parameters as arguments to `instant()` and `get()` methods.
```ts ```ts
this.localizationService.instant('AbpIdentity::UserDeletionConfirmation', 'UserName'); this.localizationService.instant('AbpIdentity::UserDeletionConfirmation', 'John');
// with fallback value // with fallback value
this.localizationService.instant( this.localizationService.instant(
{ key: 'AbpIdentity::UserDeletionConfirmation', defaultValue: 'Default Value' }, { key: 'AbpIdentity::UserDeletionConfirmation', defaultValue: 'Default Value' },
'UserName', 'John',
); );
// Output // Output
// User 'UserName' will be deleted. Do you confirm that? // User 'John' will be deleted. Do you confirm that?
``` ```
To get a localized text as [_Observable_](https://rxjs.dev/guide/observable) use `get` method instead of `instant`: To get a localized text as [_Observable_](https://rxjs.dev/guide/observable) use `get` method instead of `instant`:
@ -126,10 +126,10 @@ this.store.selectSnapshot(ConfigState.getLocalization('ResourceName::Key'));
this.store.selectSnapshot( this.store.selectSnapshot(
ConfigState.getLocalization( ConfigState.getLocalization(
{ {
key: 'ResourceName::Key', key: 'AbpIdentity::UserDeletionConfirmation',
defaultValue: 'Default Value', defaultValue: 'Default Value',
}, },
...interpolationParameters, 'John',
), ),
); );
``` ```

Loading…
Cancel
Save