@taon-dev/i18n 21.0.48 → 21.0.49

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.
Files changed (145) hide show
  1. package/VERIFIED-BUILD-DATA.jsonc +3 -3
  2. package/browser/fesm2022/i18n-browser.mjs +1 -1
  3. package/browser/fesm2022/i18n-browser.mjs.map +1 -1
  4. package/browser/package.json +1 -1
  5. package/browser/types/i18n-browser.d.ts +1 -1
  6. package/browser-prod/fesm2022/i18n-browser-prod.mjs +1 -1
  7. package/browser-prod/fesm2022/i18n-browser-prod.mjs.map +1 -1
  8. package/browser-prod/package.json +1 -1
  9. package/browser-prod/types/i18n-browser-prod.d.ts +1 -1
  10. package/full-dts/build-info._auto-generated_.d.ts +1 -1
  11. package/lib/build-info._auto-generated_.d.ts +1 -1
  12. package/lib/build-info._auto-generated_.js +1 -1
  13. package/lib/package.json +1 -1
  14. package/lib-esm/lib/build-info._auto-generated_.d.ts +1 -1
  15. package/lib-esm/lib/build-info._auto-generated_.js +1 -1
  16. package/lib-prod/build-info._auto-generated_.d.ts +1 -1
  17. package/lib-prod/build-info._auto-generated_.js +1 -1
  18. package/lib-prod/package.json +1 -1
  19. package/package.json +1 -1
  20. package/ts-source/browser-code/build-info._auto-generated_.ts +13 -0
  21. package/ts-source/browser-code/i18n/lib.translation.ts +12 -0
  22. package/ts-source/browser-code/i18n/translation.ts.en-US.i18n.data.ts +33 -0
  23. package/ts-source/browser-code/i18n/translation.ts.en-US.po +17 -0
  24. package/ts-source/browser-code/i18n/translation.ts.pl-PL.i18n.data.ts +33 -0
  25. package/ts-source/browser-code/i18n/translation.ts.pl-PL.po +17 -0
  26. package/ts-source/browser-code/index._auto-generated_.ts +20 -0
  27. package/ts-source/browser-code/index.scss +7 -0
  28. package/ts-source/browser-code/index.ts +10 -0
  29. package/ts-source/browser-code/lib-info.md +8 -0
  30. package/ts-source/browser-code/local-translation.ts +126 -0
  31. package/ts-source/browser-code/migrations/migrations-info.md +6 -0
  32. package/ts-source/browser-code/start-cli.ts +12 -0
  33. package/ts-source/browser-code/translate.directive.ts +59 -0
  34. package/ts-source/browser-code/translate.pipe.ts +32 -0
  35. package/ts-source/browser-code/translate.service.ts +20 -0
  36. package/ts-source/browser-code/translation-manager.ts +101 -0
  37. package/ts-source/browser-code/translation.models.ts +27 -0
  38. package/ts-source/browser-code/translation.ts +179 -0
  39. package/ts-source/browser-code/utils-i18n-extract-gettext-translate-from-html.ts +87 -0
  40. package/ts-source/browser-code/utils-i18n-html.ts +79 -0
  41. package/ts-source/browser-code/utils-po-file.ts +70 -0
  42. package/ts-source/browser-code-prod/build-info._auto-generated_.split-namespaces.json +4 -0
  43. package/ts-source/browser-code-prod/build-info._auto-generated_.ts +13 -0
  44. package/ts-source/browser-code-prod/i18n/lib.translation.split-namespaces.json +4 -0
  45. package/ts-source/browser-code-prod/i18n/lib.translation.ts +12 -0
  46. package/ts-source/browser-code-prod/i18n/translation.ts.en-US.i18n.data.ts +33 -0
  47. package/ts-source/browser-code-prod/i18n/translation.ts.en-US.po +17 -0
  48. package/ts-source/browser-code-prod/i18n/translation.ts.pl-PL.i18n.data.ts +33 -0
  49. package/ts-source/browser-code-prod/i18n/translation.ts.pl-PL.po +17 -0
  50. package/ts-source/browser-code-prod/index._auto-generated_.split-namespaces.json +4 -0
  51. package/ts-source/browser-code-prod/index._auto-generated_.ts +20 -0
  52. package/ts-source/browser-code-prod/index.scss +7 -0
  53. package/ts-source/browser-code-prod/index.split-namespaces.json +4 -0
  54. package/ts-source/browser-code-prod/index.ts +10 -0
  55. package/ts-source/browser-code-prod/lib-info.md +8 -0
  56. package/ts-source/browser-code-prod/local-translation.split-namespaces.json +4 -0
  57. package/ts-source/browser-code-prod/local-translation.ts +126 -0
  58. package/ts-source/browser-code-prod/migrations/migrations-info.md +6 -0
  59. package/ts-source/browser-code-prod/start-cli.split-namespaces.json +4 -0
  60. package/ts-source/browser-code-prod/start-cli.ts +12 -0
  61. package/ts-source/browser-code-prod/translate.directive.split-namespaces.json +4 -0
  62. package/ts-source/browser-code-prod/translate.directive.ts +59 -0
  63. package/ts-source/browser-code-prod/translate.pipe.split-namespaces.json +4 -0
  64. package/ts-source/browser-code-prod/translate.pipe.ts +32 -0
  65. package/ts-source/browser-code-prod/translate.service.split-namespaces.json +4 -0
  66. package/ts-source/browser-code-prod/translate.service.ts +20 -0
  67. package/ts-source/browser-code-prod/translation-manager.split-namespaces.json +4 -0
  68. package/ts-source/browser-code-prod/translation-manager.ts +101 -0
  69. package/ts-source/browser-code-prod/translation.models.split-namespaces.json +4 -0
  70. package/ts-source/browser-code-prod/translation.models.ts +27 -0
  71. package/ts-source/browser-code-prod/translation.split-namespaces.json +4 -0
  72. package/ts-source/browser-code-prod/translation.ts +179 -0
  73. package/ts-source/browser-code-prod/utils-i18n-extract-gettext-translate-from-html.split-namespaces.json +10 -0
  74. package/ts-source/browser-code-prod/utils-i18n-extract-gettext-translate-from-html.ts +85 -0
  75. package/ts-source/browser-code-prod/utils-i18n-html.split-namespaces.json +16 -0
  76. package/ts-source/browser-code-prod/utils-i18n-html.ts +77 -0
  77. package/ts-source/browser-code-prod/utils-po-file.split-namespaces.json +18 -0
  78. package/ts-source/browser-code-prod/utils-po-file.ts +68 -0
  79. package/ts-source/websql-code/build-info._auto-generated_.ts +13 -0
  80. package/ts-source/websql-code/i18n/lib.translation.ts +12 -0
  81. package/ts-source/websql-code/i18n/translation.ts.en-US.i18n.data.ts +33 -0
  82. package/ts-source/websql-code/i18n/translation.ts.en-US.po +17 -0
  83. package/ts-source/websql-code/i18n/translation.ts.pl-PL.i18n.data.ts +33 -0
  84. package/ts-source/websql-code/i18n/translation.ts.pl-PL.po +17 -0
  85. package/ts-source/websql-code/index._auto-generated_.ts +20 -0
  86. package/ts-source/websql-code/index.scss +7 -0
  87. package/ts-source/websql-code/index.ts +10 -0
  88. package/ts-source/websql-code/lib-info.md +8 -0
  89. package/ts-source/websql-code/local-translation.ts +126 -0
  90. package/ts-source/websql-code/migrations/migrations-info.md +6 -0
  91. package/ts-source/websql-code/start-cli.ts +12 -0
  92. package/ts-source/websql-code/translate.directive.ts +59 -0
  93. package/ts-source/websql-code/translate.pipe.ts +32 -0
  94. package/ts-source/websql-code/translate.service.ts +20 -0
  95. package/ts-source/websql-code/translation-manager.ts +101 -0
  96. package/ts-source/websql-code/translation.models.ts +27 -0
  97. package/ts-source/websql-code/translation.ts +179 -0
  98. package/ts-source/websql-code/utils-i18n-extract-gettext-translate-from-html.ts +87 -0
  99. package/ts-source/websql-code/utils-i18n-html.ts +79 -0
  100. package/ts-source/websql-code/utils-po-file.ts +70 -0
  101. package/ts-source/websql-code-prod/build-info._auto-generated_.split-namespaces.json +4 -0
  102. package/ts-source/websql-code-prod/build-info._auto-generated_.ts +13 -0
  103. package/ts-source/websql-code-prod/i18n/lib.translation.split-namespaces.json +4 -0
  104. package/ts-source/websql-code-prod/i18n/lib.translation.ts +12 -0
  105. package/ts-source/websql-code-prod/i18n/translation.ts.en-US.i18n.data.ts +33 -0
  106. package/ts-source/websql-code-prod/i18n/translation.ts.en-US.po +17 -0
  107. package/ts-source/websql-code-prod/i18n/translation.ts.pl-PL.i18n.data.ts +33 -0
  108. package/ts-source/websql-code-prod/i18n/translation.ts.pl-PL.po +17 -0
  109. package/ts-source/websql-code-prod/index._auto-generated_.split-namespaces.json +4 -0
  110. package/ts-source/websql-code-prod/index._auto-generated_.ts +20 -0
  111. package/ts-source/websql-code-prod/index.scss +7 -0
  112. package/ts-source/websql-code-prod/index.split-namespaces.json +4 -0
  113. package/ts-source/websql-code-prod/index.ts +10 -0
  114. package/ts-source/websql-code-prod/lib-info.md +8 -0
  115. package/ts-source/websql-code-prod/local-translation.split-namespaces.json +4 -0
  116. package/ts-source/websql-code-prod/local-translation.ts +126 -0
  117. package/ts-source/websql-code-prod/migrations/migrations-info.md +6 -0
  118. package/ts-source/websql-code-prod/start-cli.split-namespaces.json +4 -0
  119. package/ts-source/websql-code-prod/start-cli.ts +12 -0
  120. package/ts-source/websql-code-prod/translate.directive.split-namespaces.json +4 -0
  121. package/ts-source/websql-code-prod/translate.directive.ts +59 -0
  122. package/ts-source/websql-code-prod/translate.pipe.split-namespaces.json +4 -0
  123. package/ts-source/websql-code-prod/translate.pipe.ts +32 -0
  124. package/ts-source/websql-code-prod/translate.service.split-namespaces.json +4 -0
  125. package/ts-source/websql-code-prod/translate.service.ts +20 -0
  126. package/ts-source/websql-code-prod/translation-manager.split-namespaces.json +4 -0
  127. package/ts-source/websql-code-prod/translation-manager.ts +101 -0
  128. package/ts-source/websql-code-prod/translation.models.split-namespaces.json +4 -0
  129. package/ts-source/websql-code-prod/translation.models.ts +27 -0
  130. package/ts-source/websql-code-prod/translation.split-namespaces.json +4 -0
  131. package/ts-source/websql-code-prod/translation.ts +179 -0
  132. package/ts-source/websql-code-prod/utils-i18n-extract-gettext-translate-from-html.split-namespaces.json +10 -0
  133. package/ts-source/websql-code-prod/utils-i18n-extract-gettext-translate-from-html.ts +85 -0
  134. package/ts-source/websql-code-prod/utils-i18n-html.split-namespaces.json +16 -0
  135. package/ts-source/websql-code-prod/utils-i18n-html.ts +77 -0
  136. package/ts-source/websql-code-prod/utils-po-file.split-namespaces.json +18 -0
  137. package/ts-source/websql-code-prod/utils-po-file.ts +68 -0
  138. package/websql/fesm2022/i18n-websql.mjs +1 -1
  139. package/websql/fesm2022/i18n-websql.mjs.map +1 -1
  140. package/websql/package.json +1 -1
  141. package/websql/types/i18n-websql.d.ts +1 -1
  142. package/websql-prod/fesm2022/i18n-websql-prod.mjs +1 -1
  143. package/websql-prod/fesm2022/i18n-websql-prod.mjs.map +1 -1
  144. package/websql-prod/package.json +1 -1
  145. package/websql-prod/types/i18n-websql-prod.d.ts +1 -1
@@ -0,0 +1,179 @@
1
+ // @ts-nocheck
2
+ /* ============================================================================
3
+ * TAON READONLY SOURCE
4
+ * DO NOT MODIFY THIS FILE.
5
+ * Changes may be overwritten.
6
+ * ========================================================================== */
7
+
8
+ import { ChangeDetectorRef, inject, signal, WritableSignal, } from '@angular/core';
9
+ import type { WritableSignal as WritableSignalType, } from '@angular/core';
10
+ import { BehaviorSubject, Observable } from 'rxjs';
11
+ import { GlobalStorage, UtilsI18n, _ } from 'tnp-core/browser';
12
+ import { TranslationManager } from './translation-manager';
13
+ import { TaonTranslationsMapImport, TranslationBinding, TranslationLookup, TranslationParams, } from './translation.models';
14
+ import type { UtilsPoFile } from './utils-po-file';
15
+ export class Translation {
16
+ static manager = TranslationManager.Instance;
17
+ static for(fileRelativePath: string, langImportMap: TaonTranslationsMapImport, opt?: {
18
+ debug?: boolean;
19
+ }): Translation {
20
+ opt = opt || {};
21
+ return new Translation(fileRelativePath, Translation.manager.currentGlobalLanguage, langImportMap, !!opt.debug);
22
+ }
23
+ public cdr?: ChangeDetectorRef;
24
+ private lookup: TranslationLookup = {};
25
+ private readonly loadingSubjectSrc = new BehaviorSubject(false);
26
+ public readonly isLoadingLang$ = this.loadingSubjectSrc.asObservable();
27
+ private loading?: Promise<void>;
28
+ private loadedLang?: UtilsI18n.CommonLocaleCode;
29
+ private readonly bindings = new Set<TranslationBinding>();
30
+ private useGlobalLangFile = true;
31
+ private constructor(protected fileRelativePath: string, protected localFileLang: UtilsI18n.CommonLocaleCode, protected langImportMap: TaonTranslationsMapImport, public debug = false) {
32
+ if (!Translation.manager.instances.has(this)) {
33
+ Translation.manager.instances.add(this);
34
+ }
35
+ else {
36
+ }
37
+ }
38
+ for(_classThis: object): Translation {
39
+ if (this.useGlobalLangFile) {
40
+ this.localFileLang = Translation.manager.currentGlobalLanguage;
41
+ }
42
+ try {
43
+ this.cdr = inject(ChangeDetectorRef);
44
+ }
45
+ catch {
46
+ }
47
+ void this.ensureLoaded();
48
+ return this;
49
+ }
50
+ async changeFileLang(lang: UtilsI18n.CommonLocaleCode): Promise<void> {
51
+ this.useGlobalLangFile = false;
52
+ this.localFileLang = lang;
53
+ await this.ensureLoaded(true);
54
+ this.cdr?.markForCheck();
55
+ }
56
+ async useGlobalFileLang(): Promise<void> {
57
+ this.useGlobalLangFile = true;
58
+ await this.ensureLoaded(true);
59
+ this.cdr?.markForCheck();
60
+ }
61
+ gettext = (text: string, params?: TranslationParams, context = ''): string => {
62
+ const key = this.key(text, context);
63
+ const translated = this.lookup[key] ?? text;
64
+ this.debug &&
65
+ console.log(`Translate (with load): "${text}" to "${translated}", key="${key}" params:${_.isObject(params) ? JSON.stringify(params) : params} ` +
66
+ `localFileLang: ${this.localFileLang}`, this);
67
+ return this.interpolate(translated, params);
68
+ };
69
+ private createSignal(text: string, params?: TranslationParams, context = ''): WritableSignalType<string> {
70
+ const s = signal<string>(this.gettext(text, params, context));
71
+ this.bindings.add({
72
+ text,
73
+ params,
74
+ context,
75
+ update: value => s.set(value),
76
+ });
77
+ return s;
78
+ return void 0;
79
+ }
80
+ readonly signal = {
81
+ gettext: (text: string, params?: TranslationParams, context?: string) => this.createSignal(text, params, context),
82
+ };
83
+ private createObservable(text: string, params?: TranslationParams, context = ''): Observable<string> {
84
+ const subject = new BehaviorSubject<string>(this.gettext(text, params, context));
85
+ this.bindings.add({
86
+ text,
87
+ params,
88
+ context,
89
+ update: value => subject.next(value),
90
+ });
91
+ return subject.asObservable();
92
+ }
93
+ readonly $ = {
94
+ gettext: (text: string, params?: TranslationParams, context?: string) => this.createObservable(text, params, context),
95
+ };
96
+ private refreshBindings(): void {
97
+ for (const binding of this.bindings) {
98
+ binding.update(this.gettextWithoutEnsureLoaded(binding.text, binding.params, binding.context ?? ''));
99
+ }
100
+ }
101
+ translate(text: string, params?: TranslationParams, context = ''): string {
102
+ return this.gettextWithoutEnsureLoaded(text, params, context);
103
+ }
104
+ private gettextWithoutEnsureLoaded(text: string, params?: TranslationParams, context = ''): string {
105
+ const key = this.key(text, context);
106
+ const translated = this.lookup[key] ?? text;
107
+ this.debug &&
108
+ console.log(`Translate (no load): "${text}" to "${translated}", key="${key}" params:${_.isObject(params) ? JSON.stringify(params) : params} ` +
109
+ `localFileLang: ${this.localFileLang}`, this);
110
+ return this.interpolate(translated, params);
111
+ }
112
+ private async load(): Promise<void> {
113
+ this.loadingSubjectSrc.next(true);
114
+ const files: UtilsI18n.GettextFile[] = [];
115
+ const filesForTArr = Object.keys(this.langImportMap);
116
+ for (const fileRelativePath of filesForTArr) {
117
+ try {
118
+ const loader = this.langImportMap[fileRelativePath]?.[this.localFileLang];
119
+ if (!loader) {
120
+ continue;
121
+ }
122
+ const modOrFile = await loader();
123
+ const file = (modOrFile as any).default ?? modOrFile;
124
+ files.push(file);
125
+ }
126
+ catch (err) {
127
+ console.log(`[taon-i18n] Error loading language file ${fileRelativePath} `, err);
128
+ }
129
+ }
130
+ this.loadedLang = this.localFileLang;
131
+ this.lookup = this.createLookup(files);
132
+ this.debug && console.log(`${this.localFileLang}`, files, this.lookup);
133
+ this.refreshBindings();
134
+ this.cdr?.markForCheck();
135
+ this.loadingSubjectSrc.next(false);
136
+ }
137
+ private async ensureLoaded(force = false): Promise<void> {
138
+ if (this.useGlobalLangFile) {
139
+ this.localFileLang = Translation.manager.currentGlobalLanguage;
140
+ }
141
+ if (!force && this.loadedLang === this.localFileLang) {
142
+ return;
143
+ }
144
+ if (!force && this.loading) {
145
+ return this.loading;
146
+ }
147
+ this.loading = this.load();
148
+ try {
149
+ await this.loading;
150
+ }
151
+ finally {
152
+ this.loading = undefined;
153
+ }
154
+ }
155
+ private createLookup(files: UtilsI18n.GettextFile[]): TranslationLookup {
156
+ const lookup: TranslationLookup = {};
157
+ for (const file of files) {
158
+ for (const tag of file.tags ?? []) {
159
+ if (!tag.translation)
160
+ continue;
161
+ lookup[this.key(tag.gettextString, tag.context ?? '')] =
162
+ tag.translation;
163
+ }
164
+ }
165
+ return lookup;
166
+ }
167
+ private key(text: string, context = ''): string {
168
+ return `${context}\u0004${text}`;
169
+ }
170
+ private interpolate(text: string, params?: Record<string, unknown>): string {
171
+ if (!params)
172
+ return text;
173
+ const result = text.replace(/\[\[\s*([a-zA-Z0-9_$]+)\s*\]\]/g, (_, key) => {
174
+ const value = params[key];
175
+ return value === undefined || value === null ? '' : String(value);
176
+ });
177
+ return result;
178
+ }
179
+ }
@@ -0,0 +1,87 @@
1
+ // @ts-nocheck
2
+ /* ============================================================================
3
+ * TAON READONLY SOURCE
4
+ * DO NOT MODIFY THIS FILE.
5
+ * Changes may be overwritten.
6
+ * ========================================================================== */
7
+
8
+ import { AST, Binary, BindingPipe, Conditional, Interpolation, LiteralPrimitive, parseTemplate, TmplAstBoundAttribute, TmplAstBoundText, TmplAstElement, TmplAstNode, TmplAstTemplate, TmplAstText, } from '@angular/compiler/cjs';
9
+ import { UtilsI18n } from 'tnp-core/browser';
10
+ export namespace UtilsI18nExtractGettextTranslateFromHtml {
11
+ export function extractGettextTranslateFromHtml(html: string, fileName = 'template.html'): UtilsI18n.GettextExtracted[] {
12
+ return (void 0);
13
+ return void 0 as any;
14
+ }
15
+ function extractGettextCallsFromSource(html: string): UtilsI18n.GettextExtracted[] {
16
+ return (void 0);
17
+ }
18
+ function extractGettextCallsFromHtmlExpression(source: string): Array<{
19
+ gettextString: string;
20
+ context?: string;
21
+ }> {
22
+ return (void 0);
23
+ }
24
+ function readBalancedParenthesesContent(source: string, openParenIndex: number): string | null {
25
+ return (void 0);
26
+ }
27
+ function readStaticStringArg(arg: string | undefined): string | undefined {
28
+ return (void 0);
29
+ }
30
+ function extractTranslateParamsFromSource(source: string): Record<string, string> | null {
31
+ return (void 0);
32
+ }
33
+ function extractObjectLiteralParams(raw: string): Record<string, string> | null {
34
+ return (void 0);
35
+ }
36
+ function splitTopLevel(input: string, separator: string): string[] {
37
+ return (void 0);
38
+ }
39
+ function extractTranslatePipeStringsFromSource(source: string): string[] {
40
+ return (void 0);
41
+ }
42
+ function extractStringLiterals(source: string): string[] {
43
+ return (void 0);
44
+ }
45
+ function getNodeAttributes(node: any): any[] {
46
+ return (void 0);
47
+ }
48
+ function getNodeInputs(node: any): TmplAstBoundAttribute[] {
49
+ return (void 0);
50
+ }
51
+ function isText(node: any): boolean {
52
+ return (void 0);
53
+ }
54
+ function isBoundText(node: any): boolean {
55
+ return (void 0);
56
+ }
57
+ function collectText(nodes: any[]): string {
58
+ return (void 0);
59
+ }
60
+ function extractTranslateDirectiveFromSource(html: string): UtilsI18n.GettextExtracted[] {
61
+ return (void 0);
62
+ }
63
+ function stripHtml(html: string): string {
64
+ return (void 0);
65
+ }
66
+ function extractTranslateParams(inputs: TmplAstBoundAttribute[]): Record<string, string> | null {
67
+ return (void 0);
68
+ }
69
+ function extractObjectLiteralFromAst(ast: any): Record<string, string> | null {
70
+ return (void 0);
71
+ }
72
+ function extractTranslatePipeStrings(ast: AST | any): string[] {
73
+ return (void 0);
74
+ }
75
+ function extractStaticStringsFromExpression(ast: any): string[] {
76
+ return (void 0);
77
+ }
78
+ function astToSource(ast: any): string {
79
+ return (void 0);
80
+ }
81
+ function normalizeHtmlText(text: string): string {
82
+ return (void 0);
83
+ }
84
+ function uniqueMessages(messages: UtilsI18n.GettextExtracted[]): UtilsI18n.GettextExtracted[] {
85
+ return (void 0);
86
+ }
87
+ }
@@ -0,0 +1,79 @@
1
+ // @ts-nocheck
2
+ /* ============================================================================
3
+ * TAON READONLY SOURCE
4
+ * DO NOT MODIFY THIS FILE.
5
+ * Changes may be overwritten.
6
+ * ========================================================================== */
7
+
8
+ import { AST, Binary, BindingPipe, Conditional, Interpolation, LiteralPrimitive, parseTemplate, TmplAstBoundAttribute, TmplAstBoundText, TmplAstElement, TmplAstNode, TmplAstTemplate, TmplAstText, } from '@angular/compiler/cjs';
9
+ import { UtilsI18n } from 'tnp-core/browser';
10
+ import { canHaveDecorators, ClassDeclaration, createSourceFile, Decorator, Expression, forEachChild, getDecorators, isCallExpression, isClassDeclaration, isIdentifier, isObjectLiteralExpression, isPropertyAssignment, Node, ScriptKind, ScriptTarget, } from 'typescript';
11
+ import { UtilsI18nExtractGettextTranslateFromHtml } from './utils-i18n-extract-gettext-translate-from-html';
12
+ export namespace UtilsI18nHtml {
13
+ export function extractGettextTranslateFromHtml(html: string, fileName = 'template.html'): UtilsI18n.GettextExtracted[] {
14
+ return UtilsI18nExtractGettextTranslateFromHtml.extractGettextTranslateFromHtml(html, fileName);
15
+ }
16
+ export function replaceTranslatePipieDirectiveTContext(html: string, options?: {
17
+ angularTsWithInlineHtml?: boolean;
18
+ }): string {
19
+ return (void 0);
20
+ return void 0 as any;
21
+ }
22
+ export function isAngularTsWithInlineHtml(content: string): boolean {
23
+ return (void 0);
24
+ return void 0 as any;
25
+ }
26
+ function replaceInAngularInlineTemplates(content: string): string {
27
+ return (void 0);
28
+ }
29
+ function getAngularInlineTemplateRanges(content: string): Array<{
30
+ start: number;
31
+ end: number;
32
+ html: string;
33
+ quote: '`' | '"' | "'";
34
+ }> {
35
+ return (void 0);
36
+ }
37
+ function hasComponentDecorator(node: ClassDeclaration): boolean {
38
+ return (void 0);
39
+ }
40
+ function getComponentDecorator(node: ClassDeclaration): Decorator | undefined {
41
+ return (void 0);
42
+ }
43
+ function getComponentTemplateInitializer(decorator: Decorator): Expression | undefined {
44
+ return (void 0);
45
+ }
46
+ function getStringLikeInnerRange(content: string, node: Expression): {
47
+ start: number;
48
+ end: number;
49
+ html: string;
50
+ quote: '`' | '"' | "'";
51
+ } | undefined {
52
+ return (void 0);
53
+ }
54
+ export function replaceTranslatePipieDirectiveTContextInHtml(html: string): string {
55
+ return (void 0);
56
+ return void 0 as any;
57
+ }
58
+ function findTranslateDirectiveEditsFromSource(html: string): Array<{
59
+ index: number;
60
+ text: string;
61
+ }> {
62
+ return (void 0);
63
+ }
64
+ function hasTranslateDirective(node: any): boolean {
65
+ return (void 0);
66
+ }
67
+ function hasTranslateTInput(node: any): boolean {
68
+ return (void 0);
69
+ }
70
+ function findOpenTagInsertPosition(html: string, start: number, length: number): number {
71
+ return (void 0);
72
+ }
73
+ function applyEdits(input: string, edits: Array<{
74
+ index: number;
75
+ text: string;
76
+ }>): string {
77
+ return (void 0);
78
+ }
79
+ }
@@ -0,0 +1,70 @@
1
+ // @ts-nocheck
2
+ /* ============================================================================
3
+ * TAON READONLY SOURCE
4
+ * DO NOT MODIFY THIS FILE.
5
+ * Changes may be overwritten.
6
+ * ========================================================================== */
7
+
8
+ import { crossPlatformPath, UtilsI18n, fse } from 'tnp-core/browser';
9
+ export namespace UtilsPoFile {
10
+ export function generatePoFiles(files: UtilsI18n.GettextFile[], locales: UtilsI18n.CommonLocaleCode[], destinationAbsFolderPath: string): void {
11
+ return (void 0);
12
+ }
13
+ export function generatePoFileContent(files: UtilsI18n.GettextFile[], locale: UtilsI18n.CommonLocaleCode): string {
14
+ return (void 0);
15
+ }
16
+ export function extractPoToJson(poFileContent: string): UtilsI18n.GettextFile[] {
17
+ return (void 0);
18
+ }
19
+ export function generateTranslationOverrideInterface(file: UtilsI18n.GettextFile, interfaceName: string, locale: UtilsI18n.CommonLocaleCode): string {
20
+ return (void 0);
21
+ }
22
+ function escapeTs(value: string): string {
23
+ return value.replace(/\\/g, '\\\\').replace(/"/g, '\\"');
24
+ }
25
+ export function mergeGettextFile(jsonContent1FromTsHtml: UtilsI18n.GettextFile, json2ContentFromPoFileModifedByUser?: UtilsI18n.GettextFile | null): UtilsI18n.GettextFile {
26
+ return (void 0);
27
+ }
28
+ function getGettextTagKey(tag: Pick<UtilsI18n.GettextExtracted, 'gettextString' | 'context'>): string {
29
+ return `${tag.context ?? ''}\u0004${tag.gettextString}`;
30
+ }
31
+ interface ParsedPoEntry {
32
+ refs: string[];
33
+ msgctxt?: string;
34
+ msgid?: string;
35
+ msgstr?: string;
36
+ }
37
+ function parsePoEntries(po: string): ParsedPoEntry[] {
38
+ return (void 0);
39
+ }
40
+ function parsePoRef(ref: string): {
41
+ fileAbsPath: string;
42
+ lineNumber: number;
43
+ } | null {
44
+ return (void 0);
45
+ }
46
+ function escapePoString(value: string): string {
47
+ return value
48
+ .replace(/\\/g, '\\\\')
49
+ .replace(/"/g, '\\"')
50
+ .replace(/\n/g, '\\n');
51
+ }
52
+ function readPoQuoted(value: string): string {
53
+ const match = value.match(/^"([\s\S]*)"$/);
54
+ if (!match)
55
+ return '';
56
+ return unescapePoString(match[1]);
57
+ }
58
+ function normalizePoTranslation(translation?: string | null): string | undefined {
59
+ if (translation === undefined || translation === null) {
60
+ return undefined;
61
+ }
62
+ return translation.trim().length > 0 ? translation : undefined;
63
+ }
64
+ function unescapePoString(value: string): string {
65
+ return value
66
+ .replace(/\\n/g, '\n')
67
+ .replace(/\\"/g, '"')
68
+ .replace(/\\\\/g, '\\');
69
+ }
70
+ }
@@ -0,0 +1,4 @@
1
+ {
2
+ "namespacesMapObj": {},
3
+ "namespacesReplace": {}
4
+ }
@@ -0,0 +1,13 @@
1
+ // @ts-nocheck
2
+ /* ============================================================================
3
+ * TAON READONLY SOURCE
4
+ * DO NOT MODIFY THIS FILE.
5
+ * Changes may be overwritten.
6
+ * ========================================================================== */
7
+
8
+ export const BUILD_FRAMEWORK_CLI_NAME = 'tnp';
9
+ export const APP_ID = 'com.domain.example.i18n';
10
+ export const BUILD_BASE_HREF = '';
11
+ export const PROJECT_NPM_NAME = '@taon-dev/i18n';
12
+ export const CURRENT_PACKAGE_TAON_VERSION = 'v21';
13
+ export const CURRENT_PACKAGE_VERSION = '21.0.49';
@@ -0,0 +1,4 @@
1
+ {
2
+ "namespacesMapObj": {},
3
+ "namespacesReplace": {}
4
+ }
@@ -0,0 +1,12 @@
1
+ // @ts-nocheck
2
+ /* ============================================================================
3
+ * TAON READONLY SOURCE
4
+ * DO NOT MODIFY THIS FILE.
5
+ * Changes may be overwritten.
6
+ * ========================================================================== */
7
+
8
+ import { CoreModels__NS__BaseProjectType, CoreModels__NS__BaseProjectTypeArr, CoreModels__NS__BuildType, CoreModels__NS__BuildTypeArr, CoreModels__NS__buildTypeToWatcherFn, CoreModels__NS__BuildWatcherErrorType, CoreModels__NS__BuildWatcherType, CoreModels__NS__BuildWatcherTypeArr, CoreModels__NS__CfontAlign, CoreModels__NS__CfontStyle, CoreModels__NS__ClassNameStaticProperty, CoreModels__NS__ContentType, CoreModels__NS__ContentTypeKeys, CoreModels__NS__CoreLibCategory, CoreModels__NS__CutableFileExt, CoreModels__NS__DatabaseType, CoreModels__NS__DeepPartial, CoreModels__NS__FileEvent, CoreModels__NS__FileExtension, CoreModels__NS__FirstParamsFrom, CoreModels__NS__FrameworkVersion, CoreModels__NS__GitConnection, CoreModels__NS__GitConnectionArr, CoreModels__NS__GlobalDependencies, CoreModels__NS__hasExitCleaningFunction, CoreModels__NS__HttpCode, CoreModels__NS__HttpMethod, CoreModels__NS__HttpMethodArr, CoreModels__NS__ImageFileExtension, CoreModels__NS__ImageFileExtensionArr, CoreModels__NS__InstalationType, CoreModels__NS__InstalationTypeArr, CoreModels__NS__LibType, CoreModels__NS__localhostDomain, CoreModels__NS__localhostIp127, CoreModels__NS__ManifestIcon, CoreModels__NS__MediaType, CoreModels__NS__MediaTypeAllArr, CoreModels__NS__mimeTypes, CoreModels__NS__NewFactoryType, CoreModels__NS__NpmInstallOptions, CoreModels__NS__NpmPublishOptions, CoreModels__NS__NpmSpecialVersions, CoreModels__NS__OrignalClassKey, CoreModels__NS__OutFolder, CoreModels__NS__Package, CoreModels__NS__ParamType, CoreModels__NS__parentLocation, CoreModels__NS__pathToChildren, CoreModels__NS__Position, CoreModels__NS__PreReleaseVersionTag, CoreModels__NS__PROGRESS_DATA_TYPE, CoreModels__NS__PUSHTYPE, CoreModels__NS__PwaManifest, CoreModels__NS__ReleaseVersionType, CoreModels__NS__ReleaseVersionTypeEnum, CoreModels__NS__RunOptions, CoreModels__NS__Size, CoreModels__NS__SPECIAL_APP_READY_MESSAGE, CoreModels__NS__SPECIAL_WORKER_READY_MESSAGE, CoreModels__NS__StatusCode401, CoreModels__NS__tagForTaskName, CoreModels__NS__TaonHttpErrorCustomProp, CoreModels__NS__TsUsage, CoreModels__NS__UIFramework, CoreModels__NS__ValueOf, CoreModels__NS__VSCodeSettings } from 'tnp-core/browser-prod';
9
+ import { EnUsTraslationOverrideSrcLibTranslationTs } from './translation.ts.en-US.i18n.data';
10
+ import { PlPlTraslationOverrideSrcLibTranslationTs } from './translation.ts.pl-PL.i18n.data';
11
+ ;
12
+ export type LibOverride = CoreModels__NS__DeepPartial<EnUsTraslationOverrideSrcLibTranslationTs | PlPlTraslationOverrideSrcLibTranslationTs>;
@@ -0,0 +1,33 @@
1
+ // @ts-nocheck
2
+ /* ============================================================================
3
+ * TAON READONLY SOURCE
4
+ * DO NOT MODIFY THIS FILE.
5
+ * Changes may be overwritten.
6
+ * ========================================================================== */
7
+
8
+ export interface EnUsTraslationOverrideSrcLibTranslationTs {
9
+ "en-US": {
10
+ "": {
11
+ "amazing better place"?: string;
12
+ "asdasd"?: string;
13
+ "hello"?: string;
14
+ };
15
+ };
16
+ }
17
+ export default {
18
+ "fileRelativePath": "src/lib/translation.ts",
19
+ "tags": [
20
+ {
21
+ "gettextString": "asdasd",
22
+ "lineNumber": 345
23
+ },
24
+ {
25
+ "gettextString": "amazing better place",
26
+ "lineNumber": 355
27
+ },
28
+ {
29
+ "gettextString": "hello",
30
+ "lineNumber": 369
31
+ }
32
+ ]
33
+ };
@@ -0,0 +1,17 @@
1
+ msgid ""
2
+ msgstr ""
3
+ "Language: en-US\n"
4
+ "Content-Type: text/plain; charset=UTF-8\n"
5
+ "Content-Transfer-Encoding: 8bit\n"
6
+
7
+ #: src/lib/translation.ts:345
8
+ msgid "asdasd"
9
+ msgstr ""
10
+
11
+ #: src/lib/translation.ts:355
12
+ msgid "amazing better place"
13
+ msgstr ""
14
+
15
+ #: src/lib/translation.ts:369
16
+ msgid "hello"
17
+ msgstr ""
@@ -0,0 +1,33 @@
1
+ // @ts-nocheck
2
+ /* ============================================================================
3
+ * TAON READONLY SOURCE
4
+ * DO NOT MODIFY THIS FILE.
5
+ * Changes may be overwritten.
6
+ * ========================================================================== */
7
+
8
+ export interface PlPlTraslationOverrideSrcLibTranslationTs {
9
+ "pl-PL": {
10
+ "": {
11
+ "amazing better place"?: string;
12
+ "asdasd"?: string;
13
+ "hello"?: string;
14
+ };
15
+ };
16
+ }
17
+ export default {
18
+ "fileRelativePath": "src/lib/translation.ts",
19
+ "tags": [
20
+ {
21
+ "gettextString": "asdasd",
22
+ "lineNumber": 345
23
+ },
24
+ {
25
+ "gettextString": "amazing better place",
26
+ "lineNumber": 355
27
+ },
28
+ {
29
+ "gettextString": "hello",
30
+ "lineNumber": 369
31
+ }
32
+ ]
33
+ };
@@ -0,0 +1,17 @@
1
+ msgid ""
2
+ msgstr ""
3
+ "Language: pl-PL\n"
4
+ "Content-Type: text/plain; charset=UTF-8\n"
5
+ "Content-Transfer-Encoding: 8bit\n"
6
+
7
+ #: src/lib/translation.ts:345
8
+ msgid "asdasd"
9
+ msgstr ""
10
+
11
+ #: src/lib/translation.ts:355
12
+ msgid "amazing better place"
13
+ msgstr ""
14
+
15
+ #: src/lib/translation.ts:369
16
+ msgid "hello"
17
+ msgstr ""
@@ -0,0 +1,4 @@
1
+ {
2
+ "namespacesMapObj": {},
3
+ "namespacesReplace": {}
4
+ }
@@ -0,0 +1,20 @@
1
+ // @ts-nocheck
2
+ /* ============================================================================
3
+ * TAON READONLY SOURCE
4
+ * DO NOT MODIFY THIS FILE.
5
+ * Changes may be overwritten.
6
+ * ========================================================================== */
7
+
8
+ export * from './build-info._auto-generated_';
9
+ export * from './local-translation';
10
+ export * from './start-cli';
11
+ export * from './translate.directive';
12
+ export * from './translate.pipe';
13
+ export * from './translate.service';
14
+ export * from './translation-manager';
15
+ export * from './translation.models';
16
+ export * from './translation';
17
+ export * from './utils-i18n-extract-gettext-translate-from-html';
18
+ export * from './utils-i18n-html';
19
+ export * from './utils-po-file';
20
+ export * from './i18n/lib.translation';
@@ -0,0 +1,7 @@
1
+ /* ============================================================================
2
+ * TAON READONLY SOURCE
3
+ * DO NOT MODIFY THIS FILE.
4
+ * Changes may be overwritten.
5
+ * ========================================================================== */
6
+
7
+
@@ -0,0 +1,4 @@
1
+ {
2
+ "namespacesMapObj": {},
3
+ "namespacesReplace": {}
4
+ }
@@ -0,0 +1,10 @@
1
+ // @ts-nocheck
2
+ /* ============================================================================
3
+ * TAON READONLY SOURCE
4
+ * DO NOT MODIFY THIS FILE.
5
+ * Changes may be overwritten.
6
+ * ========================================================================== */
7
+
8
+ export * from './index._auto-generated_';
9
+ export * from './start-cli';
10
+ export default {};
@@ -0,0 +1,8 @@
1
+ THIS FILE IS GENERATED - DO NOT MODIFY
2
+
3
+ This folder is an entry point for npm Angular/NodeJS library
4
+
5
+ DON'T USE STUFF FROM PARENT FOLDER app.* FILES HERE (except src/migrations/** files).
6
+
7
+ THIS FILE IS GENERATED - DO NOT MODIFY
8
+
@@ -0,0 +1,4 @@
1
+ {
2
+ "namespacesMapObj": {},
3
+ "namespacesReplace": {}
4
+ }