tui-image-editor-angular3 14.0.3 → 14.0.5
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 +155 -155
- package/esm2020/lib/consts.mjs +170 -170
- package/esm2020/lib/i18n/en.mjs +129 -129
- package/esm2020/lib/i18n/nl.mjs +128 -128
- package/esm2020/lib/i18n/translation.service.mjs +40 -40
- package/esm2020/lib/interfaces/command.mjs +2 -2
- package/esm2020/lib/interfaces/history-item.mjs +343 -343
- package/esm2020/lib/interfaces/image-size.mjs +2 -2
- package/esm2020/lib/interfaces/tools-config.mjs +2 -2
- package/esm2020/lib/menus/buttons/crop/crop.component.mjs +22 -22
- package/esm2020/lib/menus/buttons/delete/delete.component.mjs +40 -40
- package/esm2020/lib/menus/buttons/delete-all/delete-all.component.mjs +27 -27
- package/esm2020/lib/menus/buttons/download/download.component.mjs +40 -40
- package/esm2020/lib/menus/buttons/drag/drag.component.mjs +41 -41
- package/esm2020/lib/menus/buttons/draw/draw.component.mjs +22 -22
- package/esm2020/lib/menus/buttons/filter/filter.component.mjs +22 -22
- package/esm2020/lib/menus/buttons/flip/flip.component.mjs +22 -22
- package/esm2020/lib/menus/buttons/history/history.component.mjs +41 -41
- package/esm2020/lib/menus/buttons/icon/icon.component.mjs +22 -22
- package/esm2020/lib/menus/buttons/load/load.component.mjs +23 -23
- package/esm2020/lib/menus/buttons/mask/mask.component.mjs +22 -22
- package/esm2020/lib/menus/buttons/redo/redo.component.mjs +36 -36
- package/esm2020/lib/menus/buttons/reset/reset.component.mjs +28 -28
- package/esm2020/lib/menus/buttons/rotate/rotate.component.mjs +22 -22
- package/esm2020/lib/menus/buttons/shape/shape.component.mjs +22 -22
- package/esm2020/lib/menus/buttons/text/text.component.mjs +22 -22
- package/esm2020/lib/menus/buttons/undo/undo.component.mjs +36 -36
- package/esm2020/lib/menus/buttons/zoom-in/zoom-in.component.mjs +45 -45
- package/esm2020/lib/menus/buttons/zoom-out/zoom-out.component.mjs +20 -20
- package/esm2020/lib/services/history.service.mjs +86 -86
- package/esm2020/lib/services/tools.config-manager.service.mjs +45 -45
- package/esm2020/lib/submenus/crop/crop.component.mjs +76 -76
- package/esm2020/lib/submenus/draw/draw.component.mjs +149 -149
- package/esm2020/lib/submenus/filter/filter.component.mjs +345 -345
- package/esm2020/lib/submenus/flip/flip.component.mjs +39 -39
- package/esm2020/lib/submenus/icon/icon.component.mjs +119 -119
- package/esm2020/lib/submenus/mask/mask.component.mjs +69 -69
- package/esm2020/lib/submenus/rotate/rotate.component.mjs +57 -57
- package/esm2020/lib/submenus/shape/shape.component.mjs +163 -163
- package/esm2020/lib/submenus/text/text.component.mjs +175 -175
- package/esm2020/lib/svg-definitions/svg-definitions.component.mjs +12 -12
- package/esm2020/lib/tui-image-editor.component.mjs +296 -294
- package/esm2020/lib/tui-image-editor.module.mjs +136 -136
- package/esm2020/lib/utils.mjs +173 -173
- package/esm2020/public-api.mjs +8 -8
- package/esm2020/tui-image-editor-angular3.mjs +4 -4
- package/fesm2015/tui-image-editor-angular3.mjs +3064 -3062
- package/fesm2015/tui-image-editor-angular3.mjs.map +1 -1
- package/fesm2020/tui-image-editor-angular3.mjs +3025 -3023
- package/fesm2020/tui-image-editor-angular3.mjs.map +1 -1
- package/index.d.ts +5 -5
- package/lib/consts.d.ts +144 -144
- package/lib/i18n/en.d.ts +128 -128
- package/lib/i18n/nl.d.ts +127 -127
- package/lib/i18n/translation.service.d.ts +14 -14
- package/lib/interfaces/command.d.ts +4 -4
- package/lib/interfaces/history-item.d.ts +26 -26
- package/lib/interfaces/image-size.d.ts +6 -6
- package/lib/interfaces/tools-config.d.ts +14 -14
- package/lib/menus/buttons/crop/crop.component.d.ts +10 -10
- package/lib/menus/buttons/delete/delete.component.d.ts +13 -13
- package/lib/menus/buttons/delete-all/delete-all.component.d.ts +11 -11
- package/lib/menus/buttons/download/download.component.d.ts +9 -9
- package/lib/menus/buttons/drag/drag.component.d.ts +11 -11
- package/lib/menus/buttons/draw/draw.component.d.ts +10 -10
- package/lib/menus/buttons/filter/filter.component.d.ts +10 -10
- package/lib/menus/buttons/flip/flip.component.d.ts +10 -10
- package/lib/menus/buttons/history/history.component.d.ts +13 -13
- package/lib/menus/buttons/icon/icon.component.d.ts +10 -10
- package/lib/menus/buttons/load/load.component.d.ts +9 -9
- package/lib/menus/buttons/mask/mask.component.d.ts +10 -10
- package/lib/menus/buttons/redo/redo.component.d.ts +12 -12
- package/lib/menus/buttons/reset/reset.component.d.ts +12 -12
- package/lib/menus/buttons/rotate/rotate.component.d.ts +10 -10
- package/lib/menus/buttons/shape/shape.component.d.ts +10 -10
- package/lib/menus/buttons/text/text.component.d.ts +10 -10
- package/lib/menus/buttons/undo/undo.component.d.ts +12 -12
- package/lib/menus/buttons/zoom-in/zoom-in.component.d.ts +12 -12
- package/lib/menus/buttons/zoom-out/zoom-out.component.d.ts +9 -9
- package/lib/services/history.service.d.ts +45 -45
- package/lib/services/tools.config-manager.service.d.ts +12 -12
- package/lib/submenus/crop/crop.component.d.ts +23 -23
- package/lib/submenus/draw/draw.component.d.ts +32 -32
- package/lib/submenus/filter/filter.component.d.ts +70 -70
- package/lib/submenus/flip/flip.component.d.ts +10 -10
- package/lib/submenus/icon/icon.component.d.ts +24 -24
- package/lib/submenus/mask/mask.component.d.ts +16 -16
- package/lib/submenus/rotate/rotate.component.d.ts +12 -12
- package/lib/submenus/shape/shape.component.d.ts +31 -31
- package/lib/submenus/text/text.component.d.ts +31 -31
- package/lib/svg-definitions/svg-definitions.component.d.ts +6 -6
- package/lib/tui-image-editor.component.d.ts +71 -71
- package/lib/tui-image-editor.module.d.ts +48 -48
- package/lib/utils.d.ts +45 -45
- package/package.json +1 -1
- package/public-api.d.ts +4 -4
- package/src/checkboxes.scss +95 -95
- package/src/theme.scss +936 -936
- package/esm2020/tui-image-editor-angular2.mjs +0 -5
- package/fesm2015/tui-image-editor-angular2.mjs +0 -5445
- package/fesm2015/tui-image-editor-angular2.mjs.map +0 -1
- package/fesm2020/tui-image-editor-angular2.mjs +0 -5122
- package/fesm2020/tui-image-editor-angular2.mjs.map +0 -1
- package/lib/consts.d.ts.map +0 -1
- package/lib/i18n/en.d.ts.map +0 -1
- package/lib/i18n/nl.d.ts.map +0 -1
- package/lib/i18n/translation.service.d.ts.map +0 -1
- package/lib/interfaces/command.d.ts.map +0 -1
- package/lib/interfaces/history-item.d.ts.map +0 -1
- package/lib/interfaces/image-size.d.ts.map +0 -1
- package/lib/interfaces/tools-config.d.ts.map +0 -1
- package/lib/menus/buttons/crop/crop.component.d.ts.map +0 -1
- package/lib/menus/buttons/delete/delete.component.d.ts.map +0 -1
- package/lib/menus/buttons/delete-all/delete-all.component.d.ts.map +0 -1
- package/lib/menus/buttons/download/download.component.d.ts.map +0 -1
- package/lib/menus/buttons/drag/drag.component.d.ts.map +0 -1
- package/lib/menus/buttons/draw/draw.component.d.ts.map +0 -1
- package/lib/menus/buttons/filter/filter.component.d.ts.map +0 -1
- package/lib/menus/buttons/flip/flip.component.d.ts.map +0 -1
- package/lib/menus/buttons/history/history.component.d.ts.map +0 -1
- package/lib/menus/buttons/icon/icon.component.d.ts.map +0 -1
- package/lib/menus/buttons/load/load.component.d.ts.map +0 -1
- package/lib/menus/buttons/mask/mask.component.d.ts.map +0 -1
- package/lib/menus/buttons/redo/redo.component.d.ts.map +0 -1
- package/lib/menus/buttons/reset/reset.component.d.ts.map +0 -1
- package/lib/menus/buttons/rotate/rotate.component.d.ts.map +0 -1
- package/lib/menus/buttons/shape/shape.component.d.ts.map +0 -1
- package/lib/menus/buttons/text/text.component.d.ts.map +0 -1
- package/lib/menus/buttons/undo/undo.component.d.ts.map +0 -1
- package/lib/menus/buttons/zoom-in/zoom-in.component.d.ts.map +0 -1
- package/lib/menus/buttons/zoom-out/zoom-out.component.d.ts.map +0 -1
- package/lib/services/history.service.d.ts.map +0 -1
- package/lib/services/tools.config-manager.service.d.ts.map +0 -1
- package/lib/submenus/crop/crop.component.d.ts.map +0 -1
- package/lib/submenus/draw/draw.component.d.ts.map +0 -1
- package/lib/submenus/filter/filter.component.d.ts.map +0 -1
- package/lib/submenus/flip/flip.component.d.ts.map +0 -1
- package/lib/submenus/icon/icon.component.d.ts.map +0 -1
- package/lib/submenus/mask/mask.component.d.ts.map +0 -1
- package/lib/submenus/rotate/rotate.component.d.ts.map +0 -1
- package/lib/submenus/shape/shape.component.d.ts.map +0 -1
- package/lib/submenus/text/text.component.d.ts.map +0 -1
- package/lib/svg-definitions/svg-definitions.component.d.ts.map +0 -1
- package/lib/tui-image-editor.component.d.ts.map +0 -1
- package/lib/tui-image-editor.module.d.ts.map +0 -1
- package/lib/utils.d.ts.map +0 -1
- package/public-api.d.ts.map +0 -1
- package/tui-image-editor-angular2.d.ts.map +0 -1
package/README.md
CHANGED
|
@@ -1,155 +1,155 @@
|
|
|
1
|
-
# Angular-Tui
|
|
2
|
-
|
|
3
|
-
Based on the UI component of [tui.image-editor](https://github.com/nhn/tui.image-editor).
|
|
4
|
-
|
|
5
|
-
## 💾 Install
|
|
6
|
-
*Note: this library only worked with Angular 11.2.0 up to version 0.0.15*
|
|
7
|
-
<br>
|
|
8
|
-
*Starting from Angular 14 we follow standard Angular version numbering, i.e. library version Y.x.x targets Angular Y.*
|
|
9
|
-
|
|
10
|
-
```sh
|
|
11
|
-
npm install --save tui-image-editor-angular2
|
|
12
|
-
```
|
|
13
|
-
|
|
14
|
-
Add needed package to NgModule imports:
|
|
15
|
-
```sh
|
|
16
|
-
import { TuiImageEditorModule } from 'tui-image-editor-angular2';
|
|
17
|
-
|
|
18
|
-
@NgModule({
|
|
19
|
-
...
|
|
20
|
-
imports: [TuiImageEditorModule,...]
|
|
21
|
-
...
|
|
22
|
-
})
|
|
23
|
-
```
|
|
24
|
-
|
|
25
|
-
Import css:
|
|
26
|
-
```scss
|
|
27
|
-
@import "tui-image-editor-angular2/src/theme.scss";
|
|
28
|
-
|
|
29
|
-
...
|
|
30
|
-
```
|
|
31
|
-
|
|
32
|
-
## 📊 Usage
|
|
33
|
-
Place the following component somewhere on the page.
|
|
34
|
-
It only needs to be defined once, for example inside your app.component.html file.
|
|
35
|
-
|
|
36
|
-
```html
|
|
37
|
-
<tui-image-editor-svg-definitions></tui-image-editor-svg-definitions>
|
|
38
|
-
```
|
|
39
|
-
|
|
40
|
-
<hr>
|
|
41
|
-
|
|
42
|
-
[ngx-color-picker](https://github.com/zefoy/ngx-color-picker) requires exposing a ViewContainerRef so it can calculate the area/page's width/height correctly where it can/will be displayed.<br>*Note that if you don't do this, it'll still work, but the color-picker dialog may end up outside of your page's bounds.*
|
|
43
|
-
|
|
44
|
-
```
|
|
45
|
-
[cpUseRootViewContainer] // Create dialog component in the root view container (false).
|
|
46
|
-
// Note: The root component needs to have public viewContainerRef.
|
|
47
|
-
```
|
|
48
|
-
|
|
49
|
-
This can be done like the documentation says by adding a public ViewContainerRef to your app's root component like so.
|
|
50
|
-
|
|
51
|
-
```
|
|
52
|
-
@Component({
|
|
53
|
-
selector: 'app-root',
|
|
54
|
-
templateUrl: './app.component.html',
|
|
55
|
-
styleUrls: ['./app.component.scss']
|
|
56
|
-
})
|
|
57
|
-
export class AppComponent {
|
|
58
|
-
constructor(public vcRef: ViewContainerRef) {
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
```
|
|
62
|
-
|
|
63
|
-
<hr>
|
|
64
|
-
|
|
65
|
-
You should then be able to use the image editor component inside any component.
|
|
66
|
-
```html
|
|
67
|
-
<tui-image-editor></tui-image-editor>
|
|
68
|
-
```
|
|
69
|
-
|
|
70
|
-
```js
|
|
71
|
-
@Component({
|
|
72
|
-
selector: 'tui-image-editor'
|
|
73
|
-
})
|
|
74
|
-
export class TuiImageEditorComponent{
|
|
75
|
-
@Input() options: {
|
|
76
|
-
usageStatistics: boolean;
|
|
77
|
-
selectionStyle?: {
|
|
78
|
-
cornerStyle: string;
|
|
79
|
-
cornerSize: number;
|
|
80
|
-
cornerColor: string;
|
|
81
|
-
cornerStrokeColor: string;
|
|
82
|
-
transparentCorners: boolean;
|
|
83
|
-
lineWidth: number;
|
|
84
|
-
borderColor: string;
|
|
85
|
-
rotatingPointOffset: number;
|
|
86
|
-
};
|
|
87
|
-
applyCropSelectionStyle: boolean;
|
|
88
|
-
applyGroupSelectionStyle: boolean;
|
|
89
|
-
} = {
|
|
90
|
-
usageStatistics: false,
|
|
91
|
-
selectionStyle: {
|
|
92
|
-
cornerStyle: 'circle',
|
|
93
|
-
cornerSize: 32,
|
|
94
|
-
cornerColor: '#fff',
|
|
95
|
-
cornerStrokeColor: '#fff',
|
|
96
|
-
transparentCorners: false,
|
|
97
|
-
lineWidth: 4,
|
|
98
|
-
borderColor: '#fff',
|
|
99
|
-
rotatingPointOffset: 500
|
|
100
|
-
},
|
|
101
|
-
applyCropSelectionStyle: true,
|
|
102
|
-
applyGroupSelectionStyle: true,
|
|
103
|
-
};
|
|
104
|
-
@Input() initialImage: string | File;
|
|
105
|
-
|
|
106
|
-
...
|
|
107
|
-
}
|
|
108
|
-
```
|
|
109
|
-
|
|
110
|
-
## Dependencies
|
|
111
|
-
This library currently depends on the following libraries:
|
|
112
|
-
- [@ng-bootstrap/ng-bootstrap](https://ng-bootstrap.github.io/) for the [popover](https://ng-bootstrap.github.io/#/components/popover/examples) component.
|
|
113
|
-
- [ngx-color-picker](https://www.npmjs.com/package/ngx-color-picker) for choosing the colors of certain elements.
|
|
114
|
-
- [tui-image-editor](https://www.npmjs.com/package/tui-image-editor)
|
|
115
|
-
|
|
116
|
-
## Translations
|
|
117
|
-
Currently, I've only supplied English and Dutch translations.
|
|
118
|
-
You can however supply your own translations, or override mine like so:
|
|
119
|
-
|
|
120
|
-
```js
|
|
121
|
-
import { TranslationService } from 'tui-image-editor-angular2';
|
|
122
|
-
import { fr } from './i18n/fr';
|
|
123
|
-
import { de } from './i18n/de';
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
@Component({
|
|
127
|
-
selector: 'app-root',
|
|
128
|
-
templateUrl: './app.component.html',
|
|
129
|
-
styleUrls: ['./app.component.scss'],
|
|
130
|
-
})
|
|
131
|
-
export class AppComponent {
|
|
132
|
-
private availableLanguages = { fr, de };
|
|
133
|
-
|
|
134
|
-
constructor(private translateService: TranslationService) {
|
|
135
|
-
Object.keys(this.availableLanguages).forEach((language) => {
|
|
136
|
-
translateService.loadCustomMessages(language, this.availableLanguages[language]);
|
|
137
|
-
});
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
...
|
|
141
|
-
}
|
|
142
|
-
```
|
|
143
|
-
|
|
144
|
-
fr.ts file example:
|
|
145
|
-
|
|
146
|
-
```js
|
|
147
|
-
export const fr = {
|
|
148
|
-
'tui-image-editor-angular-menus-buttons-crop-tooltip': 'Recadrer',
|
|
149
|
-
'tui-image-editor-angular-menus-buttons-delete': 'Supprimer',
|
|
150
|
-
'tui-image-editor-angular-menus-buttons-deleteAll': 'Tout supprimer'
|
|
151
|
-
...
|
|
152
|
-
}
|
|
153
|
-
```
|
|
154
|
-
|
|
155
|
-
Take a look at my [en.ts](src/lib/i18n/en.ts) file to see which strings you can/should use/override.
|
|
1
|
+
# Angular-Tui
|
|
2
|
+
|
|
3
|
+
Based on the UI component of [tui.image-editor](https://github.com/nhn/tui.image-editor).
|
|
4
|
+
|
|
5
|
+
## 💾 Install
|
|
6
|
+
*Note: this library only worked with Angular 11.2.0 up to version 0.0.15*
|
|
7
|
+
<br>
|
|
8
|
+
*Starting from Angular 14 we follow standard Angular version numbering, i.e. library version Y.x.x targets Angular Y.*
|
|
9
|
+
|
|
10
|
+
```sh
|
|
11
|
+
npm install --save tui-image-editor-angular2
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
Add needed package to NgModule imports:
|
|
15
|
+
```sh
|
|
16
|
+
import { TuiImageEditorModule } from 'tui-image-editor-angular2';
|
|
17
|
+
|
|
18
|
+
@NgModule({
|
|
19
|
+
...
|
|
20
|
+
imports: [TuiImageEditorModule,...]
|
|
21
|
+
...
|
|
22
|
+
})
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
Import css:
|
|
26
|
+
```scss
|
|
27
|
+
@import "tui-image-editor-angular2/src/theme.scss";
|
|
28
|
+
|
|
29
|
+
...
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## 📊 Usage
|
|
33
|
+
Place the following component somewhere on the page.
|
|
34
|
+
It only needs to be defined once, for example inside your app.component.html file.
|
|
35
|
+
|
|
36
|
+
```html
|
|
37
|
+
<tui-image-editor-svg-definitions></tui-image-editor-svg-definitions>
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
<hr>
|
|
41
|
+
|
|
42
|
+
[ngx-color-picker](https://github.com/zefoy/ngx-color-picker) requires exposing a ViewContainerRef so it can calculate the area/page's width/height correctly where it can/will be displayed.<br>*Note that if you don't do this, it'll still work, but the color-picker dialog may end up outside of your page's bounds.*
|
|
43
|
+
|
|
44
|
+
```
|
|
45
|
+
[cpUseRootViewContainer] // Create dialog component in the root view container (false).
|
|
46
|
+
// Note: The root component needs to have public viewContainerRef.
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
This can be done like the documentation says by adding a public ViewContainerRef to your app's root component like so.
|
|
50
|
+
|
|
51
|
+
```
|
|
52
|
+
@Component({
|
|
53
|
+
selector: 'app-root',
|
|
54
|
+
templateUrl: './app.component.html',
|
|
55
|
+
styleUrls: ['./app.component.scss']
|
|
56
|
+
})
|
|
57
|
+
export class AppComponent {
|
|
58
|
+
constructor(public vcRef: ViewContainerRef) {
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
<hr>
|
|
64
|
+
|
|
65
|
+
You should then be able to use the image editor component inside any component.
|
|
66
|
+
```html
|
|
67
|
+
<tui-image-editor></tui-image-editor>
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
```js
|
|
71
|
+
@Component({
|
|
72
|
+
selector: 'tui-image-editor'
|
|
73
|
+
})
|
|
74
|
+
export class TuiImageEditorComponent{
|
|
75
|
+
@Input() options: {
|
|
76
|
+
usageStatistics: boolean;
|
|
77
|
+
selectionStyle?: {
|
|
78
|
+
cornerStyle: string;
|
|
79
|
+
cornerSize: number;
|
|
80
|
+
cornerColor: string;
|
|
81
|
+
cornerStrokeColor: string;
|
|
82
|
+
transparentCorners: boolean;
|
|
83
|
+
lineWidth: number;
|
|
84
|
+
borderColor: string;
|
|
85
|
+
rotatingPointOffset: number;
|
|
86
|
+
};
|
|
87
|
+
applyCropSelectionStyle: boolean;
|
|
88
|
+
applyGroupSelectionStyle: boolean;
|
|
89
|
+
} = {
|
|
90
|
+
usageStatistics: false,
|
|
91
|
+
selectionStyle: {
|
|
92
|
+
cornerStyle: 'circle',
|
|
93
|
+
cornerSize: 32,
|
|
94
|
+
cornerColor: '#fff',
|
|
95
|
+
cornerStrokeColor: '#fff',
|
|
96
|
+
transparentCorners: false,
|
|
97
|
+
lineWidth: 4,
|
|
98
|
+
borderColor: '#fff',
|
|
99
|
+
rotatingPointOffset: 500
|
|
100
|
+
},
|
|
101
|
+
applyCropSelectionStyle: true,
|
|
102
|
+
applyGroupSelectionStyle: true,
|
|
103
|
+
};
|
|
104
|
+
@Input() initialImage: string | File;
|
|
105
|
+
|
|
106
|
+
...
|
|
107
|
+
}
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
## Dependencies
|
|
111
|
+
This library currently depends on the following libraries:
|
|
112
|
+
- [@ng-bootstrap/ng-bootstrap](https://ng-bootstrap.github.io/) for the [popover](https://ng-bootstrap.github.io/#/components/popover/examples) component.
|
|
113
|
+
- [ngx-color-picker](https://www.npmjs.com/package/ngx-color-picker) for choosing the colors of certain elements.
|
|
114
|
+
- [tui-image-editor](https://www.npmjs.com/package/tui-image-editor)
|
|
115
|
+
|
|
116
|
+
## Translations
|
|
117
|
+
Currently, I've only supplied English and Dutch translations.
|
|
118
|
+
You can however supply your own translations, or override mine like so:
|
|
119
|
+
|
|
120
|
+
```js
|
|
121
|
+
import { TranslationService } from 'tui-image-editor-angular2';
|
|
122
|
+
import { fr } from './i18n/fr';
|
|
123
|
+
import { de } from './i18n/de';
|
|
124
|
+
|
|
125
|
+
|
|
126
|
+
@Component({
|
|
127
|
+
selector: 'app-root',
|
|
128
|
+
templateUrl: './app.component.html',
|
|
129
|
+
styleUrls: ['./app.component.scss'],
|
|
130
|
+
})
|
|
131
|
+
export class AppComponent {
|
|
132
|
+
private availableLanguages = { fr, de };
|
|
133
|
+
|
|
134
|
+
constructor(private translateService: TranslationService) {
|
|
135
|
+
Object.keys(this.availableLanguages).forEach((language) => {
|
|
136
|
+
translateService.loadCustomMessages(language, this.availableLanguages[language]);
|
|
137
|
+
});
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
...
|
|
141
|
+
}
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
fr.ts file example:
|
|
145
|
+
|
|
146
|
+
```js
|
|
147
|
+
export const fr = {
|
|
148
|
+
'tui-image-editor-angular-menus-buttons-crop-tooltip': 'Recadrer',
|
|
149
|
+
'tui-image-editor-angular-menus-buttons-delete': 'Supprimer',
|
|
150
|
+
'tui-image-editor-angular-menus-buttons-deleteAll': 'Tout supprimer'
|
|
151
|
+
...
|
|
152
|
+
}
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
Take a look at my [en.ts](src/lib/i18n/en.ts) file to see which strings you can/should use/override.
|