Skip to content

Commit 5eb6098

Browse files
authored
Merge pull request #16904 from IgniteUI/skrastev/i18n-contribute
docs(i18n): Refer to Angular documentation on how localization works and tweak repo specific information.
2 parents 8faf924 + 68ceb92 commit 5eb6098

File tree

1 file changed

+3
-26
lines changed

1 file changed

+3
-26
lines changed

.github/CONTRIBUTING.md

Lines changed: 3 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -88,38 +88,15 @@ Accessibility is an integral part of any UI component. We as a team are committe
8888
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.
8989

9090
## 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).
9292

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).
9894

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`.
10596

10697
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.
10798
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.
10899

109-
**Example:**
110-
111-
Inside app.module you can perform:
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-
```
122-
123100
### Resource strings keys naming convention
124101
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.
125102
Example: _igx_grid_groupByArea_message_.

0 commit comments

Comments
 (0)