@acorex/core 18.16.0-next.3 → 18.16.0-next.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/esm2022/translation/lib/translation.service.mjs +138 -222
- package/esm2022/translation/lib/translator.directive.mjs +2 -2
- package/esm2022/translation/lib/translator.pipe.mjs +2 -2
- package/fesm2022/acorex-core-translation.mjs +139 -223
- package/fesm2022/acorex-core-translation.mjs.map +1 -1
- package/package.json +1 -1
- package/translation/lib/translation.service.d.ts +23 -15
@@ -1,5 +1,5 @@
|
|
1
1
|
import { Observable } from 'rxjs';
|
2
|
-
import {
|
2
|
+
import { AXTranslateOptions } from './translation.types';
|
3
3
|
import * as i0 from "@angular/core";
|
4
4
|
export declare function translateSync(key: string, options?: AXTranslateOptions): string;
|
5
5
|
export declare class AXTranslationService {
|
@@ -10,26 +10,34 @@ export declare class AXTranslationService {
|
|
10
10
|
private ongoingRequests;
|
11
11
|
private activeLang;
|
12
12
|
langChanges$: Observable<string>;
|
13
|
-
private
|
13
|
+
private expressionCache;
|
14
|
+
getDefaultLang(): string;
|
15
|
+
getActiveLang(): string;
|
16
|
+
setActiveLang(lang: string): void;
|
14
17
|
/**
|
15
18
|
* @ignore
|
16
19
|
*/
|
17
20
|
constructor();
|
18
21
|
loadLanguagesAndScopes(languages: string[], scopes: string[]): Observable<unknown>;
|
19
|
-
private
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
22
|
+
private fetchTranslationFiles;
|
23
|
+
/**
|
24
|
+
* Set translation data into cache
|
25
|
+
*/
|
26
|
+
private setTranslationCache;
|
27
|
+
/**
|
28
|
+
* Get the translation from the cache or fallback to loading
|
29
|
+
*/
|
30
|
+
private getTranslationFromCache;
|
24
31
|
isLangAvailable(lang: string, scope?: string): boolean;
|
25
|
-
|
26
|
-
private
|
27
|
-
private
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
32
|
+
private translateKey;
|
33
|
+
private isExpression;
|
34
|
+
private decodeExpression;
|
35
|
+
private handleError;
|
36
|
+
private translateText;
|
37
|
+
translate$(text: string, options?: AXTranslateOptions): Observable<string>;
|
38
|
+
translateAsync(text: string, options?: AXTranslateOptions): Promise<string>;
|
39
|
+
translateSync(text: string, options?: AXTranslateOptions): string;
|
40
|
+
private translateTextSync;
|
33
41
|
static ɵfac: i0.ɵɵFactoryDeclaration<AXTranslationService, never>;
|
34
42
|
static ɵprov: i0.ɵɵInjectableDeclaration<AXTranslationService>;
|
35
43
|
}
|