@taiga-ui/i18n 4.7.0 → 4.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -3,125 +3,4 @@
3
3
  [![npm version](https://img.shields.io/npm/v/@taiga-ui/i18n.svg)](https://npmjs.com/package/@taiga-ui/i18n)
4
4
  [![Discord](https://img.shields.io/discord/748677963142135818?color=7289DA&label=%23taiga-ui&logo=discord&logoColor=white)](https://discord.gg/Us8d8JVaTg)
5
5
 
6
- [Website](https://taiga-ui.dev) [Documentation](https://taiga-ui.dev/getting-started)
7
- [Core team](https://github.com/taiga-family/taiga-ui/#core-team)
8
-
9
- <!-- Do not change next line without i18n demo page -->
10
-
11
- > A package with tools for Taiga UI library i18n
12
-
13
- Supported languages:
14
-
15
- | Language | Constant name |
16
- | -------------------- | :---------------------: |
17
- | English (by default) | TUI_ENGLISH_LANGUAGE |
18
- | Russian | TUI_RUSSIAN_LANGUAGE |
19
- | Belarusian | TUI_BELARUSIAN_LANGUAGE |
20
- | Spanish | TUI_SPANISH_LANGUAGE |
21
- | German | TUI_GERMAN_LANGUAGE |
22
- | Turkish | TUI_TURKISH_LANGUAGE |
23
- | Dutch | TUI_DUTCH_LANGUAGE |
24
- | Ukrainian | TUI_UKRAINIAN_LANGUAGE |
25
- | French | TUI_FRENCH_LANGUAGE |
26
- | Vietnamese | TUI_VIETNAMESE_LANGUAGE |
27
- | Portuguese | TUI_PORTUGUESE_LANGUAGE |
28
- | Italian | TUI_ITALIAN_LANGUAGE |
29
- | Polish | TUI_POLISH_LANGUAGE |
30
- | Chinese | TUI_CHINESE_LANGUAGE |
31
-
32
- <!-- Do not change next line without i18n demo page -->
33
-
34
- It's a part of [**Taiga UI**](https://github.com/taiga-family/taiga-ui) that is fully-treeshakable Angular UI Kit
35
- consisting of multiple base libraries and several add-ons
36
-
37
- ## How to install
38
-
39
- If you have [@taiga-ui/core](https://npmjs.com/package/@taiga-ui/core) in your app, you do not need to install anything.
40
- i18n package is included as a dependency.
41
-
42
- ## How to use
43
-
44
- You have English by default.
45
-
46
- If you want to change it, you need to provide `TUI_LANGUAGE` token in your app.module:
47
-
48
- **./app.module.ts**
49
-
50
- ```ts
51
- import {TUI_LANGUAGE, TUI_RUSSIAN_LANGUAGE} from '@taiga-ui/i18n';
52
-
53
- @Component({
54
- standalone: true,
55
- // ...
56
- providers: [
57
- {
58
- provide: TUI_LANGUAGE,
59
- useValue: of(TUI_RUSSIAN_LANGUAGE),
60
- },
61
- ],
62
- })
63
- export class App {}
64
- ```
65
-
66
- You can also switch languages on the fly. Use `useFactory` or `useClass` with a service to make a stream of
67
- dictionaries.
68
-
69
- ## How to add a language
70
-
71
- Feel free to add new languages!
72
-
73
- 1. Go to `languages` folder
74
- 2. Copy `english` folder and rename new folder with the name of language you speak
75
- 3. Translate entities in files. If you need some clarification, take a look at interfaces of entities. If you need more,
76
- please write to us via issues or any other way of contact :)
77
-
78
- **./serbian/index.ts**
79
-
80
- ```ts
81
- import {TuiLanguage, TuiLanguagePreview} from '@taiga-ui/i18n';
82
- import {TUI_SERBIAN_LANGUAGE_ADDON_COMMERCE} from './addon-commerce';
83
- import {TUI_SERBIAN_LANGUAGE_ADDON_TABLE} from './addon-table';
84
- import {TUI_ENGLISH_LANGUAGE_ADDON_EDITOR} from './addon-editor';
85
- import {TUI_SERBIAN_LANGUAGE_CORE} from './core';
86
- import {TUI_SERBIAN_LANGUAGE_KIT} from './kit';
87
-
88
- const TUI_SERBIAN_LANGUAGE_PREVIEW: TuiLanguagePreview = {
89
- previewTexts: {rotate: 'rotiraj'},
90
- zoomTexts: {
91
- zoomOut: 'odzumiraj',
92
- zoomIn: 'zumiraj',
93
- reset: 'reset',
94
- },
95
- };
96
-
97
- export const TUI_SERBIAN_LANGUAGE: TuiLanguage = {
98
- ...TUI_SERBIAN_LANGUAGE_CORE,
99
- ...TUI_SERBIAN_LANGUAGE_KIT,
100
- ...TUI_SERBIAN_LANGUAGE_ADDON_TABLE,
101
- ...TUI_SERBIAN_LANGUAGE_ADDON_COMMERCE,
102
- ...TUI_ENGLISH_LANGUAGE_ADDON_EDITOR,
103
- ...TUI_SERBIAN_LANGUAGE_PREVIEW,
104
- name: 'serbian',
105
- };
106
- ```
107
-
108
- **./app.module.ts**
109
-
110
- ```ts
111
- import {TUI_LANGUAGE} from '@taiga-ui/i18n';
112
- import {TUI_SERBIAN_LANGUAGE} from './serbian';
113
-
114
- @Component({
115
- standalone: true,
116
- // ...
117
- providers: [
118
- {
119
- provide: TUI_LANGUAGE,
120
- useValue: of(TUI_SERBIAN_LANGUAGE),
121
- },
122
- ],
123
- })
124
- export class App {}
125
- ```
126
-
127
- Thank you!
6
+ [Read more about internationalization...](https://taiga-ui.dev/i18n)
@@ -1,2 +1,2 @@
1
1
  export {};
2
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibGFuZ3VhZ2UtbmFtZXMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi9wcm9qZWN0cy9pMThuL3R5cGVzL2xhbmd1YWdlLW5hbWVzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiIiLCJzb3VyY2VzQ29udGVudCI6WyJleHBvcnQgdHlwZSBUdWlMYW5ndWFnZU5hbWUgPVxuICAgIHwgJ2JlbGFydXNpYW4nXG4gICAgfCAnY2hpbmVzZSdcbiAgICB8ICdkdXRjaCdcbiAgICB8ICdlbmdsaXNoJ1xuICAgIHwgJ2ZyZW5jaCdcbiAgICB8ICdnZXJtYW4nXG4gICAgfCAnaGVicmV3J1xuICAgIHwgJ2l0YWxpYW4nXG4gICAgfCAnamFwYW4nXG4gICAgfCAna2F6YWtoJ1xuICAgIHwgJ2tvcmVhbidcbiAgICB8ICdtYWxheSdcbiAgICB8ICdwb2xpc2gnXG4gICAgfCAncG9ydHVndWVzZSdcbiAgICB8ICdydXNzaWFuJ1xuICAgIHwgJ3NwYW5pc2gnXG4gICAgfCAndHVya2lzaCdcbiAgICB8ICd1a3JhaW5pYW4nXG4gICAgfCAndmlldG5hbWVzZSdcbiAgICB8IChSZWNvcmQ8bmV2ZXIsIG5ldmVyPiAmIHN0cmluZyk7XG4iXX0=
2
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibGFuZ3VhZ2UtbmFtZXMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi9wcm9qZWN0cy9pMThuL3R5cGVzL2xhbmd1YWdlLW5hbWVzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiIiLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgdHlwZSB7VHVpTG9vc2VVbmlvbn0gZnJvbSAnQHRhaWdhLXVpL2Nkay90eXBlcyc7XG5cbmV4cG9ydCB0eXBlIFR1aUxhbmd1YWdlTmFtZSA9IFR1aUxvb3NlVW5pb248XG4gICAgfCAnYmVsYXJ1c2lhbidcbiAgICB8ICdjaGluZXNlJ1xuICAgIHwgJ2R1dGNoJ1xuICAgIHwgJ2VuZ2xpc2gnXG4gICAgfCAnZnJlbmNoJ1xuICAgIHwgJ2dlcm1hbidcbiAgICB8ICdoZWJyZXcnXG4gICAgfCAnaXRhbGlhbidcbiAgICB8ICdqYXBhbidcbiAgICB8ICdrYXpha2gnXG4gICAgfCAna29yZWFuJ1xuICAgIHwgJ21hbGF5J1xuICAgIHwgJ3BvbGlzaCdcbiAgICB8ICdwb3J0dWd1ZXNlJ1xuICAgIHwgJ3J1c3NpYW4nXG4gICAgfCAnc3BhbmlzaCdcbiAgICB8ICd0dXJraXNoJ1xuICAgIHwgJ3VrcmFpbmlhbidcbiAgICB8ICd2aWV0bmFtZXNlJ1xuPjtcbiJdfQ==
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@taiga-ui/i18n",
3
- "version": "4.7.0",
3
+ "version": "4.8.0",
4
4
  "description": "A package with tools for Taiga UI library i18n",
5
5
  "keywords": [
6
6
  "angular",
@@ -16,7 +16,7 @@
16
16
  "license": "Apache-2.0",
17
17
  "peerDependencies": {
18
18
  "@angular/core": ">=16.0.0",
19
- "@ng-web-apis/common": "^4.6.0",
19
+ "@ng-web-apis/common": "^4.6.3",
20
20
  "rxjs": ">=7.0.0"
21
21
  },
22
22
  "module": "fesm2022/taiga-ui-i18n.mjs",
@@ -1 +1,2 @@
1
- export type TuiLanguageName = 'belarusian' | 'chinese' | 'dutch' | 'english' | 'french' | 'german' | 'hebrew' | 'italian' | 'japan' | 'kazakh' | 'korean' | 'malay' | 'polish' | 'portuguese' | 'russian' | 'spanish' | 'turkish' | 'ukrainian' | 'vietnamese' | (Record<never, never> & string);
1
+ import type { TuiLooseUnion } from '@taiga-ui/cdk/types';
2
+ export type TuiLanguageName = TuiLooseUnion<'belarusian' | 'chinese' | 'dutch' | 'english' | 'french' | 'german' | 'hebrew' | 'italian' | 'japan' | 'kazakh' | 'korean' | 'malay' | 'polish' | 'portuguese' | 'russian' | 'spanish' | 'turkish' | 'ukrainian' | 'vietnamese'>;