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
Copy file name to clipboardExpand all lines: .github/CONTRIBUTING.md
+16-5Lines changed: 16 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -94,20 +94,31 @@ There are several ways to localize components' string resources:
94
94
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.
95
95
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.
96
96
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.
97
98
98
99
2. Using npm package:
99
100
We've created new repository which will hold the resource strings for languages different than English:
100
101
https://github.com/IgniteUI/igniteui-angular-i18n
101
102
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`.
103
105
104
106
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.
105
107
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
+
107
111
Inside app.module you can perform:
108
-
_import { IgxResouceStringsJA } from ‘igniteui-angular-i18n’;_
109
-
And then:
110
-
_Changei18n(IgxResouceStringsJA);_
112
+
```ts
113
+
import { IgxResouceStringsJA } from ‘igniteui-angular-i18n’;
114
+
changei18n(IgxResouceStringsJA);
115
+
```
116
+
117
+
**Example new API:**
118
+
```ts
119
+
import { ResouceStringsJA } from ‘igniteui-i18n-resources’;
120
+
registerI18n(IgxResouceStringsJA, 'ja');
121
+
```
111
122
112
123
### Resource strings keys naming convention
113
124
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.
Copy file name to clipboardExpand all lines: CHANGELOG.md
+6-1Lines changed: 6 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,7 +5,12 @@ All notable changes for each version of this project will be documented in this
5
5
6
6
## 20.1.0
7
7
### 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`
9
14
- Added cancel button to the dialog, allowing the user to cancel the selection.
0 commit comments