@jjlmoya/utils-games-development 1.52.0 → 1.53.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (35) hide show
  1. package/package.json +1 -1
  2. package/src/entries.ts +4 -2
  3. package/src/tests/locale_completeness.test.ts +1 -1
  4. package/src/tests/tool_validation.test.ts +1 -1
  5. package/src/tool/localizationSanitizer/app-client.ts +270 -0
  6. package/src/tool/localizationSanitizer/bibliography.astro +6 -0
  7. package/src/tool/localizationSanitizer/bibliography.ts +14 -0
  8. package/src/tool/localizationSanitizer/component.astro +116 -0
  9. package/src/tool/localizationSanitizer/csv-parser.ts +95 -0
  10. package/src/tool/localizationSanitizer/csv-sanitizer.ts +98 -0
  11. package/src/tool/localizationSanitizer/entry.ts +28 -0
  12. package/src/tool/localizationSanitizer/i18n/de.ts +176 -0
  13. package/src/tool/localizationSanitizer/i18n/en.ts +176 -0
  14. package/src/tool/localizationSanitizer/i18n/es.ts +176 -0
  15. package/src/tool/localizationSanitizer/i18n/fr.ts +176 -0
  16. package/src/tool/localizationSanitizer/i18n/id.ts +176 -0
  17. package/src/tool/localizationSanitizer/i18n/it.ts +176 -0
  18. package/src/tool/localizationSanitizer/i18n/ja.ts +176 -0
  19. package/src/tool/localizationSanitizer/i18n/ko.ts +176 -0
  20. package/src/tool/localizationSanitizer/i18n/nl.ts +176 -0
  21. package/src/tool/localizationSanitizer/i18n/pl.ts +176 -0
  22. package/src/tool/localizationSanitizer/i18n/pt.ts +176 -0
  23. package/src/tool/localizationSanitizer/i18n/ru.ts +176 -0
  24. package/src/tool/localizationSanitizer/i18n/sv.ts +176 -0
  25. package/src/tool/localizationSanitizer/i18n/tr.ts +176 -0
  26. package/src/tool/localizationSanitizer/i18n/zh.ts +176 -0
  27. package/src/tool/localizationSanitizer/index.ts +12 -0
  28. package/src/tool/localizationSanitizer/json-sanitizer.ts +118 -0
  29. package/src/tool/localizationSanitizer/localization-sanitizer.css +634 -0
  30. package/src/tool/localizationSanitizer/logic.test.ts +38 -0
  31. package/src/tool/localizationSanitizer/logic.ts +23 -0
  32. package/src/tool/localizationSanitizer/seo.astro +15 -0
  33. package/src/tool/localizationSanitizer/types.ts +55 -0
  34. package/src/tool/localizationSanitizer/ui.ts +39 -0
  35. package/src/tools.ts +2 -1
@@ -0,0 +1,55 @@
1
+ export type TranslationFormat = 'csv' | 'json';
2
+
3
+ export type SanitizerIssueKind = 'empty' | 'duplicate' | 'malformed' | 'parse';
4
+
5
+ export interface SanitizerIssue {
6
+ kind: SanitizerIssueKind;
7
+ row: number;
8
+ column: string;
9
+ key: string;
10
+ detail: string;
11
+ }
12
+
13
+ export interface SanitizerStats {
14
+ totalRows: number;
15
+ cleanRows: number;
16
+ emptyCells: number;
17
+ duplicateKeys: number;
18
+ malformedRows: number;
19
+ }
20
+
21
+ export interface SanitizerResult {
22
+ format: TranslationFormat;
23
+ valid: boolean;
24
+ headers: string[];
25
+ rows: string[][];
26
+ cleanText: string;
27
+ issues: SanitizerIssue[];
28
+ stats: SanitizerStats;
29
+ }
30
+
31
+ export interface ParsedCsvRow {
32
+ values: string[];
33
+ malformed: boolean;
34
+ }
35
+
36
+ export interface JsonRowRecord {
37
+ source: Record<string, unknown>;
38
+ row: number;
39
+ }
40
+
41
+ export interface IssueInput {
42
+ kind: SanitizerIssueKind;
43
+ row: number;
44
+ column: string;
45
+ key: string;
46
+ detail: string;
47
+ }
48
+
49
+ export const EMPTY_STATS: SanitizerStats = {
50
+ totalRows: 0,
51
+ cleanRows: 0,
52
+ emptyCells: 0,
53
+ duplicateKeys: 0,
54
+ malformedRows: 0,
55
+ };
@@ -0,0 +1,39 @@
1
+ export interface LocalizationSanitizerUI extends Record<string, string> {
2
+ csvTab: string;
3
+ jsonTab: string;
4
+ dropTitle: string;
5
+ dropSubtitle: string;
6
+ browseButton: string;
7
+ sampleButton: string;
8
+ clearButton: string;
9
+ inputLabel: string;
10
+ formatLabel: string;
11
+ healthLabel: string;
12
+ readyStatus: string;
13
+ reviewStatus: string;
14
+ emptyCellsLabel: string;
15
+ duplicateKeysLabel: string;
16
+ malformedRowsLabel: string;
17
+ cleanRowsLabel: string;
18
+ issueListTitle: string;
19
+ noIssues: string;
20
+ previewTitle: string;
21
+ previewSubtitle: string;
22
+ exportTitle: string;
23
+ exportSubtitle: string;
24
+ downloadButton: string;
25
+ copyButton: string;
26
+ copiedMessage: string;
27
+ emptyIssue: string;
28
+ duplicateIssue: string;
29
+ malformedIssue: string;
30
+ parseIssue: string;
31
+ rowLabel: string;
32
+ columnLabel: string;
33
+ keyLabel: string;
34
+ sampleFileName: string;
35
+ privacyNote: string;
36
+ waitingTitle: string;
37
+ waitingSubtitle: string;
38
+ fileTypeNote: string;
39
+ }
package/src/tools.ts CHANGED
@@ -5,6 +5,7 @@ import { ITCHIO_GAME_TESTER_TOOL } from './tool/itchioGameTester';
5
5
  import { SPRITE_SHEET_PACKER_TOOL } from './tool/spriteSheetPacker';
6
6
  import { AUDIO_LOOP_POINT_FINDER_TOOL } from './tool/audioLoopPointFinder';
7
7
  import { SAVE_FILE_EDITOR_TOOL } from './tool/saveFileEditor';
8
+ import { LOCALIZATION_SANITIZER_TOOL } from './tool/localizationSanitizer';
8
9
 
9
10
  export const ALL_TOOLS: ToolDefinition[] = [
10
11
  STEAM_CAPSULE_GENERATOR_TOOL,
@@ -12,5 +13,5 @@ export const ALL_TOOLS: ToolDefinition[] = [
12
13
  SPRITE_SHEET_PACKER_TOOL,
13
14
  AUDIO_LOOP_POINT_FINDER_TOOL,
14
15
  SAVE_FILE_EDITOR_TOOL,
16
+ LOCALIZATION_SANITIZER_TOOL,
15
17
  ];
16
-