@taon-dev/i18n 21.0.47 → 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,85 @@
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__NS__CommonLocaleCode, UtilsI18n__NS__CommonLocaleCodeEnum, UtilsI18n__NS__commonLocales, UtilsI18n__NS__defaultLangLocale, UtilsI18n__NS__detectLocale, UtilsI18n__NS__GettextExtracted, UtilsI18n__NS__GettextFile, UtilsI18n__NS__LangOption, UtilsI18n__NS__LangOptionArr } from 'tnp-core/browser-prod';
10
+ export function UtilsI18nExtractGettextTranslateFromHtml__NS__extractGettextTranslateFromHtml(html: string, fileName = 'template.html'): UtilsI18n__NS__GettextExtracted[] {
11
+ return (void 0);
12
+ return void 0 as any;
13
+ }
14
+ function extractGettextCallsFromSource(html: string): UtilsI18n__NS__GettextExtracted[] {
15
+ return (void 0);
16
+ }
17
+ function extractGettextCallsFromHtmlExpression(source: string): Array<{
18
+ gettextString: string;
19
+ context?: string;
20
+ }> {
21
+ return (void 0);
22
+ }
23
+ function readBalancedParenthesesContent(source: string, openParenIndex: number): string | null {
24
+ return (void 0);
25
+ }
26
+ function readStaticStringArg(arg: string | undefined): string | undefined {
27
+ return (void 0);
28
+ }
29
+ function extractTranslateParamsFromSource(source: string): Record<string, string> | null {
30
+ return (void 0);
31
+ }
32
+ function extractObjectLiteralParams(raw: string): Record<string, string> | null {
33
+ return (void 0);
34
+ }
35
+ function splitTopLevel(input: string, separator: string): string[] {
36
+ return (void 0);
37
+ }
38
+ function extractTranslatePipeStringsFromSource(source: string): string[] {
39
+ return (void 0);
40
+ }
41
+ function extractStringLiterals(source: string): string[] {
42
+ return (void 0);
43
+ }
44
+ function getNodeAttributes(node: any): any[] {
45
+ return (void 0);
46
+ }
47
+ function getNodeInputs(node: any): TmplAstBoundAttribute[] {
48
+ return (void 0);
49
+ }
50
+ function isText(node: any): boolean {
51
+ return (void 0);
52
+ }
53
+ function isBoundText(node: any): boolean {
54
+ return (void 0);
55
+ }
56
+ function collectText(nodes: any[]): string {
57
+ return (void 0);
58
+ }
59
+ function extractTranslateDirectiveFromSource(html: string): UtilsI18n__NS__GettextExtracted[] {
60
+ return (void 0);
61
+ }
62
+ function stripHtml(html: string): string {
63
+ return (void 0);
64
+ }
65
+ function extractTranslateParams(inputs: TmplAstBoundAttribute[]): Record<string, string> | null {
66
+ return (void 0);
67
+ }
68
+ function extractObjectLiteralFromAst(ast: any): Record<string, string> | null {
69
+ return (void 0);
70
+ }
71
+ function extractTranslatePipeStrings(ast: AST | any): string[] {
72
+ return (void 0);
73
+ }
74
+ function extractStaticStringsFromExpression(ast: any): string[] {
75
+ return (void 0);
76
+ }
77
+ function astToSource(ast: any): string {
78
+ return (void 0);
79
+ }
80
+ function normalizeHtmlText(text: string): string {
81
+ return (void 0);
82
+ }
83
+ function uniqueMessages(messages: UtilsI18n__NS__GettextExtracted[]): UtilsI18n__NS__GettextExtracted[] {
84
+ return (void 0);
85
+ }
@@ -0,0 +1,16 @@
1
+ {
2
+ "namespacesMapObj": {
3
+ "UtilsI18nHtml.extractGettextTranslateFromHtml": "UtilsI18nHtml__NS__extractGettextTranslateFromHtml",
4
+ "UtilsI18nHtml.replaceTranslatePipieDirectiveTContext": "UtilsI18nHtml__NS__replaceTranslatePipieDirectiveTContext",
5
+ "UtilsI18nHtml.isAngularTsWithInlineHtml": "UtilsI18nHtml__NS__isAngularTsWithInlineHtml",
6
+ "UtilsI18nHtml.replaceTranslatePipieDirectiveTContextInHtml": "UtilsI18nHtml__NS__replaceTranslatePipieDirectiveTContextInHtml"
7
+ },
8
+ "namespacesReplace": {
9
+ "UtilsI18nHtml": [
10
+ "UtilsI18nHtml__NS__extractGettextTranslateFromHtml",
11
+ "UtilsI18nHtml__NS__isAngularTsWithInlineHtml",
12
+ "UtilsI18nHtml__NS__replaceTranslatePipieDirectiveTContext",
13
+ "UtilsI18nHtml__NS__replaceTranslatePipieDirectiveTContextInHtml"
14
+ ]
15
+ }
16
+ }
@@ -0,0 +1,77 @@
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__NS__CommonLocaleCode, UtilsI18n__NS__CommonLocaleCodeEnum, UtilsI18n__NS__commonLocales, UtilsI18n__NS__defaultLangLocale, UtilsI18n__NS__detectLocale, UtilsI18n__NS__GettextExtracted, UtilsI18n__NS__GettextFile, UtilsI18n__NS__LangOption, UtilsI18n__NS__LangOptionArr } from 'tnp-core/browser-prod';
10
+ import { canHaveDecorators, ClassDeclaration, createSourceFile, Decorator, Expression, forEachChild, getDecorators, isCallExpression, isClassDeclaration, isIdentifier, isObjectLiteralExpression, isPropertyAssignment, Node, ScriptKind, ScriptTarget, } from 'typescript';
11
+ import { UtilsI18nExtractGettextTranslateFromHtml__NS__extractGettextTranslateFromHtml } from './utils-i18n-extract-gettext-translate-from-html';
12
+ export function UtilsI18nHtml__NS__extractGettextTranslateFromHtml(html: string, fileName = 'template.html'): UtilsI18n__NS__GettextExtracted[] {
13
+ return UtilsI18nExtractGettextTranslateFromHtml__NS__extractGettextTranslateFromHtml(html, fileName);
14
+ }
15
+ export function UtilsI18nHtml__NS__replaceTranslatePipieDirectiveTContext(html: string, options?: {
16
+ angularTsWithInlineHtml?: boolean;
17
+ }): string {
18
+ return (void 0);
19
+ return void 0 as any;
20
+ }
21
+ export function UtilsI18nHtml__NS__isAngularTsWithInlineHtml(content: string): boolean {
22
+ return (void 0);
23
+ return void 0 as any;
24
+ }
25
+ function replaceInAngularInlineTemplates(content: string): string {
26
+ return (void 0);
27
+ }
28
+ function getAngularInlineTemplateRanges(content: string): Array<{
29
+ start: number;
30
+ end: number;
31
+ html: string;
32
+ quote: '`' | '"' | "'";
33
+ }> {
34
+ return (void 0);
35
+ }
36
+ function hasComponentDecorator(node: ClassDeclaration): boolean {
37
+ return (void 0);
38
+ }
39
+ function getComponentDecorator(node: ClassDeclaration): Decorator | undefined {
40
+ return (void 0);
41
+ }
42
+ function getComponentTemplateInitializer(decorator: Decorator): Expression | undefined {
43
+ return (void 0);
44
+ }
45
+ function getStringLikeInnerRange(content: string, node: Expression): {
46
+ start: number;
47
+ end: number;
48
+ html: string;
49
+ quote: '`' | '"' | "'";
50
+ } | undefined {
51
+ return (void 0);
52
+ }
53
+ export function UtilsI18nHtml__NS__replaceTranslatePipieDirectiveTContextInHtml(html: string): string {
54
+ return (void 0);
55
+ return void 0 as any;
56
+ }
57
+ function findTranslateDirectiveEditsFromSource(html: string): Array<{
58
+ index: number;
59
+ text: string;
60
+ }> {
61
+ return (void 0);
62
+ }
63
+ function hasTranslateDirective(node: any): boolean {
64
+ return (void 0);
65
+ }
66
+ function hasTranslateTInput(node: any): boolean {
67
+ return (void 0);
68
+ }
69
+ function findOpenTagInsertPosition(html: string, start: number, length: number): number {
70
+ return (void 0);
71
+ }
72
+ function applyEdits(input: string, edits: Array<{
73
+ index: number;
74
+ text: string;
75
+ }>): string {
76
+ return (void 0);
77
+ }
@@ -0,0 +1,18 @@
1
+ {
2
+ "namespacesMapObj": {
3
+ "UtilsPoFile.generatePoFiles": "UtilsPoFile__NS__generatePoFiles",
4
+ "UtilsPoFile.generatePoFileContent": "UtilsPoFile__NS__generatePoFileContent",
5
+ "UtilsPoFile.extractPoToJson": "UtilsPoFile__NS__extractPoToJson",
6
+ "UtilsPoFile.generateTranslationOverrideInterface": "UtilsPoFile__NS__generateTranslationOverrideInterface",
7
+ "UtilsPoFile.mergeGettextFile": "UtilsPoFile__NS__mergeGettextFile"
8
+ },
9
+ "namespacesReplace": {
10
+ "UtilsPoFile": [
11
+ "UtilsPoFile__NS__extractPoToJson",
12
+ "UtilsPoFile__NS__generatePoFileContent",
13
+ "UtilsPoFile__NS__generatePoFiles",
14
+ "UtilsPoFile__NS__generateTranslationOverrideInterface",
15
+ "UtilsPoFile__NS__mergeGettextFile"
16
+ ]
17
+ }
18
+ }
@@ -0,0 +1,68 @@
1
+ // @ts-nocheck
2
+ /* ============================================================================
3
+ * TAON READONLY SOURCE
4
+ * DO NOT MODIFY THIS FILE.
5
+ * Changes may be overwritten.
6
+ * ========================================================================== */
7
+
8
+ import { crossPlatformPath, fse, UtilsI18n__NS__CommonLocaleCode, UtilsI18n__NS__CommonLocaleCodeEnum, UtilsI18n__NS__commonLocales, UtilsI18n__NS__defaultLangLocale, UtilsI18n__NS__detectLocale, UtilsI18n__NS__GettextExtracted, UtilsI18n__NS__GettextFile, UtilsI18n__NS__LangOption, UtilsI18n__NS__LangOptionArr } from 'tnp-core/browser-prod';
9
+ export function UtilsPoFile__NS__generatePoFiles(files: UtilsI18n__NS__GettextFile[], locales: UtilsI18n__NS__CommonLocaleCode[], destinationAbsFolderPath: string): void {
10
+ return (void 0);
11
+ }
12
+ export function UtilsPoFile__NS__generatePoFileContent(files: UtilsI18n__NS__GettextFile[], locale: UtilsI18n__NS__CommonLocaleCode): string {
13
+ return (void 0);
14
+ }
15
+ export function UtilsPoFile__NS__extractPoToJson(poFileContent: string): UtilsI18n__NS__GettextFile[] {
16
+ return (void 0);
17
+ }
18
+ export function UtilsPoFile__NS__generateTranslationOverrideInterface(file: UtilsI18n__NS__GettextFile, interfaceName: string, locale: UtilsI18n__NS__CommonLocaleCode): string {
19
+ return (void 0);
20
+ }
21
+ function escapeTs(value: string): string {
22
+ return value.replace(/\\/g, '\\\\').replace(/"/g, '\\"');
23
+ }
24
+ export function UtilsPoFile__NS__mergeGettextFile(jsonContent1FromTsHtml: UtilsI18n__NS__GettextFile, json2ContentFromPoFileModifedByUser?: UtilsI18n__NS__GettextFile | null): UtilsI18n__NS__GettextFile {
25
+ return (void 0);
26
+ }
27
+ function getGettextTagKey(tag: Pick<UtilsI18n__NS__GettextExtracted, 'gettextString' | 'context'>): string {
28
+ return `${tag.context ?? ''}\u0004${tag.gettextString}`;
29
+ }
30
+ interface ParsedPoEntry {
31
+ refs: string[];
32
+ msgctxt?: string;
33
+ msgid?: string;
34
+ msgstr?: string;
35
+ }
36
+ function parsePoEntries(po: string): ParsedPoEntry[] {
37
+ return (void 0);
38
+ }
39
+ function parsePoRef(ref: string): {
40
+ fileAbsPath: string;
41
+ lineNumber: number;
42
+ } | null {
43
+ return (void 0);
44
+ }
45
+ function escapePoString(value: string): string {
46
+ return value
47
+ .replace(/\\/g, '\\\\')
48
+ .replace(/"/g, '\\"')
49
+ .replace(/\n/g, '\\n');
50
+ }
51
+ function readPoQuoted(value: string): string {
52
+ const match = value.match(/^"([\s\S]*)"$/);
53
+ if (!match)
54
+ return '';
55
+ return unescapePoString(match[1]);
56
+ }
57
+ function normalizePoTranslation(translation?: string | null): string | undefined {
58
+ if (translation === undefined || translation === null) {
59
+ return undefined;
60
+ }
61
+ return translation.trim().length > 0 ? translation : undefined;
62
+ }
63
+ function unescapePoString(value: string): string {
64
+ return value
65
+ .replace(/\\n/g, '\n')
66
+ .replace(/\\"/g, '"')
67
+ .replace(/\\\\/g, '\\');
68
+ }
@@ -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,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 } from 'tnp-core/websql';
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.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,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,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,126 @@
1
+ // @ts-nocheck
2
+ /* ============================================================================
3
+ * TAON READONLY SOURCE
4
+ * DO NOT MODIFY THIS FILE.
5
+ * Changes may be overwritten.
6
+ * ========================================================================== */
7
+
8
+ import { crossPlatformPath, dotTaonFolder, UtilsI18n, UtilsOs, _, Helpers, } from 'tnp-core/websql';
9
+ export interface TranslationOptions {
10
+ text: string;
11
+ from: UtilsI18n.CommonLocaleCode;
12
+ to: UtilsI18n.CommonLocaleCode;
13
+ context?: string;
14
+ glossary?: Record<string, string>;
15
+ }
16
+ export interface AiDownloadProgress {
17
+ status: 'initiate' | 'download' | 'progress' | 'progress_total' | 'done' | 'ready' | string;
18
+ file?: string;
19
+ progress?: number;
20
+ loaded?: number;
21
+ total?: number;
22
+ }
23
+ export interface MakeSureAiDownloadedOptions {
24
+ onProgress?: (progress: AiDownloadProgress) => void;
25
+ warmup?: boolean;
26
+ }
27
+ const MODEL_ID = 'Xenova/nllb-200-distilled-600M';
28
+ const nllbLanguageCodes: Partial<Record<UtilsI18n.CommonLocaleCode, string>> = {
29
+ 'en-US': 'eng_Latn',
30
+ 'pl-PL': 'pol_Latn',
31
+ 'de-DE': 'deu_Latn',
32
+ };
33
+ export class LocalTranslationService {
34
+ private translatorPromise?: Promise<any>;
35
+ private aiReady = false;
36
+ private warmupPromise?: Promise<void>;
37
+ private progressListeners = new Set<(progress: AiDownloadProgress) => void>();
38
+ async makeSureAiDownloaded(options: MakeSureAiDownloadedOptions = {}): Promise<void> {
39
+ return (void 0);
40
+ }
41
+ isAiReady(): boolean {
42
+ return this.aiReady;
43
+ }
44
+ private getTranslator(): Promise<any> {
45
+ this.translatorPromise ??= this.createTranslator().catch(error => {
46
+ this.translatorPromise = undefined;
47
+ this.aiReady = false;
48
+ throw error;
49
+ });
50
+ return this.translatorPromise;
51
+ }
52
+ private async createTranslator(): Promise<any> {
53
+ return (void 0);
54
+ return void 0 as any;
55
+ }
56
+ private emitProgress(progress: AiDownloadProgress): void {
57
+ for (const listener of this.progressListeners) {
58
+ try {
59
+ listener(progress);
60
+ }
61
+ catch {
62
+ }
63
+ }
64
+ }
65
+ private warmupTranslator(translator: any): Promise<void> {
66
+ this.warmupPromise ??= translator('Hello.', {
67
+ src_lang: 'eng_Latn',
68
+ tgt_lang: 'pol_Latn',
69
+ max_new_tokens: 16,
70
+ })
71
+ .then(() => undefined)
72
+ .catch(error => {
73
+ this.warmupPromise = undefined;
74
+ throw error;
75
+ });
76
+ return this.warmupPromise;
77
+ }
78
+ async translate(options: TranslationOptions): Promise<string> {
79
+ return (void 0);
80
+ }
81
+ private protectGlossary(text: string, glossary?: Record<string, string>): {
82
+ preparedText: string;
83
+ restore: (translatedText: string) => string;
84
+ } {
85
+ if (!glossary || Object.keys(glossary).length === 0) {
86
+ return {
87
+ preparedText: text,
88
+ restore: translatedText => translatedText,
89
+ };
90
+ }
91
+ const replacements: Array<{
92
+ placeholder: string;
93
+ translatedValue: string;
94
+ }> = [];
95
+ let preparedText = text;
96
+ Object.entries(glossary)
97
+ .sort(([left], [right]) => right.length - left.length)
98
+ .forEach(([sourceValue, translatedValue], index) => {
99
+ const placeholder = `TAONTERM${index}PLACEHOLDER`;
100
+ preparedText = preparedText.replaceAll(sourceValue, placeholder);
101
+ replacements.push({
102
+ placeholder,
103
+ translatedValue,
104
+ });
105
+ });
106
+ return {
107
+ preparedText,
108
+ restore(translatedText: string): string {
109
+ let result = translatedText;
110
+ for (const replacement of replacements) {
111
+ result = result.replaceAll(replacement.placeholder, replacement.translatedValue);
112
+ }
113
+ return result;
114
+ },
115
+ };
116
+ }
117
+ private getModelsCachePath(): string {
118
+ const cachePath = crossPlatformPath([
119
+ UtilsOs.getRealHomeDir(),
120
+ dotTaonFolder,
121
+ 'ai-models-cache',
122
+ ]);
123
+ Helpers.mkdirp(cachePath);
124
+ return cachePath;
125
+ }
126
+ }
@@ -0,0 +1,6 @@
1
+ THIS FILE IS GENERATED - DO NOT MODIFY
2
+
3
+ This folder is only for storing migration files with auto-generated names.
4
+
5
+ THIS FILE IS GENERATED - DO NOT MODIFY
6
+
@@ -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 { LocalTranslationService } from './local-translation';
9
+ export async function startCli(argsv: string[], filename: string): Promise<void> {
10
+ return (void 0);
11
+ }
12
+ export default startCli;
@@ -0,0 +1,59 @@
1
+ // @ts-nocheck
2
+ /* ============================================================================
3
+ * TAON READONLY SOURCE
4
+ * DO NOT MODIFY THIS FILE.
5
+ * Changes may be overwritten.
6
+ * ========================================================================== */
7
+
8
+ import { AfterViewInit, DestroyRef, Directive, ElementRef, inject, Input, OnChanges, } from '@angular/core';
9
+ import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
10
+ import { Translation } from './translation';
11
+ @Directive({
12
+ selector: '[translate]',
13
+ standalone: true,
14
+ })
15
+ export class TranslateDirective implements AfterViewInit, OnChanges {
16
+ private static readonly selector = '[translate]';
17
+ @Input('translate-t')
18
+ t!: Translation;
19
+ @Input('translate-params')
20
+ params?: Record<string, unknown>;
21
+ @Input('translate-context')
22
+ translateContext?: string;
23
+ private initialized = false;
24
+ private readonly element = inject(ElementRef<HTMLElement>);
25
+ private readonly destroyRef = inject(DestroyRef);
26
+ private originalText = '';
27
+ ngAfterViewInit(): void {
28
+ const nativeElement = this.element.nativeElement;
29
+ this.validateContent();
30
+ this.originalText = nativeElement.textContent?.trim() ?? '';
31
+ this.initialized = true;
32
+ this.render();
33
+ this.t.isLoadingLang$
34
+ .pipe(takeUntilDestroyed(this.destroyRef))
35
+ .subscribe(() => {
36
+ this.render();
37
+ });
38
+ }
39
+ ngOnChanges(): void {
40
+ if (!this.initialized) {
41
+ return;
42
+ }
43
+ this.render();
44
+ }
45
+ private validateContent(): void {
46
+ const element = this.element.nativeElement;
47
+ if (element.children.length > 0) {
48
+ console.error(`[@taon-dev/i18n] ${TranslateDirective.selector} should only be used ` +
49
+ `with plain text. HTML/content elements detected inside:`, element);
50
+ }
51
+ }
52
+ private render(): void {
53
+ if (!this.t) {
54
+ throw (`Directive ${TranslateDirective.selector} applied on component ` +
55
+ `without implemented Translatable interface`);
56
+ }
57
+ this.element.nativeElement.textContent = this.t.translate(this.originalText, this.params, this.translateContext);
58
+ }
59
+ }