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
+3-26Lines changed: 3 additions & 26 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -88,38 +88,15 @@ Accessibility is an integral part of any UI component. We as a team are committe
88
88
2.`status: localized` this status is for issues that were with a pending translation status and have already been localized. Place this status label once these translation changes have been included in the current pull request, or the changes are already pulled with a different pull request.
89
89
90
90
## Localization (i18n) - applicable to components' string resources
91
-
There are several ways to localize components' string resources:
91
+
There are several ways to localize components' string resources. For more information on how it works, refer to our [Documentation - Localization (i18n)](https://www.infragistics.com/products/ignite-ui-angular/angular/components/general/localization#localization-i18n-1).
92
92
93
-
1. Using custom resource strings:
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
-
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
-
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 21.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.
93
+
**NOTE** As of 21.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`. The package `igniteui-angular-i18n` under `./projects/igniteui-angular-i18n` remains as a source of the localization resources for Ignite UI for Angular, that derives the resources from [`igniteui-i18n`](https://github.com/IgniteUI/igniteui-i18n).
98
94
99
-
2. Using npm package:
100
-
We've created new repository which will hold the resource strings for languages different than English:
101
-
https://github.com/IgniteUI/igniteui-angular-i18n
102
-
103
-
**NOTE** The localization repo has been moved to live inside the `igniteui-angular` repository under `./projects/igniteui-angular-i18n`
104
-
**NOTE** As of 21.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`.
95
+
**NOTE (21.0.x and lower)** The localization resource strings live inside the `igniteui-angular` repository under `./projects/igniteui-angular-i18n`.
105
96
106
97
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.
107
98
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.
108
99
109
-
**Example:**
110
-
111
-
Inside app.module you can perform:
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
-
```
122
-
123
100
### Resource strings keys naming convention
124
101
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.
0 commit comments