@taon-dev/i18n 21.0.7 → 21.0.16
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/bin/start.js +37 -37
- package/browser/package.json +1 -20
- package/browser-prod/package.json +2 -20
- package/lib/package.json +1 -1
- package/lib-prod/package.json +1 -1
- package/package.json +1 -1
- package/websql/package.json +1 -20
- package/websql-prod/package.json +2 -20
- package/VERIFIED-BUILD-DATA.jsonc +0 -5
- package/assets/shared/shared_folder_info.txt +0 -7
- package/browser/README.md +0 -24
- package/browser/fesm2022/i18n-browser.mjs +0 -1556
- package/browser/fesm2022/i18n-browser.mjs.map +0 -1
- package/browser/types/i18n-browser.d.ts +0 -194
- package/browser-prod/README.md +0 -24
- package/browser-prod/fesm2022/i18n-browser-prod.mjs +0 -1545
- package/browser-prod/fesm2022/i18n-browser-prod.mjs.map +0 -1
- package/browser-prod/types/i18n-browser-prod.d.ts +0 -188
- package/browser-prod.re-export.json +0 -1
- package/browser-prod.split-namespaces.json +0 -28
- package/cli.d.ts +0 -1
- package/cli.js +0 -8
- package/cli.js.map +0 -1
- package/html/app/main-page/main-page.container.html +0 -4
- package/html/assets/generated/pwa/html-pwa.html +0 -60
- package/html/imports.html +0 -3
- package/index.d.ts +0 -3
- package/index.js +0 -20
- package/index.js.map +0 -1
- package/lib/build-info._auto-generated_.d.ts +0 -24
- package/lib/build-info._auto-generated_.js +0 -30
- package/lib/build-info._auto-generated_.js.map +0 -1
- package/lib/env/env.angular-node-app.d.ts +0 -67
- package/lib/env/env.angular-node-app.js +0 -141
- package/lib/env/env.angular-node-app.js.map +0 -1
- package/lib/env/env.docs-webapp.d.ts +0 -67
- package/lib/env/env.docs-webapp.js +0 -141
- package/lib/env/env.docs-webapp.js.map +0 -1
- package/lib/env/env.electron-app.d.ts +0 -67
- package/lib/env/env.electron-app.js +0 -141
- package/lib/env/env.electron-app.js.map +0 -1
- package/lib/env/env.mobile-app.d.ts +0 -67
- package/lib/env/env.mobile-app.js +0 -141
- package/lib/env/env.mobile-app.js.map +0 -1
- package/lib/env/env.npm-lib-and-cli-tool.d.ts +0 -67
- package/lib/env/env.npm-lib-and-cli-tool.js +0 -141
- package/lib/env/env.npm-lib-and-cli-tool.js.map +0 -1
- package/lib/env/env.vscode-plugin.d.ts +0 -67
- package/lib/env/env.vscode-plugin.js +0 -141
- package/lib/env/env.vscode-plugin.js.map +0 -1
- package/lib/env/index.d.ts +0 -6
- package/lib/env/index.js +0 -23
- package/lib/env/index.js.map +0 -1
- package/lib/index._auto-generated_.d.ts +0 -11
- package/lib/index._auto-generated_.js +0 -33
- package/lib/index._auto-generated_.js.map +0 -1
- package/lib/index.d.ts +0 -4
- package/lib/index.js +0 -20
- package/lib/index.js.map +0 -1
- package/lib/start-cli.d.ts +0 -7
- package/lib/start-cli.js +0 -48
- package/lib/start-cli.js.map +0 -1
- package/lib/translate.directive.d.ts +0 -15
- package/lib/translate.pipe.d.ts +0 -10
- package/lib/translate.service.d.ts +0 -13
- package/lib/translation-manager.d.ts +0 -33
- package/lib/translation-manager.js +0 -119
- package/lib/translation-manager.js.map +0 -1
- package/lib/translation.d.ts +0 -44
- package/lib/translation.js +0 -253
- package/lib/translation.js.map +0 -1
- package/lib/translation.models.d.ts +0 -25
- package/lib/translation.models.js +0 -3
- package/lib/translation.models.js.map +0 -1
- package/lib/utils-i18n-extract-gettext-translate-from-html.d.ts +0 -4
- package/lib/utils-i18n-extract-gettext-translate-from-html.js +0 -465
- package/lib/utils-i18n-extract-gettext-translate-from-html.js.map +0 -1
- package/lib/utils-i18n-extract-gettext-translate-from-html.test.d.ts +0 -1
- package/lib/utils-i18n-extract-gettext-translate-from-html.test.js +0 -282
- package/lib/utils-i18n-extract-gettext-translate-from-html.test.js.map +0 -1
- package/lib/utils-i18n-html.d.ts +0 -5
- package/lib/utils-i18n-html.js +0 -120
- package/lib/utils-i18n-html.js.map +0 -1
- package/lib/utils-i18n-html.test.d.ts +0 -1
- package/lib/utils-i18n-html.test.js +0 -82
- package/lib/utils-i18n-html.test.js.map +0 -1
- package/lib/utils-po-file.d.ts +0 -8
- package/lib/utils-po-file.js +0 -245
- package/lib/utils-po-file.js.map +0 -1
- package/lib/utils-po-file.test.d.ts +0 -1
- package/lib/utils-po-file.test.js +0 -239
- package/lib/utils-po-file.test.js.map +0 -1
- package/lib-esm/app/main-page/main-page.active.context.d.ts +0 -19
- package/lib-esm/app/main-page/main-page.active.context.js +0 -19
- package/lib-esm/app/main-page/main-page.active.context.js.map +0 -1
- package/lib-esm/app.d.ts +0 -3
- package/lib-esm/app.electron.d.ts +0 -1
- package/lib-esm/app.electron.js +0 -2
- package/lib-esm/app.electron.js.map +0 -1
- package/lib-esm/app.hosts.d.ts +0 -147
- package/lib-esm/app.hosts.js +0 -217
- package/lib-esm/app.hosts.js.map +0 -1
- package/lib-esm/app.js +0 -460
- package/lib-esm/app.js.map +0 -1
- package/lib-esm/app.vscode.d.ts +0 -9
- package/lib-esm/app.vscode.js +0 -37
- package/lib-esm/app.vscode.js.map +0 -1
- package/lib-esm/cli.d.ts +0 -1
- package/lib-esm/cli.js +0 -4
- package/lib-esm/cli.js.map +0 -1
- package/lib-esm/index.d.ts +0 -3
- package/lib-esm/index.js +0 -4
- package/lib-esm/index.js.map +0 -1
- package/lib-esm/lib/build-info._auto-generated_.d.ts +0 -24
- package/lib-esm/lib/build-info._auto-generated_.js +0 -27
- package/lib-esm/lib/build-info._auto-generated_.js.map +0 -1
- package/lib-esm/lib/env/env.angular-node-app.d.ts +0 -67
- package/lib-esm/lib/env/env.angular-node-app.js +0 -137
- package/lib-esm/lib/env/env.angular-node-app.js.map +0 -1
- package/lib-esm/lib/env/env.docs-webapp.d.ts +0 -67
- package/lib-esm/lib/env/env.docs-webapp.js +0 -137
- package/lib-esm/lib/env/env.docs-webapp.js.map +0 -1
- package/lib-esm/lib/env/env.electron-app.d.ts +0 -67
- package/lib-esm/lib/env/env.electron-app.js +0 -137
- package/lib-esm/lib/env/env.electron-app.js.map +0 -1
- package/lib-esm/lib/env/env.mobile-app.d.ts +0 -67
- package/lib-esm/lib/env/env.mobile-app.js +0 -137
- package/lib-esm/lib/env/env.mobile-app.js.map +0 -1
- package/lib-esm/lib/env/env.npm-lib-and-cli-tool.d.ts +0 -67
- package/lib-esm/lib/env/env.npm-lib-and-cli-tool.js +0 -137
- package/lib-esm/lib/env/env.npm-lib-and-cli-tool.js.map +0 -1
- package/lib-esm/lib/env/env.vscode-plugin.d.ts +0 -67
- package/lib-esm/lib/env/env.vscode-plugin.js +0 -137
- package/lib-esm/lib/env/env.vscode-plugin.js.map +0 -1
- package/lib-esm/lib/env/index.d.ts +0 -6
- package/lib-esm/lib/env/index.js +0 -7
- package/lib-esm/lib/env/index.js.map +0 -1
- package/lib-esm/lib/index._auto-generated_.d.ts +0 -8
- package/lib-esm/lib/index._auto-generated_.js +0 -17
- package/lib-esm/lib/index._auto-generated_.js.map +0 -1
- package/lib-esm/lib/index.d.ts +0 -4
- package/lib-esm/lib/index.js +0 -4
- package/lib-esm/lib/index.js.map +0 -1
- package/lib-esm/lib/start-cli.d.ts +0 -7
- package/lib-esm/lib/start-cli.js +0 -45
- package/lib-esm/lib/start-cli.js.map +0 -1
- package/lib-esm/lib/translation-manager.d.ts +0 -33
- package/lib-esm/lib/translation-manager.js +0 -115
- package/lib-esm/lib/translation-manager.js.map +0 -1
- package/lib-esm/lib/translation.d.ts +0 -43
- package/lib-esm/lib/translation.js +0 -249
- package/lib-esm/lib/translation.js.map +0 -1
- package/lib-esm/lib/translation.models.d.ts +0 -25
- package/lib-esm/lib/translation.models.js +0 -2
- package/lib-esm/lib/translation.models.js.map +0 -1
- package/lib-esm/lib/utils-i18n-extract-gettext-translate-from-html.d.ts +0 -4
- package/lib-esm/lib/utils-i18n-extract-gettext-translate-from-html.js +0 -462
- package/lib-esm/lib/utils-i18n-extract-gettext-translate-from-html.js.map +0 -1
- package/lib-esm/lib/utils-i18n-extract-gettext-translate-from-html.test.d.ts +0 -1
- package/lib-esm/lib/utils-i18n-extract-gettext-translate-from-html.test.js +0 -280
- package/lib-esm/lib/utils-i18n-extract-gettext-translate-from-html.test.js.map +0 -1
- package/lib-esm/lib/utils-i18n-html.d.ts +0 -5
- package/lib-esm/lib/utils-i18n-html.js +0 -117
- package/lib-esm/lib/utils-i18n-html.js.map +0 -1
- package/lib-esm/lib/utils-i18n-html.test.d.ts +0 -1
- package/lib-esm/lib/utils-i18n-html.test.js +0 -80
- package/lib-esm/lib/utils-i18n-html.test.js.map +0 -1
- package/lib-esm/lib/utils-po-file.d.ts +0 -8
- package/lib-esm/lib/utils-po-file.js +0 -242
- package/lib-esm/lib/utils-po-file.js.map +0 -1
- package/lib-esm/lib/utils-po-file.test.d.ts +0 -1
- package/lib-esm/lib/utils-po-file.test.js +0 -237
- package/lib-esm/lib/utils-po-file.test.js.map +0 -1
- package/lib-prod/build-info._auto-generated_.d.ts +0 -24
- package/lib-prod/build-info._auto-generated_.js +0 -27
- package/lib-prod/build-info._auto-generated_.js.map +0 -1
- package/lib-prod/env/env.angular-node-app.d.ts +0 -67
- package/lib-prod/env/env.angular-node-app.js +0 -137
- package/lib-prod/env/env.angular-node-app.js.map +0 -1
- package/lib-prod/env/env.docs-webapp.d.ts +0 -67
- package/lib-prod/env/env.docs-webapp.js +0 -137
- package/lib-prod/env/env.docs-webapp.js.map +0 -1
- package/lib-prod/env/env.electron-app.d.ts +0 -67
- package/lib-prod/env/env.electron-app.js +0 -137
- package/lib-prod/env/env.electron-app.js.map +0 -1
- package/lib-prod/env/env.mobile-app.d.ts +0 -67
- package/lib-prod/env/env.mobile-app.js +0 -137
- package/lib-prod/env/env.mobile-app.js.map +0 -1
- package/lib-prod/env/env.npm-lib-and-cli-tool.d.ts +0 -67
- package/lib-prod/env/env.npm-lib-and-cli-tool.js +0 -137
- package/lib-prod/env/env.npm-lib-and-cli-tool.js.map +0 -1
- package/lib-prod/env/env.vscode-plugin.d.ts +0 -67
- package/lib-prod/env/env.vscode-plugin.js +0 -137
- package/lib-prod/env/env.vscode-plugin.js.map +0 -1
- package/lib-prod/env/index.d.ts +0 -6
- package/lib-prod/env/index.js +0 -7
- package/lib-prod/env/index.js.map +0 -1
- package/lib-prod/index._auto-generated_.d.ts +0 -8
- package/lib-prod/index._auto-generated_.js +0 -17
- package/lib-prod/index._auto-generated_.js.map +0 -1
- package/lib-prod/index.d.ts +0 -4
- package/lib-prod/index.js +0 -4
- package/lib-prod/index.js.map +0 -1
- package/lib-prod/start-cli.d.ts +0 -7
- package/lib-prod/start-cli.js +0 -45
- package/lib-prod/start-cli.js.map +0 -1
- package/lib-prod/translation-manager.d.ts +0 -33
- package/lib-prod/translation-manager.js +0 -115
- package/lib-prod/translation-manager.js.map +0 -1
- package/lib-prod/translation.d.ts +0 -43
- package/lib-prod/translation.js +0 -249
- package/lib-prod/translation.js.map +0 -1
- package/lib-prod/translation.models.d.ts +0 -25
- package/lib-prod/translation.models.js +0 -2
- package/lib-prod/translation.models.js.map +0 -1
- package/lib-prod/utils-i18n-extract-gettext-translate-from-html.d.ts +0 -2
- package/lib-prod/utils-i18n-extract-gettext-translate-from-html.js +0 -460
- package/lib-prod/utils-i18n-extract-gettext-translate-from-html.js.map +0 -1
- package/lib-prod/utils-i18n-extract-gettext-translate-from-html.test.d.ts +0 -1
- package/lib-prod/utils-i18n-extract-gettext-translate-from-html.test.js +0 -280
- package/lib-prod/utils-i18n-extract-gettext-translate-from-html.test.js.map +0 -1
- package/lib-prod/utils-i18n-html.d.ts +0 -3
- package/lib-prod/utils-i18n-html.js +0 -114
- package/lib-prod/utils-i18n-html.js.map +0 -1
- package/lib-prod/utils-i18n-html.test.d.ts +0 -1
- package/lib-prod/utils-i18n-html.test.js +0 -80
- package/lib-prod/utils-i18n-html.test.js.map +0 -1
- package/lib-prod/utils-po-file.d.ts +0 -6
- package/lib-prod/utils-po-file.js +0 -236
- package/lib-prod/utils-po-file.js.map +0 -1
- package/lib-prod/utils-po-file.test.d.ts +0 -1
- package/lib-prod/utils-po-file.test.js +0 -237
- package/lib-prod/utils-po-file.test.js.map +0 -1
- package/lib-prod.re-export.json +0 -1
- package/lib-prod.split-namespaces.json +0 -28
- package/scss/app/main-page/main-page.container.scss +0 -3
- package/scss/global.scss +0 -94
- package/scss/index.scss +0 -2
- package/scss/lib/index.scss +0 -2
- package/scss/vars.scss +0 -7
- package/src.js +0 -4
- package/websql/README.md +0 -24
- package/websql/fesm2022/i18n-websql.mjs +0 -1556
- package/websql/fesm2022/i18n-websql.mjs.map +0 -1
- package/websql/types/i18n-websql.d.ts +0 -194
- package/websql-prod/README.md +0 -24
- package/websql-prod/fesm2022/i18n-websql-prod.mjs +0 -1545
- package/websql-prod/fesm2022/i18n-websql-prod.mjs.map +0 -1
- package/websql-prod/types/i18n-websql-prod.d.ts +0 -188
- package/websql-prod.re-export.json +0 -1
- package/websql-prod.split-namespaces.json +0 -28
|
@@ -1,1545 +0,0 @@
|
|
|
1
|
-
import * as i0 from '@angular/core';
|
|
2
|
-
import { inject, ChangeDetectorRef, signal, ElementRef, DestroyRef, Input, Directive, Pipe, Injectable } from '@angular/core';
|
|
3
|
-
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
4
|
-
import { BehaviorSubject, tap, map } from 'rxjs';
|
|
5
|
-
import { UtilsI18n__NS__detectLocale, UtilsI18n__NS__defaultLangLocale, GlobalStorage, ___NS__cloneDeep, UtilsI18n__NS__LangOptionArr, ___NS__isObject } from 'tnp-core/browser-prod';
|
|
6
|
-
|
|
7
|
-
// THIS FILE IS GENERATED - DO NOT MODIFY
|
|
8
|
-
/**
|
|
9
|
-
* Autogenerated by current cli tool
|
|
10
|
-
*/
|
|
11
|
-
const BUILD_FRAMEWORK_CLI_NAME = 'tnp';
|
|
12
|
-
/**
|
|
13
|
-
* This value can be change in taon.jsonc (appId)
|
|
14
|
-
*/
|
|
15
|
-
const APP_ID = 'com.domain.example.i18n';
|
|
16
|
-
/**
|
|
17
|
-
* Autogenerated by current cli tool
|
|
18
|
-
*/
|
|
19
|
-
const BUILD_BASE_HREF = '';
|
|
20
|
-
/**
|
|
21
|
-
* This value can be change in taon.jsonc (overrideNpmName)
|
|
22
|
-
*/
|
|
23
|
-
const PROJECT_NPM_NAME = '@taon-dev/i18n';
|
|
24
|
-
/**
|
|
25
|
-
* Taon version from you project taon.json
|
|
26
|
-
*/
|
|
27
|
-
const CURRENT_PACKAGE_TAON_VERSION = 'v21';
|
|
28
|
-
/**
|
|
29
|
-
* Autogenerated by current cli tool. Use *tnp release* to bump version.
|
|
30
|
-
*/
|
|
31
|
-
const CURRENT_PACKAGE_VERSION = '21.0.7';
|
|
32
|
-
// THIS FILE IS GENERATED - DO NOT MODIFY
|
|
33
|
-
|
|
34
|
-
//#region tnp-helpers cli template
|
|
35
|
-
// import { CoreModels } from 'tnp-core/src';
|
|
36
|
-
// import { Helpers, BaseCommandLineFeature } from 'tnp-helpers/src';
|
|
37
|
-
// import { BaseProject, BaseStartConfig } from 'tnp-helpers/src'; // @backend
|
|
38
|
-
// class $Global extends BaseCommandLineFeature<{}> {
|
|
39
|
-
// static [CoreModels.ClassNameStaticProperty] = '';
|
|
40
|
-
// public _() {
|
|
41
|
-
// console.log(`Hello world from cli`);
|
|
42
|
-
// this._exit();
|
|
43
|
-
// }
|
|
44
|
-
// }
|
|
45
|
-
//#endregion
|
|
46
|
-
/**
|
|
47
|
-
*
|
|
48
|
-
* @param argsv process.argsv
|
|
49
|
-
* @param filename needed if you want ipc communicaiton
|
|
50
|
-
*/
|
|
51
|
-
async function startCli(argsv, filename) {
|
|
52
|
-
/* */
|
|
53
|
-
/* */
|
|
54
|
-
/* */
|
|
55
|
-
/* */
|
|
56
|
-
/* */
|
|
57
|
-
/* */
|
|
58
|
-
/* */
|
|
59
|
-
/* */
|
|
60
|
-
/* */
|
|
61
|
-
/* */
|
|
62
|
-
/* */
|
|
63
|
-
/* */
|
|
64
|
-
/* */
|
|
65
|
-
/* */
|
|
66
|
-
/* */
|
|
67
|
-
/* */
|
|
68
|
-
/* */
|
|
69
|
-
/* */
|
|
70
|
-
/* */
|
|
71
|
-
/* */
|
|
72
|
-
/* */
|
|
73
|
-
/* */
|
|
74
|
-
/* */
|
|
75
|
-
/* */
|
|
76
|
-
return (void 0);
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
//#region import
|
|
80
|
-
//#endregion
|
|
81
|
-
//#region constants
|
|
82
|
-
const globalStorageKeyMainLanguage = 'taon-gettext-main-language';
|
|
83
|
-
const globalTaonLanguageLocalKeyLocalStor = 'taon-language-local';
|
|
84
|
-
//#endregion
|
|
85
|
-
class TranslationManager {
|
|
86
|
-
constructor() {
|
|
87
|
-
this.instances = new Set();
|
|
88
|
-
//#region current global language
|
|
89
|
-
this.defaultLangLocale = (() => {
|
|
90
|
-
//#region @browser
|
|
91
|
-
return (localStorage.getItem(globalTaonLanguageLocalKeyLocalStor) ||
|
|
92
|
-
UtilsI18n__NS__detectLocale());
|
|
93
|
-
//#endregion
|
|
94
|
-
return UtilsI18n__NS__defaultLangLocale;
|
|
95
|
-
})();
|
|
96
|
-
this._currentGlobalLanguage = this
|
|
97
|
-
.defaultLangLocale;
|
|
98
|
-
this.currentGlobalLanguageSrc = new BehaviorSubject(this.currentGlobalLanguage);
|
|
99
|
-
this.currentGlobalLanguage$ = this.currentGlobalLanguageSrc
|
|
100
|
-
.asObservable()
|
|
101
|
-
.pipe(tap(currentGlobalLanguage => {
|
|
102
|
-
GlobalStorage.set(globalStorageKeyMainLanguage, currentGlobalLanguage);
|
|
103
|
-
// console.log(`Update from subject ${currentGlobalLanguage}`);
|
|
104
|
-
}));
|
|
105
|
-
//#endregion
|
|
106
|
-
//#region available langs
|
|
107
|
-
this.availableLangs = ___NS__cloneDeep(UtilsI18n__NS__LangOptionArr);
|
|
108
|
-
this.availableLangsSrc = new BehaviorSubject(this.availableLangs);
|
|
109
|
-
this.availableLangs$ = this.availableLangsSrc.asObservable().pipe(map(f => {
|
|
110
|
-
if (this.visibleLanguages.length > 0) {
|
|
111
|
-
// console.log('Filtering langs')
|
|
112
|
-
return f.filter(a => this.visibleLanguages.includes(a.code));
|
|
113
|
-
}
|
|
114
|
-
return f;
|
|
115
|
-
}));
|
|
116
|
-
//#endregion
|
|
117
|
-
//#region visible langs
|
|
118
|
-
this._visibleLanguages = [];
|
|
119
|
-
this.visibleLanguagesSrc = new BehaviorSubject(this.visibleLanguages);
|
|
120
|
-
this.visibleLanguages$ = this.visibleLanguagesSrc.asObservable();
|
|
121
|
-
//#endregion
|
|
122
|
-
//#region loading langs subject
|
|
123
|
-
/**
|
|
124
|
-
* TODO
|
|
125
|
-
*/
|
|
126
|
-
this.loadingLangsSubjectSrc = new BehaviorSubject(false);
|
|
127
|
-
/**
|
|
128
|
-
* TODO
|
|
129
|
-
*/
|
|
130
|
-
this.isLoadingLangs$ = this.loadingLangsSubjectSrc.asObservable();
|
|
131
|
-
//#endregion
|
|
132
|
-
this.pernamentLanguage = null;
|
|
133
|
-
// console.log(`[i18] Default lang: ${this.defaultLangLocale}`);
|
|
134
|
-
}
|
|
135
|
-
get currentGlobalLanguage() {
|
|
136
|
-
return this._currentGlobalLanguage;
|
|
137
|
-
}
|
|
138
|
-
set currentGlobalLanguage(v) {
|
|
139
|
-
this._currentGlobalLanguage = v;
|
|
140
|
-
this.currentGlobalLanguageSrc.next(v);
|
|
141
|
-
}
|
|
142
|
-
get visibleLanguages() {
|
|
143
|
-
return this._visibleLanguages;
|
|
144
|
-
}
|
|
145
|
-
set visibleLanguages(v) {
|
|
146
|
-
if (this.pernamentLanguage) {
|
|
147
|
-
v = v.filter(a => [this.pernamentLanguage].includes(a));
|
|
148
|
-
}
|
|
149
|
-
this._visibleLanguages = v;
|
|
150
|
-
this.visibleLanguagesSrc.next(v);
|
|
151
|
-
this.availableLangsSrc.next(this.availableLangs);
|
|
152
|
-
}
|
|
153
|
-
static get Instance() {
|
|
154
|
-
if (!this._instance) {
|
|
155
|
-
this._instance = new TranslationManager();
|
|
156
|
-
}
|
|
157
|
-
return this._instance;
|
|
158
|
-
}
|
|
159
|
-
setOneLanguagePernament(lang) {
|
|
160
|
-
console.info(`Setting pernament language to ${lang}`);
|
|
161
|
-
if (this.pernamentLanguage) {
|
|
162
|
-
console.log('You are trying to set again pernament language');
|
|
163
|
-
return;
|
|
164
|
-
}
|
|
165
|
-
this.visibleLanguages = [lang];
|
|
166
|
-
// @ts-ignore
|
|
167
|
-
this.pernamentLanguage = lang;
|
|
168
|
-
void this.changeGlobalLang(lang);
|
|
169
|
-
}
|
|
170
|
-
//#region change global lang
|
|
171
|
-
async changeGlobalLang(lang) {
|
|
172
|
-
this.loadingLangsSubjectSrc.next(true);
|
|
173
|
-
this.currentGlobalLanguage = lang;
|
|
174
|
-
localStorage.setItem(globalTaonLanguageLocalKeyLocalStor, lang);
|
|
175
|
-
try {
|
|
176
|
-
await Promise.all([...this.instances].map(c => c.useGlobalFileLang(lang)));
|
|
177
|
-
}
|
|
178
|
-
catch (error) {
|
|
179
|
-
console.error(error);
|
|
180
|
-
}
|
|
181
|
-
this.loadingLangsSubjectSrc.next(false);
|
|
182
|
-
// console.info('Done changing language');
|
|
183
|
-
}
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
//#region imports
|
|
187
|
-
//#endregion
|
|
188
|
-
//#region translation class
|
|
189
|
-
class Translation {
|
|
190
|
-
static { this.manager = TranslationManager.Instance; }
|
|
191
|
-
//#region static for
|
|
192
|
-
static for(fileRelativePath, langImportMap, opt) {
|
|
193
|
-
opt = opt || {};
|
|
194
|
-
return new Translation(fileRelativePath, Translation.manager.currentGlobalLanguage, langImportMap, !!opt.debug);
|
|
195
|
-
}
|
|
196
|
-
//#endregion
|
|
197
|
-
//#region constructor
|
|
198
|
-
constructor(fileRelativePath, localFileLang, langImportMap, debug = false) {
|
|
199
|
-
this.fileRelativePath = fileRelativePath;
|
|
200
|
-
this.localFileLang = localFileLang;
|
|
201
|
-
this.langImportMap = langImportMap;
|
|
202
|
-
this.debug = debug;
|
|
203
|
-
//#endregion
|
|
204
|
-
this.lookup = {};
|
|
205
|
-
this.loadingSubjectSrc = new BehaviorSubject(false);
|
|
206
|
-
this.isLoadingLang$ = this.loadingSubjectSrc.asObservable();
|
|
207
|
-
this.bindings = new Set();
|
|
208
|
-
this.useGlobalLangFile = true;
|
|
209
|
-
//#endregion
|
|
210
|
-
//#region gettext
|
|
211
|
-
this.gettext = (text, params, context = '') => {
|
|
212
|
-
const key = this.key(text, context);
|
|
213
|
-
const translated = this.lookup[key] ?? text;
|
|
214
|
-
this.debug &&
|
|
215
|
-
console.log(`Translate (with load): "${text}" to "${translated}", key="${key}" params:${___NS__isObject(params) ? JSON.stringify(params) : params} ` +
|
|
216
|
-
`localFileLang: ${this.localFileLang}`, this);
|
|
217
|
-
return this.interpolate(translated, params);
|
|
218
|
-
};
|
|
219
|
-
this.signal = {
|
|
220
|
-
gettext: (text, params, context) => this.createSignal(text, params, context),
|
|
221
|
-
};
|
|
222
|
-
this.$ = {
|
|
223
|
-
gettext: (text, params, context) => this.createObservable(text, params, context),
|
|
224
|
-
};
|
|
225
|
-
if (!Translation.manager.instances.has(this)) {
|
|
226
|
-
Translation.manager.instances.add(this);
|
|
227
|
-
}
|
|
228
|
-
}
|
|
229
|
-
//#endregion
|
|
230
|
-
//#region for
|
|
231
|
-
for(_classThis) {
|
|
232
|
-
//#region @browser
|
|
233
|
-
if (this.useGlobalFileLang) {
|
|
234
|
-
this.localFileLang = Translation.manager.currentGlobalLanguage;
|
|
235
|
-
// console.log(`Update on t.for() ${this.localFileLang}`)
|
|
236
|
-
}
|
|
237
|
-
try {
|
|
238
|
-
this.cdr = inject(ChangeDetectorRef);
|
|
239
|
-
}
|
|
240
|
-
catch {
|
|
241
|
-
// non-angular class/backend-safe
|
|
242
|
-
}
|
|
243
|
-
//#endregion
|
|
244
|
-
void this.ensureLoaded();
|
|
245
|
-
return this;
|
|
246
|
-
}
|
|
247
|
-
//#endregion
|
|
248
|
-
//#region change file lang
|
|
249
|
-
async changeFileLang(lang) {
|
|
250
|
-
this.useGlobalLangFile = false;
|
|
251
|
-
this.localFileLang = lang;
|
|
252
|
-
await this.ensureLoaded(true);
|
|
253
|
-
//#region @browser
|
|
254
|
-
this.cdr?.markForCheck();
|
|
255
|
-
//#endregion
|
|
256
|
-
}
|
|
257
|
-
//#endregion
|
|
258
|
-
//#region use global file lang
|
|
259
|
-
async useGlobalFileLang(lang) {
|
|
260
|
-
this.useGlobalLangFile = true;
|
|
261
|
-
await this.ensureLoaded(true);
|
|
262
|
-
//#region @browser
|
|
263
|
-
this.cdr?.markForCheck();
|
|
264
|
-
//#endregion
|
|
265
|
-
}
|
|
266
|
-
//#endregion
|
|
267
|
-
//#region signal
|
|
268
|
-
createSignal(text, params, context = '') {
|
|
269
|
-
const s = signal(this.gettext(text, params, context), ...(ngDevMode ? [{ debugName: "s" }] : []));
|
|
270
|
-
this.bindings.add({
|
|
271
|
-
text,
|
|
272
|
-
params,
|
|
273
|
-
context,
|
|
274
|
-
update: value => s.set(value),
|
|
275
|
-
});
|
|
276
|
-
return s;
|
|
277
|
-
}
|
|
278
|
-
//#endregion
|
|
279
|
-
//#region $ obserable
|
|
280
|
-
createObservable(text, params, context = '') {
|
|
281
|
-
const subject = new BehaviorSubject(this.gettext(text, params, context));
|
|
282
|
-
this.bindings.add({
|
|
283
|
-
text,
|
|
284
|
-
params,
|
|
285
|
-
context,
|
|
286
|
-
update: value => subject.next(value),
|
|
287
|
-
});
|
|
288
|
-
return subject.asObservable();
|
|
289
|
-
}
|
|
290
|
-
//#endregion
|
|
291
|
-
//#region private methods / refresh bindings
|
|
292
|
-
refreshBindings() {
|
|
293
|
-
for (const binding of this.bindings) {
|
|
294
|
-
binding.update(this.gettextWithoutEnsureLoaded(binding.text, binding.params, binding.context ?? ''));
|
|
295
|
-
}
|
|
296
|
-
}
|
|
297
|
-
//#endregion
|
|
298
|
-
//#region private methods / gettextwithout ensure loadded
|
|
299
|
-
translate(text, params, context = '') {
|
|
300
|
-
return this.gettextWithoutEnsureLoaded(text, params, context);
|
|
301
|
-
}
|
|
302
|
-
gettextWithoutEnsureLoaded(text, params, context = '') {
|
|
303
|
-
const key = this.key(text, context);
|
|
304
|
-
const translated = this.lookup[key] ?? text;
|
|
305
|
-
this.debug &&
|
|
306
|
-
console.log(`Translate (no load): "${text}" to "${translated}", key="${key}" params:${___NS__isObject(params) ? JSON.stringify(params) : params} ` +
|
|
307
|
-
`localFileLang: ${this.localFileLang}`, this);
|
|
308
|
-
return this.interpolate(translated, params);
|
|
309
|
-
}
|
|
310
|
-
//#endregion
|
|
311
|
-
//#region private methods / load
|
|
312
|
-
async load() {
|
|
313
|
-
this.loadingSubjectSrc.next(true);
|
|
314
|
-
const files = [];
|
|
315
|
-
const filesForTArr = Object.keys(this.langImportMap);
|
|
316
|
-
for (const fileRelativePath of filesForTArr) {
|
|
317
|
-
try {
|
|
318
|
-
const loader = this.langImportMap[fileRelativePath]?.[this.localFileLang];
|
|
319
|
-
if (!loader) {
|
|
320
|
-
continue;
|
|
321
|
-
}
|
|
322
|
-
const modOrFile = await loader();
|
|
323
|
-
const file = modOrFile.default ?? modOrFile;
|
|
324
|
-
files.push(file);
|
|
325
|
-
}
|
|
326
|
-
catch (err) {
|
|
327
|
-
console.log(`[taon-i18n] Error loading language file ${fileRelativePath} `, err);
|
|
328
|
-
}
|
|
329
|
-
}
|
|
330
|
-
this.loadedLang = this.localFileLang;
|
|
331
|
-
this.lookup = this.createLookup(files);
|
|
332
|
-
this.debug && console.log(`${this.localFileLang}`, files, this.lookup);
|
|
333
|
-
this.refreshBindings();
|
|
334
|
-
//#region @browser
|
|
335
|
-
this.cdr?.markForCheck();
|
|
336
|
-
//#endregion
|
|
337
|
-
this.loadingSubjectSrc.next(false);
|
|
338
|
-
}
|
|
339
|
-
//#endregion
|
|
340
|
-
//#region private methods / ensure loaded
|
|
341
|
-
async ensureLoaded(force = false) {
|
|
342
|
-
if (this.useGlobalLangFile) {
|
|
343
|
-
this.localFileLang = Translation.manager.currentGlobalLanguage;
|
|
344
|
-
}
|
|
345
|
-
if (!force && this.loadedLang === this.localFileLang) {
|
|
346
|
-
return;
|
|
347
|
-
}
|
|
348
|
-
if (!force && this.loading) {
|
|
349
|
-
return this.loading;
|
|
350
|
-
}
|
|
351
|
-
this.loading = this.load();
|
|
352
|
-
try {
|
|
353
|
-
await this.loading;
|
|
354
|
-
}
|
|
355
|
-
finally {
|
|
356
|
-
this.loading = undefined;
|
|
357
|
-
}
|
|
358
|
-
}
|
|
359
|
-
//#endregion
|
|
360
|
-
//#region private methods / create lookup
|
|
361
|
-
createLookup(files) {
|
|
362
|
-
const lookup = {};
|
|
363
|
-
for (const file of files) {
|
|
364
|
-
for (const tag of file.tags ?? []) {
|
|
365
|
-
if (!tag.translation)
|
|
366
|
-
continue;
|
|
367
|
-
lookup[this.key(tag.gettextString, tag.context ?? '')] =
|
|
368
|
-
tag.translation;
|
|
369
|
-
}
|
|
370
|
-
}
|
|
371
|
-
return lookup;
|
|
372
|
-
}
|
|
373
|
-
//#endregion
|
|
374
|
-
//#region private methods / key
|
|
375
|
-
key(text, context = '') {
|
|
376
|
-
return `${context}\u0004${text}`;
|
|
377
|
-
}
|
|
378
|
-
//#endregion
|
|
379
|
-
//#region private methods / interpolate
|
|
380
|
-
interpolate(text, params) {
|
|
381
|
-
if (!params)
|
|
382
|
-
return text;
|
|
383
|
-
const result = text.replace(/\[\[\s*([a-zA-Z0-9_$]+)\s*\]\]/g, (_, key) => {
|
|
384
|
-
const value = params[key];
|
|
385
|
-
return value === undefined || value === null ? '' : String(value);
|
|
386
|
-
});
|
|
387
|
-
return result;
|
|
388
|
-
}
|
|
389
|
-
}
|
|
390
|
-
//#endregion
|
|
391
|
-
//#region EXMAPLE
|
|
392
|
-
/*
|
|
393
|
-
// import {Translation} from 'taon'
|
|
394
|
-
|
|
395
|
-
const t = Translation.for('src/lib/translation.ts', {}); // in runtime replaced with proper stuff
|
|
396
|
-
|
|
397
|
-
t.gettext('asdasd');
|
|
398
|
-
|
|
399
|
-
class AnyAngularOrTaonClass {
|
|
400
|
-
t = t.for(this); // probably only usefull for cdr in angular
|
|
401
|
-
|
|
402
|
-
isLoading$ = t.isLoadingLang$; // maybe needed sometime
|
|
403
|
-
|
|
404
|
-
refreshableSignalLabel$ = t.signal.gettext(t.gettext('welcome'));
|
|
405
|
-
|
|
406
|
-
refreshableRxjsLabel$ = t.$.gettext('amazing better place'); // probably even better
|
|
407
|
-
|
|
408
|
-
asdsa = this.t.gettext(
|
|
409
|
-
// just sugar syntax
|
|
410
|
-
'This is mamazing',
|
|
411
|
-
{
|
|
412
|
-
asdasd: 'asd',
|
|
413
|
-
},
|
|
414
|
-
'asdas',
|
|
415
|
-
);
|
|
416
|
-
|
|
417
|
-
ngOnInit(): void {
|
|
418
|
-
//Called after the constructor, initializing input properties, and the first call to ngOnChanges.
|
|
419
|
-
//Add 'implements OnInit' to the class.
|
|
420
|
-
const lable = t.gettext('hello');
|
|
421
|
-
}
|
|
422
|
-
}
|
|
423
|
-
*/
|
|
424
|
-
//#endregion
|
|
425
|
-
|
|
426
|
-
class TranslateDirective {
|
|
427
|
-
constructor() {
|
|
428
|
-
this.initialized = false;
|
|
429
|
-
this.element = inject((ElementRef));
|
|
430
|
-
this.destroyRef = inject(DestroyRef);
|
|
431
|
-
this.originalText = '';
|
|
432
|
-
}
|
|
433
|
-
ngOnInit() {
|
|
434
|
-
this.originalText = this.element.nativeElement.textContent?.trim() ?? '';
|
|
435
|
-
this.initialized = true;
|
|
436
|
-
this.render();
|
|
437
|
-
this.t.isLoadingLang$
|
|
438
|
-
.pipe(takeUntilDestroyed(this.destroyRef))
|
|
439
|
-
.subscribe(() => {
|
|
440
|
-
// this.t.debug && console.log(`Rerender "${this.originalText}"`)
|
|
441
|
-
this.render();
|
|
442
|
-
});
|
|
443
|
-
}
|
|
444
|
-
ngOnChanges() {
|
|
445
|
-
if (!this.initialized)
|
|
446
|
-
return;
|
|
447
|
-
// this.t.debug && console.log(`On Chnags for "${this.originalText}"`)
|
|
448
|
-
this.render();
|
|
449
|
-
}
|
|
450
|
-
ngOnDestroy() { }
|
|
451
|
-
render() {
|
|
452
|
-
// console.log('render', this);
|
|
453
|
-
this.element.nativeElement.textContent = this.t.translate(this.originalText, this.params, this.translateContext);
|
|
454
|
-
//#region @browser
|
|
455
|
-
// this.t.cdr?.markForCheck();
|
|
456
|
-
//#endregion
|
|
457
|
-
}
|
|
458
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.9", ngImport: i0, type: TranslateDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
459
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.0.9", type: TranslateDirective, isStandalone: true, selector: "[translate]", inputs: { t: ["translate-t", "t"], params: ["translate-params", "params"], translateContext: ["translate-context", "translateContext"] }, usesOnChanges: true, ngImport: i0 }); }
|
|
460
|
-
}
|
|
461
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.9", ngImport: i0, type: TranslateDirective, decorators: [{
|
|
462
|
-
type: Directive,
|
|
463
|
-
args: [{
|
|
464
|
-
selector: '[translate]',
|
|
465
|
-
standalone: true,
|
|
466
|
-
}]
|
|
467
|
-
}], propDecorators: { t: [{
|
|
468
|
-
type: Input,
|
|
469
|
-
args: ['translate-t']
|
|
470
|
-
}], params: [{
|
|
471
|
-
type: Input,
|
|
472
|
-
args: ['translate-params']
|
|
473
|
-
}], translateContext: [{
|
|
474
|
-
type: Input,
|
|
475
|
-
args: ['translate-context']
|
|
476
|
-
}] } });
|
|
477
|
-
|
|
478
|
-
class TranslatePipe {
|
|
479
|
-
constructor() {
|
|
480
|
-
this.cdr = inject(ChangeDetectorRef);
|
|
481
|
-
this.tranlsationManager = TranslationManager.Instance;
|
|
482
|
-
this.sub = this.tranlsationManager.isLoadingLangs$.subscribe(() => {
|
|
483
|
-
this.cdr.markForCheck();
|
|
484
|
-
});
|
|
485
|
-
}
|
|
486
|
-
transform(text, t, params, context) {
|
|
487
|
-
return t?.gettext(text, params, context) ?? text;
|
|
488
|
-
}
|
|
489
|
-
ngOnDestroy() {
|
|
490
|
-
this.sub.unsubscribe();
|
|
491
|
-
}
|
|
492
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.9", ngImport: i0, type: TranslatePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
|
|
493
|
-
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "21.0.9", ngImport: i0, type: TranslatePipe, isStandalone: true, name: "translate", pure: false }); }
|
|
494
|
-
}
|
|
495
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.9", ngImport: i0, type: TranslatePipe, decorators: [{
|
|
496
|
-
type: Pipe,
|
|
497
|
-
args: [{
|
|
498
|
-
name: 'translate',
|
|
499
|
-
standalone: true,
|
|
500
|
-
pure: false,
|
|
501
|
-
}]
|
|
502
|
-
}], ctorParameters: () => [] });
|
|
503
|
-
|
|
504
|
-
class TranslateService {
|
|
505
|
-
constructor() {
|
|
506
|
-
this.manager = TranslationManager.Instance;
|
|
507
|
-
/**
|
|
508
|
-
* TODO
|
|
509
|
-
*/
|
|
510
|
-
this.isLoadingLangs$ = this.manager.isLoadingLangs$;
|
|
511
|
-
this.availableLangs$ = this.manager.availableLangs$;
|
|
512
|
-
this.currentGlobalLanguage$ = this.manager.currentGlobalLanguage$;
|
|
513
|
-
}
|
|
514
|
-
setOneLanguagePernament(lang) {
|
|
515
|
-
this.manager.setOneLanguagePernament(lang);
|
|
516
|
-
}
|
|
517
|
-
//#region change global lang
|
|
518
|
-
async changeGlobalLang(lang) {
|
|
519
|
-
await this.manager.changeGlobalLang(lang);
|
|
520
|
-
}
|
|
521
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.9", ngImport: i0, type: TranslateService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
522
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.0.9", ngImport: i0, type: TranslateService, providedIn: 'root' }); }
|
|
523
|
-
}
|
|
524
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.9", ngImport: i0, type: TranslateService, decorators: [{
|
|
525
|
-
type: Injectable,
|
|
526
|
-
args: [{ providedIn: 'root' }]
|
|
527
|
-
}] });
|
|
528
|
-
|
|
529
|
-
//#endregion
|
|
530
|
-
//namespace UtilsI18nExtractGettextTranslateFromHtml
|
|
531
|
-
function UtilsI18nExtractGettextTranslateFromHtml__NS__extractGettextTranslateFromHtml(html, fileName = 'template.html') {
|
|
532
|
-
/* */
|
|
533
|
-
/* */
|
|
534
|
-
/* */
|
|
535
|
-
/* */
|
|
536
|
-
/* */
|
|
537
|
-
/* */
|
|
538
|
-
/* */
|
|
539
|
-
/* */
|
|
540
|
-
/* */
|
|
541
|
-
/* */
|
|
542
|
-
/* */
|
|
543
|
-
/* */
|
|
544
|
-
/* */
|
|
545
|
-
/* */
|
|
546
|
-
/* */
|
|
547
|
-
/* */
|
|
548
|
-
/* */
|
|
549
|
-
/* */
|
|
550
|
-
/* */
|
|
551
|
-
/* */
|
|
552
|
-
/* */
|
|
553
|
-
/* */
|
|
554
|
-
/* */
|
|
555
|
-
/* */
|
|
556
|
-
/* */
|
|
557
|
-
/* */
|
|
558
|
-
/* */
|
|
559
|
-
/* */
|
|
560
|
-
/* */
|
|
561
|
-
/* */
|
|
562
|
-
/* */
|
|
563
|
-
/* */
|
|
564
|
-
/* */
|
|
565
|
-
/* */
|
|
566
|
-
/* */
|
|
567
|
-
/* */
|
|
568
|
-
/* */
|
|
569
|
-
/* */
|
|
570
|
-
/* */
|
|
571
|
-
/* */
|
|
572
|
-
/* */
|
|
573
|
-
/* */
|
|
574
|
-
/* */
|
|
575
|
-
/* */
|
|
576
|
-
/* */
|
|
577
|
-
/* */
|
|
578
|
-
/* */
|
|
579
|
-
/* */
|
|
580
|
-
/* */
|
|
581
|
-
/* */
|
|
582
|
-
/* */
|
|
583
|
-
/* */
|
|
584
|
-
/* */
|
|
585
|
-
/* */
|
|
586
|
-
/* */
|
|
587
|
-
/* */
|
|
588
|
-
/* */
|
|
589
|
-
/* */
|
|
590
|
-
/* */
|
|
591
|
-
/* */
|
|
592
|
-
/* */
|
|
593
|
-
/* */
|
|
594
|
-
/* */
|
|
595
|
-
/* */
|
|
596
|
-
/* */
|
|
597
|
-
/* */
|
|
598
|
-
/* */
|
|
599
|
-
/* */
|
|
600
|
-
/* */
|
|
601
|
-
/* */
|
|
602
|
-
/* */
|
|
603
|
-
/* */
|
|
604
|
-
/* */
|
|
605
|
-
/* */
|
|
606
|
-
/* */
|
|
607
|
-
/* */
|
|
608
|
-
/* */
|
|
609
|
-
/* */
|
|
610
|
-
/* */
|
|
611
|
-
/* */
|
|
612
|
-
/* */
|
|
613
|
-
/* */
|
|
614
|
-
/* */
|
|
615
|
-
/* */
|
|
616
|
-
/* */
|
|
617
|
-
/* */
|
|
618
|
-
/* */
|
|
619
|
-
/* */
|
|
620
|
-
/* */
|
|
621
|
-
/* */
|
|
622
|
-
/* */
|
|
623
|
-
/* */
|
|
624
|
-
/* */
|
|
625
|
-
return (void 0);
|
|
626
|
-
}
|
|
627
|
-
function extractGettextCallsFromSource(html) {
|
|
628
|
-
/* */
|
|
629
|
-
/* */
|
|
630
|
-
/* */
|
|
631
|
-
/* */
|
|
632
|
-
/* */
|
|
633
|
-
/* */
|
|
634
|
-
/* */
|
|
635
|
-
/* */
|
|
636
|
-
/* */
|
|
637
|
-
/* */
|
|
638
|
-
/* */
|
|
639
|
-
/* */
|
|
640
|
-
/* */
|
|
641
|
-
/* */
|
|
642
|
-
/* */
|
|
643
|
-
/* */
|
|
644
|
-
/* */
|
|
645
|
-
/* */
|
|
646
|
-
/* */
|
|
647
|
-
/* */
|
|
648
|
-
/* */
|
|
649
|
-
/* */
|
|
650
|
-
/* */
|
|
651
|
-
/* */
|
|
652
|
-
/* */
|
|
653
|
-
/* */
|
|
654
|
-
/* */
|
|
655
|
-
return (void 0);
|
|
656
|
-
}
|
|
657
|
-
function extractGettextCallsFromHtmlExpression(source) {
|
|
658
|
-
/* */
|
|
659
|
-
/* */
|
|
660
|
-
/* */
|
|
661
|
-
/* */
|
|
662
|
-
/* */
|
|
663
|
-
/* */
|
|
664
|
-
/* */
|
|
665
|
-
/* */
|
|
666
|
-
/* */
|
|
667
|
-
/* */
|
|
668
|
-
/* */
|
|
669
|
-
/* */
|
|
670
|
-
/* */
|
|
671
|
-
/* */
|
|
672
|
-
/* */
|
|
673
|
-
/* */
|
|
674
|
-
/* */
|
|
675
|
-
/* */
|
|
676
|
-
/* */
|
|
677
|
-
/* */
|
|
678
|
-
/* */
|
|
679
|
-
/* */
|
|
680
|
-
/* */
|
|
681
|
-
/* */
|
|
682
|
-
/* */
|
|
683
|
-
/* */
|
|
684
|
-
/* */
|
|
685
|
-
/* */
|
|
686
|
-
/* */
|
|
687
|
-
/* */
|
|
688
|
-
/* */
|
|
689
|
-
/* */
|
|
690
|
-
/* */
|
|
691
|
-
/* */
|
|
692
|
-
/* */
|
|
693
|
-
/* */
|
|
694
|
-
return (void 0);
|
|
695
|
-
}
|
|
696
|
-
function readBalancedParenthesesContent(source, openParenIndex) {
|
|
697
|
-
/* */
|
|
698
|
-
/* */
|
|
699
|
-
/* */
|
|
700
|
-
/* */
|
|
701
|
-
/* */
|
|
702
|
-
/* */
|
|
703
|
-
/* */
|
|
704
|
-
/* */
|
|
705
|
-
/* */
|
|
706
|
-
/* */
|
|
707
|
-
/* */
|
|
708
|
-
/* */
|
|
709
|
-
/* */
|
|
710
|
-
/* */
|
|
711
|
-
/* */
|
|
712
|
-
/* */
|
|
713
|
-
/* */
|
|
714
|
-
/* */
|
|
715
|
-
/* */
|
|
716
|
-
/* */
|
|
717
|
-
/* */
|
|
718
|
-
/* */
|
|
719
|
-
/* */
|
|
720
|
-
/* */
|
|
721
|
-
/* */
|
|
722
|
-
/* */
|
|
723
|
-
/* */
|
|
724
|
-
/* */
|
|
725
|
-
/* */
|
|
726
|
-
/* */
|
|
727
|
-
/* */
|
|
728
|
-
/* */
|
|
729
|
-
/* */
|
|
730
|
-
/* */
|
|
731
|
-
/* */
|
|
732
|
-
/* */
|
|
733
|
-
/* */
|
|
734
|
-
/* */
|
|
735
|
-
/* */
|
|
736
|
-
/* */
|
|
737
|
-
/* */
|
|
738
|
-
/* */
|
|
739
|
-
/* */
|
|
740
|
-
/* */
|
|
741
|
-
/* */
|
|
742
|
-
/* */
|
|
743
|
-
/* */
|
|
744
|
-
/* */
|
|
745
|
-
return (void 0);
|
|
746
|
-
}
|
|
747
|
-
function readStaticStringArg(arg) {
|
|
748
|
-
/* */
|
|
749
|
-
/* */
|
|
750
|
-
/* */
|
|
751
|
-
/* */
|
|
752
|
-
/* */
|
|
753
|
-
/* */
|
|
754
|
-
/* */
|
|
755
|
-
/* */
|
|
756
|
-
/* */
|
|
757
|
-
/* */
|
|
758
|
-
/* */
|
|
759
|
-
/* */
|
|
760
|
-
/* */
|
|
761
|
-
/* */
|
|
762
|
-
/* */
|
|
763
|
-
/* */
|
|
764
|
-
return (void 0);
|
|
765
|
-
}
|
|
766
|
-
function extractTranslateParamsFromSource(source) {
|
|
767
|
-
/* */
|
|
768
|
-
/* */
|
|
769
|
-
/* */
|
|
770
|
-
/* */
|
|
771
|
-
/* */
|
|
772
|
-
/* */
|
|
773
|
-
return (void 0);
|
|
774
|
-
}
|
|
775
|
-
function extractObjectLiteralParams(raw) {
|
|
776
|
-
/* */
|
|
777
|
-
/* */
|
|
778
|
-
/* */
|
|
779
|
-
/* */
|
|
780
|
-
/* */
|
|
781
|
-
/* */
|
|
782
|
-
/* */
|
|
783
|
-
/* */
|
|
784
|
-
/* */
|
|
785
|
-
/* */
|
|
786
|
-
/* */
|
|
787
|
-
/* */
|
|
788
|
-
/* */
|
|
789
|
-
/* */
|
|
790
|
-
/* */
|
|
791
|
-
/* */
|
|
792
|
-
/* */
|
|
793
|
-
/* */
|
|
794
|
-
/* */
|
|
795
|
-
/* */
|
|
796
|
-
/* */
|
|
797
|
-
/* */
|
|
798
|
-
/* */
|
|
799
|
-
return (void 0);
|
|
800
|
-
}
|
|
801
|
-
function splitTopLevel(input, separator) {
|
|
802
|
-
/* */
|
|
803
|
-
/* */
|
|
804
|
-
/* */
|
|
805
|
-
/* */
|
|
806
|
-
/* */
|
|
807
|
-
/* */
|
|
808
|
-
/* */
|
|
809
|
-
/* */
|
|
810
|
-
/* */
|
|
811
|
-
/* */
|
|
812
|
-
/* */
|
|
813
|
-
/* */
|
|
814
|
-
/* */
|
|
815
|
-
/* */
|
|
816
|
-
/* */
|
|
817
|
-
/* */
|
|
818
|
-
/* */
|
|
819
|
-
/* */
|
|
820
|
-
/* */
|
|
821
|
-
/* */
|
|
822
|
-
/* */
|
|
823
|
-
/* */
|
|
824
|
-
/* */
|
|
825
|
-
/* */
|
|
826
|
-
/* */
|
|
827
|
-
/* */
|
|
828
|
-
/* */
|
|
829
|
-
/* */
|
|
830
|
-
/* */
|
|
831
|
-
/* */
|
|
832
|
-
/* */
|
|
833
|
-
/* */
|
|
834
|
-
/* */
|
|
835
|
-
/* */
|
|
836
|
-
/* */
|
|
837
|
-
/* */
|
|
838
|
-
return (void 0);
|
|
839
|
-
}
|
|
840
|
-
function extractTranslatePipeStringsFromSource(source) {
|
|
841
|
-
/* */
|
|
842
|
-
/* */
|
|
843
|
-
/* */
|
|
844
|
-
/* */
|
|
845
|
-
/* */
|
|
846
|
-
/* */
|
|
847
|
-
/* */
|
|
848
|
-
/* */
|
|
849
|
-
/* */
|
|
850
|
-
/* */
|
|
851
|
-
/* */
|
|
852
|
-
/* */
|
|
853
|
-
/* */
|
|
854
|
-
/* */
|
|
855
|
-
/* */
|
|
856
|
-
/* */
|
|
857
|
-
/* */
|
|
858
|
-
/* */
|
|
859
|
-
/* */
|
|
860
|
-
/* */
|
|
861
|
-
/* */
|
|
862
|
-
/* */
|
|
863
|
-
/* */
|
|
864
|
-
/* */
|
|
865
|
-
/* */
|
|
866
|
-
/* */
|
|
867
|
-
return (void 0);
|
|
868
|
-
}
|
|
869
|
-
function extractStringLiterals(source) {
|
|
870
|
-
/* */
|
|
871
|
-
/* */
|
|
872
|
-
/* */
|
|
873
|
-
/* */
|
|
874
|
-
/* */
|
|
875
|
-
/* */
|
|
876
|
-
/* */
|
|
877
|
-
/* */
|
|
878
|
-
/* */
|
|
879
|
-
return (void 0);
|
|
880
|
-
}
|
|
881
|
-
function getNodeAttributes(node) {
|
|
882
|
-
/* */
|
|
883
|
-
/* */
|
|
884
|
-
/* */
|
|
885
|
-
/* */
|
|
886
|
-
/* */
|
|
887
|
-
return (void 0);
|
|
888
|
-
}
|
|
889
|
-
function getNodeInputs(node) {
|
|
890
|
-
/* */
|
|
891
|
-
/* */
|
|
892
|
-
/* */
|
|
893
|
-
/* */
|
|
894
|
-
/* */
|
|
895
|
-
return (void 0);
|
|
896
|
-
}
|
|
897
|
-
function isText(node) {
|
|
898
|
-
/* */
|
|
899
|
-
/* */
|
|
900
|
-
/* */
|
|
901
|
-
/* */
|
|
902
|
-
return (void 0);
|
|
903
|
-
}
|
|
904
|
-
function isBoundText(node) {
|
|
905
|
-
/* */
|
|
906
|
-
/* */
|
|
907
|
-
return (void 0);
|
|
908
|
-
}
|
|
909
|
-
function collectText(nodes) {
|
|
910
|
-
/* */
|
|
911
|
-
/* */
|
|
912
|
-
/* */
|
|
913
|
-
/* */
|
|
914
|
-
/* */
|
|
915
|
-
/* */
|
|
916
|
-
/* */
|
|
917
|
-
/* */
|
|
918
|
-
/* */
|
|
919
|
-
/* */
|
|
920
|
-
/* */
|
|
921
|
-
/* */
|
|
922
|
-
/* */
|
|
923
|
-
/* */
|
|
924
|
-
/* */
|
|
925
|
-
/* */
|
|
926
|
-
/* */
|
|
927
|
-
/* */
|
|
928
|
-
/* */
|
|
929
|
-
/* */
|
|
930
|
-
return (void 0);
|
|
931
|
-
}
|
|
932
|
-
function extractTranslateDirectiveFromSource(html) {
|
|
933
|
-
/* */
|
|
934
|
-
/* */
|
|
935
|
-
/* */
|
|
936
|
-
/* */
|
|
937
|
-
/* */
|
|
938
|
-
/* */
|
|
939
|
-
/* */
|
|
940
|
-
/* */
|
|
941
|
-
/* */
|
|
942
|
-
/* */
|
|
943
|
-
/* */
|
|
944
|
-
/* */
|
|
945
|
-
/* */
|
|
946
|
-
/* */
|
|
947
|
-
/* */
|
|
948
|
-
/* */
|
|
949
|
-
/* */
|
|
950
|
-
/* */
|
|
951
|
-
/* */
|
|
952
|
-
/* */
|
|
953
|
-
/* */
|
|
954
|
-
/* */
|
|
955
|
-
/* */
|
|
956
|
-
/* */
|
|
957
|
-
/* */
|
|
958
|
-
/* */
|
|
959
|
-
/* */
|
|
960
|
-
/* */
|
|
961
|
-
return (void 0);
|
|
962
|
-
}
|
|
963
|
-
function stripHtml(html) {
|
|
964
|
-
/* */
|
|
965
|
-
/* */
|
|
966
|
-
return (void 0);
|
|
967
|
-
}
|
|
968
|
-
function extractTranslateParams(inputs) {
|
|
969
|
-
/* */
|
|
970
|
-
/* */
|
|
971
|
-
/* */
|
|
972
|
-
/* */
|
|
973
|
-
/* */
|
|
974
|
-
/* */
|
|
975
|
-
/* */
|
|
976
|
-
/* */
|
|
977
|
-
return (void 0);
|
|
978
|
-
}
|
|
979
|
-
function extractObjectLiteralFromAst(ast) {
|
|
980
|
-
/* */
|
|
981
|
-
/* */
|
|
982
|
-
/* */
|
|
983
|
-
/* */
|
|
984
|
-
/* */
|
|
985
|
-
/* */
|
|
986
|
-
/* */
|
|
987
|
-
/* */
|
|
988
|
-
/* */
|
|
989
|
-
/* */
|
|
990
|
-
/* */
|
|
991
|
-
/* */
|
|
992
|
-
/* */
|
|
993
|
-
/* */
|
|
994
|
-
/* */
|
|
995
|
-
return (void 0);
|
|
996
|
-
}
|
|
997
|
-
function extractTranslatePipeStrings(ast) {
|
|
998
|
-
/* */
|
|
999
|
-
/* */
|
|
1000
|
-
/* */
|
|
1001
|
-
/* */
|
|
1002
|
-
/* */
|
|
1003
|
-
/* */
|
|
1004
|
-
/* */
|
|
1005
|
-
/* */
|
|
1006
|
-
/* */
|
|
1007
|
-
/* */
|
|
1008
|
-
/* */
|
|
1009
|
-
/* */
|
|
1010
|
-
/* */
|
|
1011
|
-
/* */
|
|
1012
|
-
/* */
|
|
1013
|
-
/* */
|
|
1014
|
-
/* */
|
|
1015
|
-
/* */
|
|
1016
|
-
/* */
|
|
1017
|
-
/* */
|
|
1018
|
-
/* */
|
|
1019
|
-
/* */
|
|
1020
|
-
/* */
|
|
1021
|
-
/* */
|
|
1022
|
-
/* */
|
|
1023
|
-
/* */
|
|
1024
|
-
return (void 0);
|
|
1025
|
-
}
|
|
1026
|
-
function extractStaticStringsFromExpression(ast) {
|
|
1027
|
-
/* */
|
|
1028
|
-
/* */
|
|
1029
|
-
/* */
|
|
1030
|
-
/* */
|
|
1031
|
-
/* */
|
|
1032
|
-
/* */
|
|
1033
|
-
/* */
|
|
1034
|
-
/* */
|
|
1035
|
-
/* */
|
|
1036
|
-
/* */
|
|
1037
|
-
/* */
|
|
1038
|
-
/* */
|
|
1039
|
-
/* */
|
|
1040
|
-
/* */
|
|
1041
|
-
/* */
|
|
1042
|
-
/* */
|
|
1043
|
-
/* */
|
|
1044
|
-
/* */
|
|
1045
|
-
/* */
|
|
1046
|
-
/* */
|
|
1047
|
-
/* */
|
|
1048
|
-
/* */
|
|
1049
|
-
return (void 0);
|
|
1050
|
-
}
|
|
1051
|
-
function astToSource(ast) {
|
|
1052
|
-
/* */
|
|
1053
|
-
/* */
|
|
1054
|
-
/* */
|
|
1055
|
-
/* */
|
|
1056
|
-
/* */
|
|
1057
|
-
/* */
|
|
1058
|
-
/* */
|
|
1059
|
-
/* */
|
|
1060
|
-
/* */
|
|
1061
|
-
/* */
|
|
1062
|
-
/* */
|
|
1063
|
-
/* */
|
|
1064
|
-
/* */
|
|
1065
|
-
/* */
|
|
1066
|
-
/* */
|
|
1067
|
-
/* */
|
|
1068
|
-
/* */
|
|
1069
|
-
/* */
|
|
1070
|
-
/* */
|
|
1071
|
-
/* */
|
|
1072
|
-
/* */
|
|
1073
|
-
/* */
|
|
1074
|
-
/* */
|
|
1075
|
-
return (void 0);
|
|
1076
|
-
}
|
|
1077
|
-
function normalizeHtmlText(text) {
|
|
1078
|
-
/* */
|
|
1079
|
-
/* */
|
|
1080
|
-
return (void 0);
|
|
1081
|
-
}
|
|
1082
|
-
function uniqueMessages(messages) {
|
|
1083
|
-
/* */
|
|
1084
|
-
/* */
|
|
1085
|
-
/* */
|
|
1086
|
-
/* */
|
|
1087
|
-
/* */
|
|
1088
|
-
/* */
|
|
1089
|
-
/* */
|
|
1090
|
-
/* */
|
|
1091
|
-
/* */
|
|
1092
|
-
/* */
|
|
1093
|
-
/* */
|
|
1094
|
-
/* */
|
|
1095
|
-
/* */
|
|
1096
|
-
/* */
|
|
1097
|
-
/* */
|
|
1098
|
-
return (void 0);
|
|
1099
|
-
}
|
|
1100
|
-
//#endregion
|
|
1101
|
-
//end of namespace UtilsI18nExtractGettextTranslateFromHtml
|
|
1102
|
-
|
|
1103
|
-
//#endregion
|
|
1104
|
-
//namespace UtilsI18nHtml
|
|
1105
|
-
function UtilsI18nHtml__NS__extractGettextTranslateFromHtml(html, fileName = 'template.html') {
|
|
1106
|
-
return UtilsI18nExtractGettextTranslateFromHtml__NS__extractGettextTranslateFromHtml(html, fileName);
|
|
1107
|
-
}
|
|
1108
|
-
function UtilsI18nHtml__NS__replaceTranslatePipieDirectiveTContext(html) {
|
|
1109
|
-
/* */
|
|
1110
|
-
/* */
|
|
1111
|
-
/* */
|
|
1112
|
-
/* */
|
|
1113
|
-
/* */
|
|
1114
|
-
/* */
|
|
1115
|
-
/* */
|
|
1116
|
-
/* */
|
|
1117
|
-
/* */
|
|
1118
|
-
/* */
|
|
1119
|
-
/* */
|
|
1120
|
-
/* */
|
|
1121
|
-
/* */
|
|
1122
|
-
/* */
|
|
1123
|
-
/* */
|
|
1124
|
-
/* */
|
|
1125
|
-
/* */
|
|
1126
|
-
/* */
|
|
1127
|
-
/* */
|
|
1128
|
-
/* */
|
|
1129
|
-
/* */
|
|
1130
|
-
/* */
|
|
1131
|
-
/* */
|
|
1132
|
-
/* */
|
|
1133
|
-
/* */
|
|
1134
|
-
/* */
|
|
1135
|
-
/* */
|
|
1136
|
-
/* */
|
|
1137
|
-
/* */
|
|
1138
|
-
/* */
|
|
1139
|
-
/* */
|
|
1140
|
-
/* */
|
|
1141
|
-
/* */
|
|
1142
|
-
/* */
|
|
1143
|
-
/* */
|
|
1144
|
-
/* */
|
|
1145
|
-
/* */
|
|
1146
|
-
/* */
|
|
1147
|
-
/* */
|
|
1148
|
-
/* */
|
|
1149
|
-
/* */
|
|
1150
|
-
/* */
|
|
1151
|
-
/* */
|
|
1152
|
-
/* */
|
|
1153
|
-
/* */
|
|
1154
|
-
/* */
|
|
1155
|
-
/* */
|
|
1156
|
-
/* */
|
|
1157
|
-
/* */
|
|
1158
|
-
/* */
|
|
1159
|
-
/* */
|
|
1160
|
-
/* */
|
|
1161
|
-
/* */
|
|
1162
|
-
/* */
|
|
1163
|
-
/* */
|
|
1164
|
-
/* */
|
|
1165
|
-
return (void 0);
|
|
1166
|
-
}
|
|
1167
|
-
function findTranslateDirectiveEditsFromSource(html) {
|
|
1168
|
-
/* */
|
|
1169
|
-
/* */
|
|
1170
|
-
/* */
|
|
1171
|
-
/* */
|
|
1172
|
-
/* */
|
|
1173
|
-
/* */
|
|
1174
|
-
/* */
|
|
1175
|
-
/* */
|
|
1176
|
-
/* */
|
|
1177
|
-
/* */
|
|
1178
|
-
/* */
|
|
1179
|
-
/* */
|
|
1180
|
-
/* */
|
|
1181
|
-
/* */
|
|
1182
|
-
/* */
|
|
1183
|
-
/* */
|
|
1184
|
-
/* */
|
|
1185
|
-
/* */
|
|
1186
|
-
/* */
|
|
1187
|
-
/* */
|
|
1188
|
-
/* */
|
|
1189
|
-
/* */
|
|
1190
|
-
/* */
|
|
1191
|
-
/* */
|
|
1192
|
-
/* */
|
|
1193
|
-
/* */
|
|
1194
|
-
/* */
|
|
1195
|
-
/* */
|
|
1196
|
-
/* */
|
|
1197
|
-
return (void 0);
|
|
1198
|
-
}
|
|
1199
|
-
function hasTranslateDirective(node) {
|
|
1200
|
-
/* */
|
|
1201
|
-
/* */
|
|
1202
|
-
/* */
|
|
1203
|
-
/* */
|
|
1204
|
-
return (void 0);
|
|
1205
|
-
}
|
|
1206
|
-
function hasTranslateTInput(node) {
|
|
1207
|
-
/* */
|
|
1208
|
-
/* */
|
|
1209
|
-
/* */
|
|
1210
|
-
/* */
|
|
1211
|
-
/* */
|
|
1212
|
-
/* */
|
|
1213
|
-
/* */
|
|
1214
|
-
/* */
|
|
1215
|
-
return (void 0);
|
|
1216
|
-
}
|
|
1217
|
-
function findOpenTagInsertPosition(html, start, length) {
|
|
1218
|
-
/* */
|
|
1219
|
-
/* */
|
|
1220
|
-
/* */
|
|
1221
|
-
/* */
|
|
1222
|
-
/* */
|
|
1223
|
-
/* */
|
|
1224
|
-
/* */
|
|
1225
|
-
/* */
|
|
1226
|
-
/* */
|
|
1227
|
-
/* */
|
|
1228
|
-
/* */
|
|
1229
|
-
/* */
|
|
1230
|
-
/* */
|
|
1231
|
-
/* */
|
|
1232
|
-
return (void 0);
|
|
1233
|
-
}
|
|
1234
|
-
function applyEdits(input, edits) {
|
|
1235
|
-
/* */
|
|
1236
|
-
/* */
|
|
1237
|
-
/* */
|
|
1238
|
-
/* */
|
|
1239
|
-
/* */
|
|
1240
|
-
/* */
|
|
1241
|
-
return (void 0);
|
|
1242
|
-
}
|
|
1243
|
-
//end of namespace UtilsI18nHtml
|
|
1244
|
-
|
|
1245
|
-
//namespace UtilsPoFile
|
|
1246
|
-
//#region generate po files
|
|
1247
|
-
function UtilsPoFile__NS__generatePoFiles(files, locales, destinationAbsFolderPath) {
|
|
1248
|
-
/* */
|
|
1249
|
-
/* */
|
|
1250
|
-
/* */
|
|
1251
|
-
/* */
|
|
1252
|
-
/* */
|
|
1253
|
-
/* */
|
|
1254
|
-
/* */
|
|
1255
|
-
/* */
|
|
1256
|
-
/* */
|
|
1257
|
-
return (void 0);
|
|
1258
|
-
}
|
|
1259
|
-
//#endregion
|
|
1260
|
-
//#region generate po file content
|
|
1261
|
-
function UtilsPoFile__NS__generatePoFileContent(files, locale) {
|
|
1262
|
-
/* */
|
|
1263
|
-
/* */
|
|
1264
|
-
/* */
|
|
1265
|
-
/* */
|
|
1266
|
-
/* */
|
|
1267
|
-
/* */
|
|
1268
|
-
/* */
|
|
1269
|
-
/* */
|
|
1270
|
-
/* */
|
|
1271
|
-
/* */
|
|
1272
|
-
/* */
|
|
1273
|
-
/* */
|
|
1274
|
-
/* */
|
|
1275
|
-
/* */
|
|
1276
|
-
/* */
|
|
1277
|
-
/* */
|
|
1278
|
-
/* */
|
|
1279
|
-
/* */
|
|
1280
|
-
/* */
|
|
1281
|
-
/* */
|
|
1282
|
-
/* */
|
|
1283
|
-
/* */
|
|
1284
|
-
/* */
|
|
1285
|
-
/* */
|
|
1286
|
-
/* */
|
|
1287
|
-
/* */
|
|
1288
|
-
/* */
|
|
1289
|
-
/* */
|
|
1290
|
-
/* */
|
|
1291
|
-
/* */
|
|
1292
|
-
/* */
|
|
1293
|
-
/* */
|
|
1294
|
-
/* */
|
|
1295
|
-
/* */
|
|
1296
|
-
/* */
|
|
1297
|
-
/* */
|
|
1298
|
-
/* */
|
|
1299
|
-
/* */
|
|
1300
|
-
/* */
|
|
1301
|
-
/* */
|
|
1302
|
-
/* */
|
|
1303
|
-
/* */
|
|
1304
|
-
/* */
|
|
1305
|
-
/* */
|
|
1306
|
-
/* */
|
|
1307
|
-
/* */
|
|
1308
|
-
/* */
|
|
1309
|
-
/* */
|
|
1310
|
-
/* */
|
|
1311
|
-
/* */
|
|
1312
|
-
/* */
|
|
1313
|
-
/* */
|
|
1314
|
-
/* */
|
|
1315
|
-
/* */
|
|
1316
|
-
/* */
|
|
1317
|
-
/* */
|
|
1318
|
-
return (void 0);
|
|
1319
|
-
}
|
|
1320
|
-
//#endregion
|
|
1321
|
-
//#region extract po to json
|
|
1322
|
-
function UtilsPoFile__NS__extractPoToJson(poFileContent) {
|
|
1323
|
-
/* */
|
|
1324
|
-
/* */
|
|
1325
|
-
/* */
|
|
1326
|
-
/* */
|
|
1327
|
-
/* */
|
|
1328
|
-
/* */
|
|
1329
|
-
/* */
|
|
1330
|
-
/* */
|
|
1331
|
-
/* */
|
|
1332
|
-
/* */
|
|
1333
|
-
/* */
|
|
1334
|
-
/* */
|
|
1335
|
-
/* */
|
|
1336
|
-
/* */
|
|
1337
|
-
/* */
|
|
1338
|
-
/* */
|
|
1339
|
-
/* */
|
|
1340
|
-
/* */
|
|
1341
|
-
/* */
|
|
1342
|
-
/* */
|
|
1343
|
-
/* */
|
|
1344
|
-
/* */
|
|
1345
|
-
/* */
|
|
1346
|
-
/* */
|
|
1347
|
-
/* */
|
|
1348
|
-
/* */
|
|
1349
|
-
/* */
|
|
1350
|
-
/* */
|
|
1351
|
-
/* */
|
|
1352
|
-
/* */
|
|
1353
|
-
/* */
|
|
1354
|
-
return (void 0);
|
|
1355
|
-
}
|
|
1356
|
-
//#endregion
|
|
1357
|
-
//#region generate translation override interface
|
|
1358
|
-
function UtilsPoFile__NS__generateTranslationOverrideInterface(file, interfaceName, locale) {
|
|
1359
|
-
/* */
|
|
1360
|
-
/* */
|
|
1361
|
-
/* */
|
|
1362
|
-
/* */
|
|
1363
|
-
/* */
|
|
1364
|
-
/* */
|
|
1365
|
-
/* */
|
|
1366
|
-
/* */
|
|
1367
|
-
/* */
|
|
1368
|
-
/* */
|
|
1369
|
-
/* */
|
|
1370
|
-
/* */
|
|
1371
|
-
/* */
|
|
1372
|
-
/* */
|
|
1373
|
-
/* */
|
|
1374
|
-
/* */
|
|
1375
|
-
/* */
|
|
1376
|
-
/* */
|
|
1377
|
-
/* */
|
|
1378
|
-
/* */
|
|
1379
|
-
/* */
|
|
1380
|
-
/* */
|
|
1381
|
-
/* */
|
|
1382
|
-
/* */
|
|
1383
|
-
/* */
|
|
1384
|
-
/* */
|
|
1385
|
-
/* */
|
|
1386
|
-
/* */
|
|
1387
|
-
/* */
|
|
1388
|
-
/* */
|
|
1389
|
-
/* */
|
|
1390
|
-
/* */
|
|
1391
|
-
/* */
|
|
1392
|
-
/* */
|
|
1393
|
-
/* */
|
|
1394
|
-
/* */
|
|
1395
|
-
/* */
|
|
1396
|
-
/* */
|
|
1397
|
-
/* */
|
|
1398
|
-
return (void 0);
|
|
1399
|
-
}
|
|
1400
|
-
function escapeTs(value) {
|
|
1401
|
-
return value.replace(/\\/g, '\\\\').replace(/"/g, '\\"');
|
|
1402
|
-
}
|
|
1403
|
-
//#endregion
|
|
1404
|
-
//#region merge gettext file
|
|
1405
|
-
function UtilsPoFile__NS__mergeGettextFile(jsonContent1FromTsHtml, json2ContentFromPoFileModifedByUser) {
|
|
1406
|
-
/* */
|
|
1407
|
-
/* */
|
|
1408
|
-
/* */
|
|
1409
|
-
/* */
|
|
1410
|
-
/* */
|
|
1411
|
-
/* */
|
|
1412
|
-
/* */
|
|
1413
|
-
/* */
|
|
1414
|
-
/* */
|
|
1415
|
-
/* */
|
|
1416
|
-
/* */
|
|
1417
|
-
/* */
|
|
1418
|
-
/* */
|
|
1419
|
-
/* */
|
|
1420
|
-
/* */
|
|
1421
|
-
/* */
|
|
1422
|
-
/* */
|
|
1423
|
-
/* */
|
|
1424
|
-
/* */
|
|
1425
|
-
/* */
|
|
1426
|
-
/* */
|
|
1427
|
-
return (void 0);
|
|
1428
|
-
}
|
|
1429
|
-
//#endregion
|
|
1430
|
-
//#region models & helpers
|
|
1431
|
-
function getGettextTagKey(tag) {
|
|
1432
|
-
return `${tag.context ?? ''}\u0004${tag.gettextString}`;
|
|
1433
|
-
}
|
|
1434
|
-
function parsePoEntries(po) {
|
|
1435
|
-
/* */
|
|
1436
|
-
/* */
|
|
1437
|
-
/* */
|
|
1438
|
-
/* */
|
|
1439
|
-
/* */
|
|
1440
|
-
/* */
|
|
1441
|
-
/* */
|
|
1442
|
-
/* */
|
|
1443
|
-
/* */
|
|
1444
|
-
/* */
|
|
1445
|
-
/* */
|
|
1446
|
-
/* */
|
|
1447
|
-
/* */
|
|
1448
|
-
/* */
|
|
1449
|
-
/* */
|
|
1450
|
-
/* */
|
|
1451
|
-
/* */
|
|
1452
|
-
/* */
|
|
1453
|
-
/* */
|
|
1454
|
-
/* */
|
|
1455
|
-
/* */
|
|
1456
|
-
/* */
|
|
1457
|
-
/* */
|
|
1458
|
-
/* */
|
|
1459
|
-
/* */
|
|
1460
|
-
/* */
|
|
1461
|
-
/* */
|
|
1462
|
-
/* */
|
|
1463
|
-
/* */
|
|
1464
|
-
/* */
|
|
1465
|
-
/* */
|
|
1466
|
-
/* */
|
|
1467
|
-
/* */
|
|
1468
|
-
/* */
|
|
1469
|
-
/* */
|
|
1470
|
-
/* */
|
|
1471
|
-
/* */
|
|
1472
|
-
/* */
|
|
1473
|
-
/* */
|
|
1474
|
-
/* */
|
|
1475
|
-
/* */
|
|
1476
|
-
/* */
|
|
1477
|
-
/* */
|
|
1478
|
-
/* */
|
|
1479
|
-
/* */
|
|
1480
|
-
/* */
|
|
1481
|
-
/* */
|
|
1482
|
-
/* */
|
|
1483
|
-
/* */
|
|
1484
|
-
/* */
|
|
1485
|
-
/* */
|
|
1486
|
-
/* */
|
|
1487
|
-
/* */
|
|
1488
|
-
/* */
|
|
1489
|
-
/* */
|
|
1490
|
-
/* */
|
|
1491
|
-
/* */
|
|
1492
|
-
/* */
|
|
1493
|
-
/* */
|
|
1494
|
-
/* */
|
|
1495
|
-
/* */
|
|
1496
|
-
/* */
|
|
1497
|
-
/* */
|
|
1498
|
-
return (void 0);
|
|
1499
|
-
}
|
|
1500
|
-
function parsePoRef(ref) {
|
|
1501
|
-
/* */
|
|
1502
|
-
/* */
|
|
1503
|
-
/* */
|
|
1504
|
-
/* */
|
|
1505
|
-
/* */
|
|
1506
|
-
/* */
|
|
1507
|
-
/* */
|
|
1508
|
-
/* */
|
|
1509
|
-
return (void 0);
|
|
1510
|
-
}
|
|
1511
|
-
function escapePoString(value) {
|
|
1512
|
-
return value
|
|
1513
|
-
.replace(/\\/g, '\\\\')
|
|
1514
|
-
.replace(/"/g, '\\"')
|
|
1515
|
-
.replace(/\n/g, '\\n');
|
|
1516
|
-
}
|
|
1517
|
-
function readPoQuoted(value) {
|
|
1518
|
-
const match = value.match(/^"([\s\S]*)"$/);
|
|
1519
|
-
if (!match)
|
|
1520
|
-
return '';
|
|
1521
|
-
return unescapePoString(match[1]);
|
|
1522
|
-
}
|
|
1523
|
-
function unescapePoString(value) {
|
|
1524
|
-
return value
|
|
1525
|
-
.replace(/\\n/g, '\n')
|
|
1526
|
-
.replace(/\\"/g, '"')
|
|
1527
|
-
.replace(/\\\\/g, '\\');
|
|
1528
|
-
}
|
|
1529
|
-
//#endregion
|
|
1530
|
-
//end of namespace UtilsPoFile
|
|
1531
|
-
|
|
1532
|
-
// @ts-nocheck
|
|
1533
|
-
// This file is auto-generated during init process. Do not modify.
|
|
1534
|
-
// This disable this auto generate file.
|
|
1535
|
-
// set property "shouldGenerateAutogenIndexFile: false"
|
|
1536
|
-
// in taon.jsonc of your project.
|
|
1537
|
-
|
|
1538
|
-
var index = {};
|
|
1539
|
-
|
|
1540
|
-
/**
|
|
1541
|
-
* Generated bundle index. Do not edit.
|
|
1542
|
-
*/
|
|
1543
|
-
|
|
1544
|
-
export { APP_ID, BUILD_BASE_HREF, BUILD_FRAMEWORK_CLI_NAME, CURRENT_PACKAGE_TAON_VERSION, CURRENT_PACKAGE_VERSION, PROJECT_NPM_NAME, TranslateDirective, TranslatePipe, TranslateService, Translation, TranslationManager, UtilsI18nExtractGettextTranslateFromHtml__NS__extractGettextTranslateFromHtml, UtilsI18nHtml__NS__extractGettextTranslateFromHtml, UtilsI18nHtml__NS__replaceTranslatePipieDirectiveTContext, UtilsPoFile__NS__extractPoToJson, UtilsPoFile__NS__generatePoFileContent, UtilsPoFile__NS__generatePoFiles, UtilsPoFile__NS__generateTranslationOverrideInterface, UtilsPoFile__NS__mergeGettextFile, startCli };
|
|
1545
|
-
//# sourceMappingURL=i18n-browser-prod.mjs.map
|