@tolgee/ngx 2.0.0 → 2.7.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 +2 -3
- package/esm2020/lib/ngx-tolgee.module.mjs +42 -0
- package/esm2020/lib/stranslate.pipe.mjs +22 -0
- package/esm2020/lib/t.component.mjs +55 -0
- package/{esm2015/lib/tolgeeConfig.js → esm2020/lib/tolgeeConfig.mjs} +0 -0
- package/esm2020/lib/translate.pipe.mjs +55 -0
- package/esm2020/lib/translate.service.mjs +67 -0
- package/esm2020/lib/translations-provider.mjs +17 -0
- package/{esm2015/public-api.js → esm2020/public-api.mjs} +0 -0
- package/{esm2015/tolgee-ngx.js → esm2020/tolgee-ngx.mjs} +0 -0
- package/fesm2015/{tolgee-ngx.js → tolgee-ngx.mjs} +57 -54
- package/fesm2015/tolgee-ngx.mjs.map +1 -0
- package/fesm2020/tolgee-ngx.mjs +247 -0
- package/fesm2020/tolgee-ngx.mjs.map +1 -0
- package/lib/ngx-tolgee.module.d.ts +7 -0
- package/lib/stranslate.pipe.d.ts +3 -0
- package/lib/t.component.d.ts +3 -0
- package/lib/translate.pipe.d.ts +3 -0
- package/lib/translate.service.d.ts +3 -0
- package/lib/translations-provider.d.ts +3 -0
- package/package.json +24 -11
- package/tolgee-ngx.d.ts +1 -0
- package/bundles/tolgee-ngx.umd.js +0 -651
- package/bundles/tolgee-ngx.umd.js.map +0 -1
- package/esm2015/lib/ngx-tolgee.module.js +0 -38
- package/esm2015/lib/stranslate.pipe.js +0 -21
- package/esm2015/lib/t.component.js +0 -55
- package/esm2015/lib/translate.pipe.js +0 -55
- package/esm2015/lib/translate.service.js +0 -73
- package/esm2015/lib/translations-provider.js +0 -20
- package/fesm2015/tolgee-ngx.js.map +0 -1
- package/tolgee-ngx.metadata.json +0 -1
|
@@ -0,0 +1,247 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { EventEmitter, Injectable, Pipe, Component, Input, APP_INITIALIZER, NgModule } from '@angular/core';
|
|
3
|
+
import { from } from 'rxjs';
|
|
4
|
+
import { Tolgee, TolgeeConfig, TOLGEE_WRAPPED_ONLY_DATA_ATTRIBUTE } from '@tolgee/core';
|
|
5
|
+
export { TolgeeConfig } from '@tolgee/core';
|
|
6
|
+
|
|
7
|
+
class TranslateService {
|
|
8
|
+
constructor(config) {
|
|
9
|
+
this.config = config;
|
|
10
|
+
this.onLangChange = new EventEmitter();
|
|
11
|
+
this.onTranslationChange = new EventEmitter();
|
|
12
|
+
}
|
|
13
|
+
get tolgee() {
|
|
14
|
+
return this._tolgee;
|
|
15
|
+
}
|
|
16
|
+
async start(config) {
|
|
17
|
+
if (!this.runPromise) {
|
|
18
|
+
this._tolgee = new Tolgee(config);
|
|
19
|
+
this.runPromise = this.tolgee.run();
|
|
20
|
+
this.unsubscribeCoreListeners();
|
|
21
|
+
this.onTranslationChangeCoreSubscription =
|
|
22
|
+
this._tolgee.onTranslationChange.subscribe((data) => {
|
|
23
|
+
this.onTranslationChange.emit(data);
|
|
24
|
+
});
|
|
25
|
+
this.onLangChangeCoreSubscription = this._tolgee.onLangChange.subscribe(() => {
|
|
26
|
+
this.onLangChange.emit();
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
await this.runPromise;
|
|
30
|
+
}
|
|
31
|
+
ngOnDestroy() {
|
|
32
|
+
this.tolgee.stop();
|
|
33
|
+
this.unsubscribeCoreListeners();
|
|
34
|
+
}
|
|
35
|
+
setLang(lang) {
|
|
36
|
+
this.tolgee.lang = lang;
|
|
37
|
+
}
|
|
38
|
+
get(input, params = {}, defaultValue) {
|
|
39
|
+
return from(this.translate(input, params, false, defaultValue));
|
|
40
|
+
}
|
|
41
|
+
getSafe(input, params = {}, defaultValue) {
|
|
42
|
+
return from(this.translate(input, params, true, defaultValue));
|
|
43
|
+
}
|
|
44
|
+
instant(input, params = {}, defaultValue) {
|
|
45
|
+
return this.tolgee.instant(input, params, undefined, undefined, defaultValue);
|
|
46
|
+
}
|
|
47
|
+
instantSafe(input, params = {}, defaultValue) {
|
|
48
|
+
return this.tolgee.instant(input, params, true, undefined, defaultValue);
|
|
49
|
+
}
|
|
50
|
+
getCurrentLang() {
|
|
51
|
+
return this.tolgee.lang;
|
|
52
|
+
}
|
|
53
|
+
unsubscribeCoreListeners() {
|
|
54
|
+
this.onTranslationChangeCoreSubscription?.unsubscribe();
|
|
55
|
+
this.onLangChangeCoreSubscription?.unsubscribe();
|
|
56
|
+
}
|
|
57
|
+
async translate(input, params = {}, noWrap = false, defaultValue) {
|
|
58
|
+
//wait for start before translating
|
|
59
|
+
await this.start(this.config);
|
|
60
|
+
return await this.tolgee.translate(input, params, noWrap, defaultValue);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
TranslateService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.0", ngImport: i0, type: TranslateService, deps: [{ token: TolgeeConfig }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
64
|
+
TranslateService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.0.0", ngImport: i0, type: TranslateService });
|
|
65
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.0", ngImport: i0, type: TranslateService, decorators: [{
|
|
66
|
+
type: Injectable
|
|
67
|
+
}], ctorParameters: function () { return [{ type: TolgeeConfig }]; } });
|
|
68
|
+
|
|
69
|
+
class TranslatePipe {
|
|
70
|
+
constructor(translateService) {
|
|
71
|
+
this.translateService = translateService;
|
|
72
|
+
this.value = '';
|
|
73
|
+
}
|
|
74
|
+
get resultProvider() {
|
|
75
|
+
return (input, params, defaultValue) => this.translateService.get(input, params, defaultValue);
|
|
76
|
+
}
|
|
77
|
+
ngOnDestroy() {
|
|
78
|
+
this.langChangeSubscription.unsubscribe();
|
|
79
|
+
}
|
|
80
|
+
transform(input, paramsOrDefaultValue, params) {
|
|
81
|
+
if (!input || input.length === 0) {
|
|
82
|
+
return input;
|
|
83
|
+
}
|
|
84
|
+
const defaultValue = typeof paramsOrDefaultValue !== 'object'
|
|
85
|
+
? paramsOrDefaultValue
|
|
86
|
+
: undefined;
|
|
87
|
+
if (typeof paramsOrDefaultValue === 'object') {
|
|
88
|
+
params = paramsOrDefaultValue;
|
|
89
|
+
}
|
|
90
|
+
const newHash = this.getHash(input, params, this.translateService.getCurrentLang());
|
|
91
|
+
if (newHash === this.lastHash) {
|
|
92
|
+
return this.value;
|
|
93
|
+
}
|
|
94
|
+
this.langChangeSubscription?.unsubscribe();
|
|
95
|
+
this.langChangeSubscription = this.translateService.onLangChange.subscribe(() => {
|
|
96
|
+
this.onLangChange(input, params, defaultValue);
|
|
97
|
+
});
|
|
98
|
+
this.onLangChange(input, params, defaultValue);
|
|
99
|
+
this.lastHash = newHash;
|
|
100
|
+
return this.value;
|
|
101
|
+
}
|
|
102
|
+
getHash(input, params, language) {
|
|
103
|
+
return JSON.stringify({ input, params, language });
|
|
104
|
+
}
|
|
105
|
+
onLangChange(input, params, defaultValue) {
|
|
106
|
+
this.resultProvider(input, params, defaultValue).subscribe((r) => {
|
|
107
|
+
this.value = r;
|
|
108
|
+
});
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
TranslatePipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.0", ngImport: i0, type: TranslatePipe, deps: [{ token: TranslateService }], target: i0.ɵɵFactoryTarget.Pipe });
|
|
112
|
+
TranslatePipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.0.0", ngImport: i0, type: TranslatePipe, name: "translate", pure: false });
|
|
113
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.0", ngImport: i0, type: TranslatePipe, decorators: [{
|
|
114
|
+
type: Pipe,
|
|
115
|
+
args: [{
|
|
116
|
+
name: 'translate',
|
|
117
|
+
pure: false,
|
|
118
|
+
}]
|
|
119
|
+
}], ctorParameters: function () { return [{ type: TranslateService }]; } });
|
|
120
|
+
|
|
121
|
+
class STranslatePipe extends TranslatePipe {
|
|
122
|
+
constructor(translateService) {
|
|
123
|
+
super(translateService);
|
|
124
|
+
}
|
|
125
|
+
get resultProvider() {
|
|
126
|
+
return (input, params, defaultValue) => this.translateService.getSafe(input, params, defaultValue);
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
STranslatePipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.0", ngImport: i0, type: STranslatePipe, deps: [{ token: TranslateService }], target: i0.ɵɵFactoryTarget.Pipe });
|
|
130
|
+
STranslatePipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.0.0", ngImport: i0, type: STranslatePipe, name: "stranslate", pure: false });
|
|
131
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.0", ngImport: i0, type: STranslatePipe, decorators: [{
|
|
132
|
+
type: Pipe,
|
|
133
|
+
args: [{
|
|
134
|
+
name: 'stranslate',
|
|
135
|
+
pure: false,
|
|
136
|
+
}]
|
|
137
|
+
}], ctorParameters: function () { return [{ type: TranslateService }]; } });
|
|
138
|
+
|
|
139
|
+
class TComponent {
|
|
140
|
+
constructor(ref, translateService) {
|
|
141
|
+
this.ref = ref;
|
|
142
|
+
this.translateService = translateService;
|
|
143
|
+
}
|
|
144
|
+
get resultProvider() {
|
|
145
|
+
return (key, params, defaultValue) => this.translateService.getSafe(key, params, defaultValue);
|
|
146
|
+
}
|
|
147
|
+
ngOnInit() {
|
|
148
|
+
const element = this.ref.nativeElement;
|
|
149
|
+
element.setAttribute(TOLGEE_WRAPPED_ONLY_DATA_ATTRIBUTE, this.key);
|
|
150
|
+
//update value when language changed
|
|
151
|
+
this.onLangChangeSubscription =
|
|
152
|
+
this.translateService.onLangChange.subscribe(() => {
|
|
153
|
+
this.translate(this.key, this.params, this.default);
|
|
154
|
+
});
|
|
155
|
+
//update value when translation changed
|
|
156
|
+
this.onTranslationChangeSubscription =
|
|
157
|
+
this.translateService.onTranslationChange.subscribe((data) => {
|
|
158
|
+
if (data.key == this.key) {
|
|
159
|
+
this.translate(this.key, this.params, this.default);
|
|
160
|
+
}
|
|
161
|
+
});
|
|
162
|
+
this.translate(this.key, this.params, this.default);
|
|
163
|
+
}
|
|
164
|
+
ngOnDestroy() {
|
|
165
|
+
this.onLangChangeSubscription?.unsubscribe();
|
|
166
|
+
this.onTranslationChangeSubscription?.unsubscribe();
|
|
167
|
+
}
|
|
168
|
+
translate(key, params, defaultValue) {
|
|
169
|
+
this.resultProvider(key, params, defaultValue).subscribe((r) => {
|
|
170
|
+
this.ref.nativeElement.textContent = r;
|
|
171
|
+
});
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
TComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.0", ngImport: i0, type: TComponent, deps: [{ token: i0.ElementRef }, { token: TranslateService }], target: i0.ɵɵFactoryTarget.Component });
|
|
175
|
+
TComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.0.0", type: TComponent, selector: "[t]", inputs: { params: "params", key: "key", default: "default" }, ngImport: i0, template: ``, isInline: true });
|
|
176
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.0", ngImport: i0, type: TComponent, decorators: [{
|
|
177
|
+
type: Component,
|
|
178
|
+
args: [{
|
|
179
|
+
selector: '[t]',
|
|
180
|
+
template: ``,
|
|
181
|
+
}]
|
|
182
|
+
}], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: TranslateService }]; }, propDecorators: { params: [{
|
|
183
|
+
type: Input
|
|
184
|
+
}], key: [{
|
|
185
|
+
type: Input
|
|
186
|
+
}], default: [{
|
|
187
|
+
type: Input
|
|
188
|
+
}] } });
|
|
189
|
+
|
|
190
|
+
class TranslationsProvider {
|
|
191
|
+
constructor(translateService) {
|
|
192
|
+
this.translateService = translateService;
|
|
193
|
+
}
|
|
194
|
+
async load(options) {
|
|
195
|
+
return await this.translateService.start(options);
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
TranslationsProvider.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.0", ngImport: i0, type: TranslationsProvider, deps: [{ token: TranslateService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
199
|
+
TranslationsProvider.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.0.0", ngImport: i0, type: TranslationsProvider });
|
|
200
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.0", ngImport: i0, type: TranslationsProvider, decorators: [{
|
|
201
|
+
type: Injectable
|
|
202
|
+
}], ctorParameters: function () { return [{ type: TranslateService }]; } });
|
|
203
|
+
|
|
204
|
+
class NgxTolgeeModule {
|
|
205
|
+
// @dynamic
|
|
206
|
+
static forRoot(options) {
|
|
207
|
+
options = { filesUrlPrefix: '/assets/i18n/', ...options };
|
|
208
|
+
return {
|
|
209
|
+
ngModule: NgxTolgeeModule,
|
|
210
|
+
providers: [
|
|
211
|
+
TranslateService,
|
|
212
|
+
TranslationsProvider,
|
|
213
|
+
{
|
|
214
|
+
provide: APP_INITIALIZER,
|
|
215
|
+
useFactory: (provider) => {
|
|
216
|
+
return async () => await provider.load(options);
|
|
217
|
+
},
|
|
218
|
+
deps: [TranslationsProvider, TranslateService],
|
|
219
|
+
multi: true,
|
|
220
|
+
},
|
|
221
|
+
{ provide: TolgeeConfig, useValue: options },
|
|
222
|
+
],
|
|
223
|
+
};
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
NgxTolgeeModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.0", ngImport: i0, type: NgxTolgeeModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
227
|
+
NgxTolgeeModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.0.0", ngImport: i0, type: NgxTolgeeModule, declarations: [TranslatePipe, STranslatePipe, TComponent], exports: [TranslatePipe, STranslatePipe, TComponent] });
|
|
228
|
+
NgxTolgeeModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.0.0", ngImport: i0, type: NgxTolgeeModule, providers: [] });
|
|
229
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.0", ngImport: i0, type: NgxTolgeeModule, decorators: [{
|
|
230
|
+
type: NgModule,
|
|
231
|
+
args: [{
|
|
232
|
+
declarations: [TranslatePipe, STranslatePipe, TComponent],
|
|
233
|
+
exports: [TranslatePipe, STranslatePipe, TComponent],
|
|
234
|
+
providers: [],
|
|
235
|
+
}]
|
|
236
|
+
}] });
|
|
237
|
+
|
|
238
|
+
/*
|
|
239
|
+
* Public API Surface of ngx-tolgee
|
|
240
|
+
*/
|
|
241
|
+
|
|
242
|
+
/**
|
|
243
|
+
* Generated bundle index. Do not edit.
|
|
244
|
+
*/
|
|
245
|
+
|
|
246
|
+
export { NgxTolgeeModule, STranslatePipe, TComponent, TranslatePipe, TranslateService };
|
|
247
|
+
//# sourceMappingURL=tolgee-ngx.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tolgee-ngx.mjs","sources":["../../../projects/ngx-tolgee/src/lib/translate.service.ts","../../../projects/ngx-tolgee/src/lib/translate.pipe.ts","../../../projects/ngx-tolgee/src/lib/stranslate.pipe.ts","../../../projects/ngx-tolgee/src/lib/t.component.ts","../../../projects/ngx-tolgee/src/lib/translations-provider.ts","../../../projects/ngx-tolgee/src/lib/ngx-tolgee.module.ts","../../../projects/ngx-tolgee/src/public-api.ts","../../../projects/ngx-tolgee/src/tolgee-ngx.ts"],"sourcesContent":["import { EventEmitter, Injectable, OnDestroy } from '@angular/core';\nimport { from, Observable } from 'rxjs';\nimport { Tolgee, TranslationData } from '@tolgee/core';\nimport { TolgeeConfig } from './tolgeeConfig';\n\n@Injectable()\nexport class TranslateService implements OnDestroy {\n public readonly onLangChange: EventEmitter<never> = new EventEmitter<never>();\n public readonly onTranslationChange: EventEmitter<TranslationData> =\n new EventEmitter<TranslationData>();\n\n private runPromise: Promise<void>;\n private onTranslationChangeCoreSubscription: any;\n private onLangChangeCoreSubscription: any;\n\n constructor(private config: TolgeeConfig) {}\n\n private _tolgee: Tolgee;\n\n public get tolgee(): Tolgee {\n return this._tolgee;\n }\n\n public async start(config: TolgeeConfig): Promise<void> {\n if (!this.runPromise) {\n this._tolgee = new Tolgee(config);\n this.runPromise = this.tolgee.run();\n this.unsubscribeCoreListeners();\n this.onTranslationChangeCoreSubscription =\n this._tolgee.onTranslationChange.subscribe((data) => {\n this.onTranslationChange.emit(data);\n });\n this.onLangChangeCoreSubscription = this._tolgee.onLangChange.subscribe(\n () => {\n this.onLangChange.emit();\n }\n );\n }\n await this.runPromise;\n }\n\n ngOnDestroy(): void {\n this.tolgee.stop();\n this.unsubscribeCoreListeners();\n }\n\n public setLang(lang: string) {\n this.tolgee.lang = lang;\n }\n\n public get(\n input: string,\n params = {},\n defaultValue?: string\n ): Observable<string> {\n return from(this.translate(input, params, false, defaultValue));\n }\n\n public getSafe(\n input: string,\n params = {},\n defaultValue?: string\n ): Observable<string> {\n return from(this.translate(input, params, true, defaultValue));\n }\n\n public instant(input: string, params = {}, defaultValue?: string): string {\n return this.tolgee.instant(\n input,\n params,\n undefined,\n undefined,\n defaultValue\n );\n }\n\n public instantSafe(\n input: string,\n params = {},\n defaultValue?: string\n ): string {\n return this.tolgee.instant(input, params, true, undefined, defaultValue);\n }\n\n public getCurrentLang(): string {\n return this.tolgee.lang;\n }\n\n private unsubscribeCoreListeners() {\n this.onTranslationChangeCoreSubscription?.unsubscribe();\n this.onLangChangeCoreSubscription?.unsubscribe();\n }\n\n private async translate(\n input: string,\n params = {},\n noWrap = false,\n defaultValue: string\n ): Promise<string> {\n //wait for start before translating\n await this.start(this.config);\n return await this.tolgee.translate(input, params, noWrap, defaultValue);\n }\n}\n","import { OnDestroy, Pipe, PipeTransform } from '@angular/core';\nimport { TranslateService } from './translate.service';\nimport { Observable, Subscription } from 'rxjs';\n\n@Pipe({\n name: 'translate',\n pure: false,\n})\nexport class TranslatePipe implements PipeTransform, OnDestroy {\n value = '';\n lastHash: string;\n private langChangeSubscription: Subscription;\n\n constructor(protected translateService: TranslateService) {}\n\n protected get resultProvider(): (\n key,\n params,\n defaultValue: string\n ) => Observable<string> {\n return (input, params, defaultValue) =>\n this.translateService.get(input, params, defaultValue);\n }\n\n ngOnDestroy(): void {\n this.langChangeSubscription.unsubscribe();\n }\n\n transform(input: any, params?: Record<string, any>): string;\n transform(\n input: any,\n defaultValue?: string,\n params?: Record<string, any>\n ): string;\n\n transform(\n input: any,\n paramsOrDefaultValue?: Record<string, any> | string,\n params?: Record<string, any>\n ): string {\n if (!input || input.length === 0) {\n return input;\n }\n\n const defaultValue =\n typeof paramsOrDefaultValue !== 'object'\n ? paramsOrDefaultValue\n : undefined;\n\n if (typeof paramsOrDefaultValue === 'object') {\n params = paramsOrDefaultValue;\n }\n\n const newHash = this.getHash(\n input,\n params,\n this.translateService.getCurrentLang()\n );\n\n if (newHash === this.lastHash) {\n return this.value;\n }\n\n this.langChangeSubscription?.unsubscribe();\n this.langChangeSubscription = this.translateService.onLangChange.subscribe(\n () => {\n this.onLangChange(input, params, defaultValue);\n }\n );\n\n this.onLangChange(input, params, defaultValue);\n\n this.lastHash = newHash;\n\n return this.value;\n }\n\n private getHash(input: string, params: object, language: string): string {\n return JSON.stringify({ input, params, language });\n }\n\n private onLangChange(input, params, defaultValue) {\n this.resultProvider(input, params, defaultValue).subscribe((r) => {\n this.value = r;\n });\n }\n}\n","import { Pipe } from '@angular/core';\nimport { TranslateService } from './translate.service';\nimport { TranslatePipe } from './translate.pipe';\nimport { Observable } from 'rxjs';\n\n@Pipe({\n name: 'stranslate',\n pure: false,\n})\nexport class STranslatePipe extends TranslatePipe {\n constructor(translateService: TranslateService) {\n super(translateService);\n }\n\n protected get resultProvider(): (\n input,\n params,\n defaultValue\n ) => Observable<string> {\n return (input, params, defaultValue) =>\n this.translateService.getSafe(input, params, defaultValue);\n }\n}\n","import { Component, ElementRef, Input, OnDestroy, OnInit } from '@angular/core';\nimport { Observable, Subscription } from 'rxjs';\nimport { TranslateService } from './translate.service';\nimport { TOLGEE_WRAPPED_ONLY_DATA_ATTRIBUTE } from '@tolgee/core';\n\n@Component({\n selector: '[t]',\n template: ``,\n})\nexport class TComponent implements OnInit, OnDestroy {\n value: string;\n @Input() params?: Record<string, any>;\n @Input() key: string;\n @Input() default?: string;\n onLangChangeSubscription: Subscription;\n onTranslationChangeSubscription: Subscription;\n\n constructor(\n private ref: ElementRef,\n private translateService: TranslateService\n ) {}\n\n protected get resultProvider(): (\n key,\n params,\n defaultValue: string\n ) => Observable<string> {\n return (key, params, defaultValue) =>\n this.translateService.getSafe(key, params, defaultValue);\n }\n\n ngOnInit(): void {\n const element = this.ref.nativeElement as HTMLElement;\n\n element.setAttribute(TOLGEE_WRAPPED_ONLY_DATA_ATTRIBUTE, this.key);\n\n //update value when language changed\n this.onLangChangeSubscription =\n this.translateService.onLangChange.subscribe(() => {\n this.translate(this.key, this.params, this.default);\n });\n\n //update value when translation changed\n this.onTranslationChangeSubscription =\n this.translateService.onTranslationChange.subscribe((data) => {\n if (data.key == this.key) {\n this.translate(this.key, this.params, this.default);\n }\n });\n this.translate(this.key, this.params, this.default);\n }\n\n ngOnDestroy(): void {\n this.onLangChangeSubscription?.unsubscribe();\n this.onTranslationChangeSubscription?.unsubscribe();\n }\n\n private translate(key, params, defaultValue: string) {\n this.resultProvider(key, params, defaultValue).subscribe((r) => {\n this.ref.nativeElement.textContent = r;\n });\n }\n}\n","import {Injectable} from '@angular/core';\nimport {TranslateService} from \"./translate.service\";\nimport {TolgeeConfig} from \"@tolgee/core\";\n\n@Injectable()\nexport class TranslationsProvider {\n\n constructor(private translateService: TranslateService) {\n }\n\n async load(options: TolgeeConfig) {\n return await this.translateService.start(options);\n }\n}\n\n\n","import { APP_INITIALIZER, ModuleWithProviders, NgModule } from '@angular/core';\nimport { TranslatePipe } from './translate.pipe';\nimport { TranslationsProvider } from './translations-provider';\nimport { TranslateService } from './translate.service';\nimport { STranslatePipe } from './stranslate.pipe';\nimport { TolgeeConfig } from './tolgeeConfig';\nimport { TComponent } from './t.component';\n\n@NgModule({\n declarations: [TranslatePipe, STranslatePipe, TComponent],\n exports: [TranslatePipe, STranslatePipe, TComponent],\n providers: [],\n})\nexport class NgxTolgeeModule {\n // @dynamic\n static forRoot(options: TolgeeConfig): ModuleWithProviders<NgxTolgeeModule> {\n options = { filesUrlPrefix: '/assets/i18n/', ...options };\n return {\n ngModule: NgxTolgeeModule,\n providers: [\n TranslateService,\n TranslationsProvider,\n {\n provide: APP_INITIALIZER,\n useFactory: (provider: TranslationsProvider) => {\n return async () => await provider.load(options);\n },\n deps: [TranslationsProvider, TranslateService],\n multi: true,\n },\n { provide: TolgeeConfig, useValue: options },\n ],\n };\n }\n}\n","/*\n * Public API Surface of ngx-tolgee\n */\nimport { TranslateService } from './lib/translate.service';\nimport { TranslatePipe } from './lib/translate.pipe';\nimport { STranslatePipe } from './lib/stranslate.pipe';\nimport { TolgeeConfig } from './lib/tolgeeConfig';\nimport { TComponent } from './lib/t.component';\n\nexport * from './lib/ngx-tolgee.module';\nexport { TolgeeConfig };\nexport { TranslateService };\nexport { TranslatePipe };\nexport { STranslatePipe };\nexport { TComponent };\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;MAMa,gBAAgB;IAS3B,YAAoB,MAAoB;QAApB,WAAM,GAAN,MAAM,CAAc;QARxB,iBAAY,GAAwB,IAAI,YAAY,EAAS,CAAC;QAC9D,wBAAmB,GACjC,IAAI,YAAY,EAAmB,CAAC;KAMM;IAI5C,IAAW,MAAM;QACf,OAAO,IAAI,CAAC,OAAO,CAAC;KACrB;IAEM,MAAM,KAAK,CAAC,MAA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,EAAE;gBACT,gBAAgB;gBAChB,oBAAoB;gBACpB;oBACE,OAAO,EAAE,eAAe;oBACxB,UAAU,EAAE,CAAC,QAA8B;wBACzC,OAAO,YAAY,MAAM,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;qBACjD;oBACD,IAAI,EAAE,CAAC,oBAAoB,EAAE,gBAAgB,CAAC;oBAC9C,KAAK,EAAE,IAAI;iBACZ;gBACD,EAAE,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,OAAO,EAAE;aAC7C;SACF,CAAC;KACH;;4GApBU,eAAe;6GAAf,eAAe,iBAJX,aAAa,EAAE,cAAc,EAAE,UAAU,aAC9C,aAAa,EAAE,cAAc,EAAE,UAAU;6GAGxC,eAAe,aAFf,EAAE;2FAEF,eAAe;kBAL3B,QAAQ;mBAAC;oBACR,YAAY,EAAE,CAAC,aAAa,EAAE,cAAc,EAAE,UAAU,CAAC;oBACzD,OAAO,EAAE,CAAC,aAAa,EAAE,cAAc,EAAE,UAAU,CAAC;oBACpD,SAAS,EAAE,EAAE;iBACd;;;ACZD;;;;ACAA;;;;;;"}
|
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
import { ModuleWithProviders } from '@angular/core';
|
|
2
2
|
import { TolgeeConfig } from './tolgeeConfig';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
import * as i1 from "./translate.pipe";
|
|
5
|
+
import * as i2 from "./stranslate.pipe";
|
|
6
|
+
import * as i3 from "./t.component";
|
|
3
7
|
export declare class NgxTolgeeModule {
|
|
4
8
|
static forRoot(options: TolgeeConfig): ModuleWithProviders<NgxTolgeeModule>;
|
|
9
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<NgxTolgeeModule, never>;
|
|
10
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<NgxTolgeeModule, [typeof i1.TranslatePipe, typeof i2.STranslatePipe, typeof i3.TComponent], never, [typeof i1.TranslatePipe, typeof i2.STranslatePipe, typeof i3.TComponent]>;
|
|
11
|
+
static ɵinj: i0.ɵɵInjectorDeclaration<NgxTolgeeModule>;
|
|
5
12
|
}
|
package/lib/stranslate.pipe.d.ts
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import { TranslateService } from './translate.service';
|
|
2
2
|
import { TranslatePipe } from './translate.pipe';
|
|
3
3
|
import { Observable } from 'rxjs';
|
|
4
|
+
import * as i0 from "@angular/core";
|
|
4
5
|
export declare class STranslatePipe extends TranslatePipe {
|
|
5
6
|
constructor(translateService: TranslateService);
|
|
6
7
|
protected get resultProvider(): (input: any, params: any, defaultValue: any) => Observable<string>;
|
|
8
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<STranslatePipe, never>;
|
|
9
|
+
static ɵpipe: i0.ɵɵPipeDeclaration<STranslatePipe, "stranslate">;
|
|
7
10
|
}
|
package/lib/t.component.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { ElementRef, OnDestroy, OnInit } from '@angular/core';
|
|
2
2
|
import { Observable, Subscription } from 'rxjs';
|
|
3
3
|
import { TranslateService } from './translate.service';
|
|
4
|
+
import * as i0 from "@angular/core";
|
|
4
5
|
export declare class TComponent implements OnInit, OnDestroy {
|
|
5
6
|
private ref;
|
|
6
7
|
private translateService;
|
|
@@ -15,4 +16,6 @@ export declare class TComponent implements OnInit, OnDestroy {
|
|
|
15
16
|
ngOnInit(): void;
|
|
16
17
|
ngOnDestroy(): void;
|
|
17
18
|
private translate;
|
|
19
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<TComponent, never>;
|
|
20
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<TComponent, "[t]", never, { "params": "params"; "key": "key"; "default": "default"; }, {}, never, never>;
|
|
18
21
|
}
|
package/lib/translate.pipe.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { OnDestroy, PipeTransform } from '@angular/core';
|
|
2
2
|
import { TranslateService } from './translate.service';
|
|
3
3
|
import { Observable } from 'rxjs';
|
|
4
|
+
import * as i0 from "@angular/core";
|
|
4
5
|
export declare class TranslatePipe implements PipeTransform, OnDestroy {
|
|
5
6
|
protected translateService: TranslateService;
|
|
6
7
|
value: string;
|
|
@@ -13,4 +14,6 @@ export declare class TranslatePipe implements PipeTransform, OnDestroy {
|
|
|
13
14
|
transform(input: any, defaultValue?: string, params?: Record<string, any>): string;
|
|
14
15
|
private getHash;
|
|
15
16
|
private onLangChange;
|
|
17
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<TranslatePipe, never>;
|
|
18
|
+
static ɵpipe: i0.ɵɵPipeDeclaration<TranslatePipe, "translate">;
|
|
16
19
|
}
|
|
@@ -2,6 +2,7 @@ import { EventEmitter, OnDestroy } from '@angular/core';
|
|
|
2
2
|
import { Observable } from 'rxjs';
|
|
3
3
|
import { Tolgee, TranslationData } from '@tolgee/core';
|
|
4
4
|
import { TolgeeConfig } from './tolgeeConfig';
|
|
5
|
+
import * as i0 from "@angular/core";
|
|
5
6
|
export declare class TranslateService implements OnDestroy {
|
|
6
7
|
private config;
|
|
7
8
|
readonly onLangChange: EventEmitter<never>;
|
|
@@ -22,4 +23,6 @@ export declare class TranslateService implements OnDestroy {
|
|
|
22
23
|
getCurrentLang(): string;
|
|
23
24
|
private unsubscribeCoreListeners;
|
|
24
25
|
private translate;
|
|
26
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<TranslateService, never>;
|
|
27
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<TranslateService>;
|
|
25
28
|
}
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import { TranslateService } from "./translate.service";
|
|
2
2
|
import { TolgeeConfig } from "@tolgee/core";
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
3
4
|
export declare class TranslationsProvider {
|
|
4
5
|
private translateService;
|
|
5
6
|
constructor(translateService: TranslateService);
|
|
6
7
|
load(options: TolgeeConfig): Promise<void>;
|
|
8
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<TranslationsProvider, never>;
|
|
9
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<TranslationsProvider>;
|
|
7
10
|
}
|
package/package.json
CHANGED
|
@@ -5,20 +5,33 @@
|
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "https://github.com/tolgee/tolgee-js"
|
|
7
7
|
},
|
|
8
|
-
"
|
|
8
|
+
"dependencies": {
|
|
9
|
+
"@tolgee/core": "^2.7.0",
|
|
10
|
+
"tslib": "^2.3.0"
|
|
11
|
+
},
|
|
12
|
+
"version": "2.7.0",
|
|
9
13
|
"publishConfig": {
|
|
10
14
|
"directory": "../../dist/ngx-tolgee",
|
|
11
15
|
"access": "public"
|
|
12
16
|
},
|
|
13
|
-
"
|
|
14
|
-
"
|
|
15
|
-
"
|
|
16
|
-
"
|
|
17
|
-
"fesm2015": "fesm2015/tolgee-ngx.
|
|
17
|
+
"module": "fesm2015/tolgee-ngx.mjs",
|
|
18
|
+
"es2020": "fesm2020/tolgee-ngx.mjs",
|
|
19
|
+
"esm2020": "esm2020/tolgee-ngx.mjs",
|
|
20
|
+
"fesm2020": "fesm2020/tolgee-ngx.mjs",
|
|
21
|
+
"fesm2015": "fesm2015/tolgee-ngx.mjs",
|
|
18
22
|
"typings": "tolgee-ngx.d.ts",
|
|
19
|
-
"
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
23
|
+
"exports": {
|
|
24
|
+
"./package.json": {
|
|
25
|
+
"default": "./package.json"
|
|
26
|
+
},
|
|
27
|
+
".": {
|
|
28
|
+
"types": "./tolgee-ngx.d.ts",
|
|
29
|
+
"esm2020": "./esm2020/tolgee-ngx.mjs",
|
|
30
|
+
"es2020": "./fesm2020/tolgee-ngx.mjs",
|
|
31
|
+
"es2015": "./fesm2015/tolgee-ngx.mjs",
|
|
32
|
+
"node": "./fesm2015/tolgee-ngx.mjs",
|
|
33
|
+
"default": "./fesm2020/tolgee-ngx.mjs"
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
"sideEffects": false
|
|
24
37
|
}
|