Skip to content

Commit b3d6c24

Browse files
committed
chore(*): Add changelog and mentions of locale.
1 parent b574d71 commit b3d6c24

File tree

2 files changed

+22
-6
lines changed

2 files changed

+22
-6
lines changed

.github/CONTRIBUTING.md

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -94,20 +94,31 @@ There are several ways to localize components' string resources:
9494
1.1. Localize a given instance of component - each component which supports localization has input property `resourceStrings`. Setting a newly instantiated object to this property will localize only that given component's instance.
9595
1.2. Localize all resources for a component type - each component which supports localization has input property `resourceStrings`. To localize all instances of a given component in the application the following steps should be performed - get the value of the input property `resourceStrings` of the component to be localized; do not create a new instance but replace the existing strings within the object. By default all components of a given type in an application share one instance of the resource strings. Replacing a value in that instance affects all components of that type in the application.
9696
1.3. Localize all resources for all components - use global method `getCurrentResourceStrings` to get an object containing current resource strings for all components. To provide localized resources just pass an object of type `IResourceStrings` to the global method `changei18n`.
97+
1.4 As of 20.1.x the localization has new implementation and you can use the new API `registerI18n` to register resource string for a component or all components for the whole app, as well as which locale it corresponds to. To localize a single component you will need to get is corresponding resource string keys using one of the available resources and provide only those keys.
9798

9899
2. Using npm package:
99100
We've created new repository which will hold the resource strings for languages different than English:
100101
https://github.com/IgniteUI/igniteui-angular-i18n
101102

102-
**NOTE** The localization repo has been moved to live inside the `igniteui-angular` repository under `./projects/igniteui-angular-i18n`
103+
**NOTE** The localization repo has been moved to live inside the `igniteui-angular` repository under `./projects/igniteui-angular-i18n`
104+
**NOTE** As of 20.1.x the localization resource strings have been moved to the [`igniteui-i18n`](https://github.com/IgniteUI/igniteui-i18n) repository under `projects/igniteui-i18n-resources`.
103105

104106
A npm package should be published each time we release new version of Ignite UI for Angular. Its version should correspond to the version of the igniteui-angular npm package.
105107
One could localize an application by importing the corresponding localized resource strings from the localization package (`igniteui-angular-i18n`) and use the methods described in the previous bullet to localize the whole application or part of it.
106-
Example:
108+
109+
**Example:**
110+
107111
Inside app.module you can perform:
108-
_import { IgxResouceStringsJA } from ‘igniteui-angular-i18n’;_
109-
And then:
110-
_Changei18n(IgxResouceStringsJA);_
112+
```ts
113+
import { IgxResouceStringsJA } fromigniteui-angular-i18n’;
114+
changei18n(IgxResouceStringsJA);
115+
```
116+
117+
**Example new API:**
118+
```ts
119+
import { ResouceStringsJA } fromigniteui-i18n-resources’;
120+
registerI18n(IgxResouceStringsJA, 'ja');
121+
```
111122

112123
### Resource strings keys naming convention
113124
Each key in the `IResourceStrings` (and `IGridResourceStrings`, `ITimePickerResourceStrings`, etc.) is prefixed with components' selector and followed by the resource string key. Having components' selectors as prefixes allows us to have same resource strings keys for more than one component.

CHANGELOG.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,12 @@ All notable changes for each version of this project will be documented in this
55

66
## 20.1.0
77
### New Features
8-
`IgxDateRangePicker`
8+
- `Internationalization`
9+
- Old api is being marked as deprecated but it should remain working the same without any breaking change.
10+
- New localization and locale implementation based on Intl. for all components with new public API and package named 'igniteui-i18n-resources' containing now the resources.
11+
- With the new implementation locales no longer need to be registered, only language resources for components.
12+
13+
- `IgxDateRangePicker`
914
- Added cancel button to the dialog, allowing the user to cancel the selection.
1015

1116
- `IgxCarousel`

0 commit comments

Comments
 (0)