@localheroai/cli 0.0.86-rc.1 → 0.0.86

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 (58) hide show
  1. package/dist/api/auth.d.ts +2 -0
  2. package/dist/api/client.d.ts +3 -0
  3. package/dist/api/imports.d.ts +5 -0
  4. package/dist/api/projects.d.ts +2 -0
  5. package/dist/api/translation-jobs.js +28 -0
  6. package/dist/api/translation-jobs.js.map +1 -0
  7. package/dist/api/translations.d.ts +15 -0
  8. package/dist/cli.d.ts +2 -0
  9. package/dist/commands/_sync.js +22 -0
  10. package/dist/commands/_sync.js.map +1 -0
  11. package/dist/commands/_translate.js +3 -0
  12. package/dist/commands/_translate.js.map +1 -0
  13. package/dist/commands/github-action.js +111 -0
  14. package/dist/commands/github-action.js.map +1 -0
  15. package/dist/commands/init.d.ts +1 -0
  16. package/dist/commands/login.d.ts +16 -0
  17. package/dist/commands/sync.d.ts +20 -0
  18. package/dist/commands/sync.js +22 -0
  19. package/dist/commands/sync.js.map +1 -0
  20. package/dist/commands/translate.d.ts +14 -0
  21. package/dist/document-formats/markdown.js +519 -0
  22. package/dist/document-formats/markdown.js.map +1 -0
  23. package/dist/document-formats/types.js +11 -0
  24. package/dist/document-formats/types.js.map +1 -0
  25. package/dist/index.d.ts +5 -0
  26. package/dist/types/index.d.ts +75 -0
  27. package/dist/types/translate/index.js +2 -0
  28. package/dist/types/translate/index.js.map +1 -0
  29. package/dist/utils/auth.d.ts +2 -0
  30. package/dist/utils/chunked-json-processor.js +52 -0
  31. package/dist/utils/chunked-json-processor.js.map +1 -0
  32. package/dist/utils/common.js +9 -0
  33. package/dist/utils/common.js.map +1 -0
  34. package/dist/utils/config.d.ts +23 -0
  35. package/dist/utils/errors.js +37 -0
  36. package/dist/utils/errors.js.map +1 -0
  37. package/dist/utils/files.d.ts +32 -0
  38. package/dist/utils/git-diff.js +251 -0
  39. package/dist/utils/git-diff.js.map +1 -0
  40. package/dist/utils/git.d.ts +21 -0
  41. package/dist/utils/github.d.ts +241 -0
  42. package/dist/utils/import-service.d.ts +4 -0
  43. package/dist/utils/po-utils-fallback.js +254 -0
  44. package/dist/utils/po-utils-fallback.js.map +1 -0
  45. package/dist/utils/prompt-service.d.ts +44 -0
  46. package/dist/utils/source-alignment.js +3 -1
  47. package/dist/utils/source-alignment.js.map +1 -1
  48. package/dist/utils/streaming-json-processor.js +125 -0
  49. package/dist/utils/streaming-json-processor.js.map +1 -0
  50. package/dist/utils/sync-service.d.ts +58 -0
  51. package/dist/utils/translation-updater/common.d.ts +6 -0
  52. package/dist/utils/translation-updater/index.d.ts +5 -0
  53. package/dist/utils/translation-updater/json-handler.d.ts +5 -0
  54. package/dist/utils/translation-updater/yaml-handler.d.ts +5 -0
  55. package/dist/utils/translation-utils.d.ts +30 -0
  56. package/dist/utils/updater.js +38 -0
  57. package/dist/utils/updater.js.map +1 -0
  58. package/package.json +1 -1
@@ -0,0 +1,241 @@
1
+ export function createGitHubActionFile(basePath: any, translationPaths: any): Promise<string>;
2
+ export function workflowExists(basePath: any): boolean;
3
+ export function autoCommitChanges(filesPath: any): void;
4
+ export namespace githubService {
5
+ namespace deps {
6
+ export function exec(cmd: any, options: any): string;
7
+ export let fs: {
8
+ existsSync: typeof existsSync;
9
+ access(path: import("fs").PathLike, mode?: number): Promise<void>;
10
+ copyFile(src: import("fs").PathLike, dest: import("fs").PathLike, mode?: number): Promise<void>;
11
+ open(path: import("fs").PathLike, flags?: string | number, mode?: import("fs").Mode): Promise<fs.FileHandle>;
12
+ rename(oldPath: import("fs").PathLike, newPath: import("fs").PathLike): Promise<void>;
13
+ truncate(path: import("fs").PathLike, len?: number): Promise<void>;
14
+ rmdir(path: import("fs").PathLike, options?: import("fs").RmDirOptions): Promise<void>;
15
+ rm(path: import("fs").PathLike, options?: import("fs").RmOptions): Promise<void>;
16
+ mkdir(path: import("fs").PathLike, options: import("fs").MakeDirectoryOptions & {
17
+ recursive: true;
18
+ }): Promise<string | undefined>;
19
+ mkdir(path: import("fs").PathLike, options?: import("fs").Mode | (import("fs").MakeDirectoryOptions & {
20
+ recursive?: false | undefined;
21
+ }) | null): Promise<void>;
22
+ mkdir(path: import("fs").PathLike, options?: import("fs").Mode | import("fs").MakeDirectoryOptions | null): Promise<string | undefined>;
23
+ readdir(path: import("fs").PathLike, options?: (import("fs").ObjectEncodingOptions & {
24
+ withFileTypes?: false | undefined;
25
+ recursive?: boolean | undefined;
26
+ }) | BufferEncoding | null): Promise<string[]>;
27
+ readdir(path: import("fs").PathLike, options: {
28
+ encoding: "buffer";
29
+ withFileTypes?: false | undefined;
30
+ recursive?: boolean | undefined;
31
+ } | "buffer"): Promise<Buffer[]>;
32
+ readdir(path: import("fs").PathLike, options?: (import("fs").ObjectEncodingOptions & {
33
+ withFileTypes?: false | undefined;
34
+ recursive?: boolean | undefined;
35
+ }) | BufferEncoding | null): Promise<string[] | Buffer[]>;
36
+ readdir(path: import("fs").PathLike, options: import("fs").ObjectEncodingOptions & {
37
+ withFileTypes: true;
38
+ recursive?: boolean | undefined;
39
+ }): Promise<import("fs").Dirent[]>;
40
+ readlink(path: import("fs").PathLike, options?: import("fs").ObjectEncodingOptions | BufferEncoding | null): Promise<string>;
41
+ readlink(path: import("fs").PathLike, options: import("fs").BufferEncodingOption): Promise<Buffer>;
42
+ readlink(path: import("fs").PathLike, options?: import("fs").ObjectEncodingOptions | string | null): Promise<string | Buffer>;
43
+ symlink(target: import("fs").PathLike, path: import("fs").PathLike, type?: string | null): Promise<void>;
44
+ lstat(path: import("fs").PathLike, opts?: import("fs").StatOptions & {
45
+ bigint?: false | undefined;
46
+ }): Promise<import("fs").Stats>;
47
+ lstat(path: import("fs").PathLike, opts: import("fs").StatOptions & {
48
+ bigint: true;
49
+ }): Promise<import("fs").BigIntStats>;
50
+ lstat(path: import("fs").PathLike, opts?: import("fs").StatOptions): Promise<import("fs").Stats | import("fs").BigIntStats>;
51
+ stat(path: import("fs").PathLike, opts?: import("fs").StatOptions & {
52
+ bigint?: false | undefined;
53
+ }): Promise<import("fs").Stats>;
54
+ stat(path: import("fs").PathLike, opts: import("fs").StatOptions & {
55
+ bigint: true;
56
+ }): Promise<import("fs").BigIntStats>;
57
+ stat(path: import("fs").PathLike, opts?: import("fs").StatOptions): Promise<import("fs").Stats | import("fs").BigIntStats>;
58
+ statfs(path: import("fs").PathLike, opts?: import("fs").StatFsOptions & {
59
+ bigint?: false | undefined;
60
+ }): Promise<import("fs").StatsFs>;
61
+ statfs(path: import("fs").PathLike, opts: import("fs").StatFsOptions & {
62
+ bigint: true;
63
+ }): Promise<import("fs").BigIntStatsFs>;
64
+ statfs(path: import("fs").PathLike, opts?: import("fs").StatFsOptions): Promise<import("fs").StatsFs | import("fs").BigIntStatsFs>;
65
+ link(existingPath: import("fs").PathLike, newPath: import("fs").PathLike): Promise<void>;
66
+ unlink(path: import("fs").PathLike): Promise<void>;
67
+ chmod(path: import("fs").PathLike, mode: import("fs").Mode): Promise<void>;
68
+ lchmod(path: import("fs").PathLike, mode: import("fs").Mode): Promise<void>;
69
+ lchown(path: import("fs").PathLike, uid: number, gid: number): Promise<void>;
70
+ lutimes(path: import("fs").PathLike, atime: import("fs").TimeLike, mtime: import("fs").TimeLike): Promise<void>;
71
+ chown(path: import("fs").PathLike, uid: number, gid: number): Promise<void>;
72
+ utimes(path: import("fs").PathLike, atime: import("fs").TimeLike, mtime: import("fs").TimeLike): Promise<void>;
73
+ realpath(path: import("fs").PathLike, options?: import("fs").ObjectEncodingOptions | BufferEncoding | null): Promise<string>;
74
+ realpath(path: import("fs").PathLike, options: import("fs").BufferEncodingOption): Promise<Buffer>;
75
+ realpath(path: import("fs").PathLike, options?: import("fs").ObjectEncodingOptions | BufferEncoding | null): Promise<string | Buffer>;
76
+ mkdtemp(prefix: string, options?: import("fs").ObjectEncodingOptions | BufferEncoding | null): Promise<string>;
77
+ mkdtemp(prefix: string, options: import("fs").BufferEncodingOption): Promise<Buffer>;
78
+ mkdtemp(prefix: string, options?: import("fs").ObjectEncodingOptions | BufferEncoding | null): Promise<string | Buffer>;
79
+ writeFile(file: import("fs").PathLike | fs.FileHandle, data: string | NodeJS.ArrayBufferView | Iterable<string | NodeJS.ArrayBufferView> | AsyncIterable<string | NodeJS.ArrayBufferView> | import("stream"), options?: (import("fs").ObjectEncodingOptions & {
80
+ mode?: import("fs").Mode | undefined;
81
+ flag?: import("fs").OpenMode | undefined;
82
+ flush?: boolean | undefined;
83
+ } & import("events").Abortable) | BufferEncoding | null): Promise<void>;
84
+ appendFile(path: import("fs").PathLike | fs.FileHandle, data: string | Uint8Array, options?: (import("fs").ObjectEncodingOptions & fs.FlagAndOpenMode & {
85
+ flush?: boolean | undefined;
86
+ }) | BufferEncoding | null): Promise<void>;
87
+ readFile(path: import("fs").PathLike | fs.FileHandle, options?: ({
88
+ encoding?: null | undefined;
89
+ flag?: import("fs").OpenMode | undefined;
90
+ } & import("events").Abortable) | null): Promise<Buffer>;
91
+ readFile(path: import("fs").PathLike | fs.FileHandle, options: ({
92
+ encoding: BufferEncoding;
93
+ flag?: import("fs").OpenMode | undefined;
94
+ } & import("events").Abortable) | BufferEncoding): Promise<string>;
95
+ readFile(path: import("fs").PathLike | fs.FileHandle, options?: (import("fs").ObjectEncodingOptions & import("events").Abortable & {
96
+ flag?: import("fs").OpenMode | undefined;
97
+ }) | BufferEncoding | null): Promise<string | Buffer>;
98
+ opendir(path: import("fs").PathLike, options?: import("fs").OpenDirOptions): Promise<import("fs").Dir>;
99
+ watch(filename: import("fs").PathLike, options: (import("fs").WatchOptions & {
100
+ encoding: "buffer";
101
+ }) | "buffer"): AsyncIterable<fs.FileChangeInfo<Buffer>>;
102
+ watch(filename: import("fs").PathLike, options?: import("fs").WatchOptions | BufferEncoding): AsyncIterable<fs.FileChangeInfo<string>>;
103
+ watch(filename: import("fs").PathLike, options: import("fs").WatchOptions | string): AsyncIterable<fs.FileChangeInfo<string>> | AsyncIterable<fs.FileChangeInfo<Buffer>>;
104
+ cp(source: string | URL, destination: string | URL, opts?: import("fs").CopyOptions): Promise<void>;
105
+ glob(pattern: string | string[]): NodeJS.AsyncIterator<string>;
106
+ glob(pattern: string | string[], opt: import("fs").GlobOptionsWithFileTypes): NodeJS.AsyncIterator<import("fs").Dirent>;
107
+ glob(pattern: string | string[], opt: import("fs").GlobOptionsWithoutFileTypes): NodeJS.AsyncIterator<string>;
108
+ glob(pattern: string | string[], opt: import("fs").GlobOptions): NodeJS.AsyncIterator<import("fs").Dirent | string>;
109
+ constants: typeof import("fs").constants;
110
+ };
111
+ export { path };
112
+ export let env: NodeJS.ProcessEnv;
113
+ }
114
+ function setDependencies(customDeps?: {}): {
115
+ deps: {
116
+ exec: (cmd: any, options: any) => string;
117
+ fs: {
118
+ existsSync: typeof existsSync;
119
+ access(path: import("fs").PathLike, mode?: number): Promise<void>;
120
+ copyFile(src: import("fs").PathLike, dest: import("fs").PathLike, mode?: number): Promise<void>;
121
+ open(path: import("fs").PathLike, flags?: string | number, mode?: import("fs").Mode): Promise<fs.FileHandle>;
122
+ rename(oldPath: import("fs").PathLike, newPath: import("fs").PathLike): Promise<void>;
123
+ truncate(path: import("fs").PathLike, len?: number): Promise<void>;
124
+ rmdir(path: import("fs").PathLike, options?: import("fs").RmDirOptions): Promise<void>;
125
+ rm(path: import("fs").PathLike, options?: import("fs").RmOptions): Promise<void>;
126
+ mkdir(path: import("fs").PathLike, options: import("fs").MakeDirectoryOptions & {
127
+ recursive: true;
128
+ }): Promise<string | undefined>;
129
+ mkdir(path: import("fs").PathLike, options?: import("fs").Mode | (import("fs").MakeDirectoryOptions & {
130
+ recursive?: false | undefined;
131
+ }) | null): Promise<void>;
132
+ mkdir(path: import("fs").PathLike, options?: import("fs").Mode | import("fs").MakeDirectoryOptions | null): Promise<string | undefined>;
133
+ readdir(path: import("fs").PathLike, options?: (import("fs").ObjectEncodingOptions & {
134
+ withFileTypes?: false | undefined;
135
+ recursive?: boolean | undefined;
136
+ }) | BufferEncoding | null): Promise<string[]>;
137
+ readdir(path: import("fs").PathLike, options: {
138
+ encoding: "buffer";
139
+ withFileTypes?: false | undefined;
140
+ recursive?: boolean | undefined;
141
+ } | "buffer"): Promise<Buffer[]>;
142
+ readdir(path: import("fs").PathLike, options?: (import("fs").ObjectEncodingOptions & {
143
+ withFileTypes?: false | undefined;
144
+ recursive?: boolean | undefined;
145
+ }) | BufferEncoding | null): Promise<string[] | Buffer[]>;
146
+ readdir(path: import("fs").PathLike, options: import("fs").ObjectEncodingOptions & {
147
+ withFileTypes: true;
148
+ recursive?: boolean | undefined;
149
+ }): Promise<import("fs").Dirent[]>;
150
+ readlink(path: import("fs").PathLike, options?: import("fs").ObjectEncodingOptions | BufferEncoding | null): Promise<string>;
151
+ readlink(path: import("fs").PathLike, options: import("fs").BufferEncodingOption): Promise<Buffer>;
152
+ readlink(path: import("fs").PathLike, options?: import("fs").ObjectEncodingOptions | string | null): Promise<string | Buffer>;
153
+ symlink(target: import("fs").PathLike, path: import("fs").PathLike, type?: string | null): Promise<void>;
154
+ lstat(path: import("fs").PathLike, opts?: import("fs").StatOptions & {
155
+ bigint?: false | undefined;
156
+ }): Promise<import("fs").Stats>;
157
+ lstat(path: import("fs").PathLike, opts: import("fs").StatOptions & {
158
+ bigint: true;
159
+ }): Promise<import("fs").BigIntStats>;
160
+ lstat(path: import("fs").PathLike, opts?: import("fs").StatOptions): Promise<import("fs").Stats | import("fs").BigIntStats>;
161
+ stat(path: import("fs").PathLike, opts?: import("fs").StatOptions & {
162
+ bigint?: false | undefined;
163
+ }): Promise<import("fs").Stats>;
164
+ stat(path: import("fs").PathLike, opts: import("fs").StatOptions & {
165
+ bigint: true;
166
+ }): Promise<import("fs").BigIntStats>;
167
+ stat(path: import("fs").PathLike, opts?: import("fs").StatOptions): Promise<import("fs").Stats | import("fs").BigIntStats>;
168
+ statfs(path: import("fs").PathLike, opts?: import("fs").StatFsOptions & {
169
+ bigint?: false | undefined;
170
+ }): Promise<import("fs").StatsFs>;
171
+ statfs(path: import("fs").PathLike, opts: import("fs").StatFsOptions & {
172
+ bigint: true;
173
+ }): Promise<import("fs").BigIntStatsFs>;
174
+ statfs(path: import("fs").PathLike, opts?: import("fs").StatFsOptions): Promise<import("fs").StatsFs | import("fs").BigIntStatsFs>;
175
+ link(existingPath: import("fs").PathLike, newPath: import("fs").PathLike): Promise<void>;
176
+ unlink(path: import("fs").PathLike): Promise<void>;
177
+ chmod(path: import("fs").PathLike, mode: import("fs").Mode): Promise<void>;
178
+ lchmod(path: import("fs").PathLike, mode: import("fs").Mode): Promise<void>;
179
+ lchown(path: import("fs").PathLike, uid: number, gid: number): Promise<void>;
180
+ lutimes(path: import("fs").PathLike, atime: import("fs").TimeLike, mtime: import("fs").TimeLike): Promise<void>;
181
+ chown(path: import("fs").PathLike, uid: number, gid: number): Promise<void>;
182
+ utimes(path: import("fs").PathLike, atime: import("fs").TimeLike, mtime: import("fs").TimeLike): Promise<void>;
183
+ realpath(path: import("fs").PathLike, options?: import("fs").ObjectEncodingOptions | BufferEncoding | null): Promise<string>;
184
+ realpath(path: import("fs").PathLike, options: import("fs").BufferEncodingOption): Promise<Buffer>;
185
+ realpath(path: import("fs").PathLike, options?: import("fs").ObjectEncodingOptions | BufferEncoding | null): Promise<string | Buffer>;
186
+ mkdtemp(prefix: string, options?: import("fs").ObjectEncodingOptions | BufferEncoding | null): Promise<string>;
187
+ mkdtemp(prefix: string, options: import("fs").BufferEncodingOption): Promise<Buffer>;
188
+ mkdtemp(prefix: string, options?: import("fs").ObjectEncodingOptions | BufferEncoding | null): Promise<string | Buffer>;
189
+ writeFile(file: import("fs").PathLike | fs.FileHandle, data: string | NodeJS.ArrayBufferView | Iterable<string | NodeJS.ArrayBufferView> | AsyncIterable<string | NodeJS.ArrayBufferView> | import("stream"), options?: (import("fs").ObjectEncodingOptions & {
190
+ mode?: import("fs").Mode | undefined;
191
+ flag?: import("fs").OpenMode | undefined;
192
+ flush?: boolean | undefined;
193
+ } & import("events").Abortable) | BufferEncoding | null): Promise<void>;
194
+ appendFile(path: import("fs").PathLike | fs.FileHandle, data: string | Uint8Array, options?: (import("fs").ObjectEncodingOptions & fs.FlagAndOpenMode & {
195
+ flush?: boolean | undefined;
196
+ }) | BufferEncoding | null): Promise<void>;
197
+ readFile(path: import("fs").PathLike | fs.FileHandle, options?: ({
198
+ encoding?: null | undefined;
199
+ flag?: import("fs").OpenMode | undefined;
200
+ } & import("events").Abortable) | null): Promise<Buffer>;
201
+ readFile(path: import("fs").PathLike | fs.FileHandle, options: ({
202
+ encoding: BufferEncoding;
203
+ flag?: import("fs").OpenMode | undefined;
204
+ } & import("events").Abortable) | BufferEncoding): Promise<string>;
205
+ readFile(path: import("fs").PathLike | fs.FileHandle, options?: (import("fs").ObjectEncodingOptions & import("events").Abortable & {
206
+ flag?: import("fs").OpenMode | undefined;
207
+ }) | BufferEncoding | null): Promise<string | Buffer>;
208
+ opendir(path: import("fs").PathLike, options?: import("fs").OpenDirOptions): Promise<import("fs").Dir>;
209
+ watch(filename: import("fs").PathLike, options: (import("fs").WatchOptions & {
210
+ encoding: "buffer";
211
+ }) | "buffer"): AsyncIterable<fs.FileChangeInfo<Buffer>>;
212
+ watch(filename: import("fs").PathLike, options?: import("fs").WatchOptions | BufferEncoding): AsyncIterable<fs.FileChangeInfo<string>>;
213
+ watch(filename: import("fs").PathLike, options: import("fs").WatchOptions | string): AsyncIterable<fs.FileChangeInfo<string>> | AsyncIterable<fs.FileChangeInfo<Buffer>>;
214
+ cp(source: string | URL, destination: string | URL, opts?: import("fs").CopyOptions): Promise<void>;
215
+ glob(pattern: string | string[]): NodeJS.AsyncIterator<string>;
216
+ glob(pattern: string | string[], opt: import("fs").GlobOptionsWithFileTypes): NodeJS.AsyncIterator<import("fs").Dirent>;
217
+ glob(pattern: string | string[], opt: import("fs").GlobOptionsWithoutFileTypes): NodeJS.AsyncIterator<string>;
218
+ glob(pattern: string | string[], opt: import("fs").GlobOptions): NodeJS.AsyncIterator<import("fs").Dirent | string>;
219
+ constants: typeof import("fs").constants;
220
+ };
221
+ path: path.PlatformPath;
222
+ env: NodeJS.ProcessEnv;
223
+ };
224
+ setDependencies(customDeps?: {}): /*elided*/ any;
225
+ isGitHubAction(): boolean;
226
+ workflowExists(basePath: any): boolean;
227
+ getWorkflowDir(basePath: any): string;
228
+ getGithubActionWorkflowFilePath(basePath: any): string;
229
+ createGitHubActionFile(basePath: any, translationPaths: any): Promise<string>;
230
+ autoCommitChanges(filesPath: any): void;
231
+ };
232
+ function isGitHubAction(): boolean;
233
+ function workflowExists(basePath: any): boolean;
234
+ function getWorkflowDir(basePath: any): string;
235
+ function getGithubActionWorkflowFilePath(basePath: any): string;
236
+ function createGitHubActionFile(basePath: any, translationPaths: any): Promise<string>;
237
+ function autoCommitChanges(filesPath: any): void;
238
+ }
239
+ import { existsSync } from 'fs';
240
+ import { promises as fs_1 } from 'fs';
241
+ import path from 'path';
@@ -0,0 +1,4 @@
1
+ export namespace importService {
2
+ function findTranslationFiles(config: any, basePath?: string): Promise<any>;
3
+ function importTranslations(config: any, basePath?: string): Promise<any>;
4
+ }
@@ -0,0 +1,254 @@
1
+ import { po } from 'gettext-parser';
2
+ import { createUniqueKey, parseUniqueKey, parsePoFile, normalizeStringValue, PLURAL_SUFFIX } from './po-utils.js';
3
+ /**
4
+ * Build a map of msgid_plural values to check for duplicates
5
+ */
6
+ function buildPluralFormsMap(parsed) {
7
+ const pluralForms = new Map();
8
+ Object.entries(parsed.translations).forEach(([context, entries]) => {
9
+ if (typeof entries === 'object' && entries !== null) {
10
+ Object.entries(entries).forEach(([msgid, entry]) => {
11
+ if (msgid === '' || !entry.msgid_plural)
12
+ return;
13
+ // Map the plural form to its context and original msgid
14
+ const pluralKey = createUniqueKey(entry.msgid_plural, context !== '' ? context : undefined);
15
+ pluralForms.set(pluralKey, { context, msgid });
16
+ });
17
+ }
18
+ });
19
+ return pluralForms;
20
+ }
21
+ /**
22
+ * Check if a key is a plural suffix key
23
+ */
24
+ function isPluralKey(key) {
25
+ return key.endsWith(PLURAL_SUFFIX);
26
+ }
27
+ /**
28
+ * Get the base key from a plural suffix key
29
+ */
30
+ function getBaseKeyFromPlural(key) {
31
+ return key.replace(/__plural_\d+$/, '');
32
+ }
33
+ /**
34
+ * Group plural translations together
35
+ */
36
+ function groupPluralTranslations(translations) {
37
+ const regular = {};
38
+ const pluralGroups = new Map();
39
+ // First pass: identify plural pairs
40
+ Object.keys(translations).forEach(key => {
41
+ if (isPluralKey(key)) {
42
+ const baseKey = getBaseKeyFromPlural(key);
43
+ if (translations[baseKey]) {
44
+ // This is a plural pair
45
+ pluralGroups.set(baseKey, {
46
+ singular: translations[baseKey],
47
+ plural: translations[key]
48
+ });
49
+ }
50
+ }
51
+ });
52
+ // Second pass: add regular keys (excluding those in plural pairs)
53
+ Object.entries(translations).forEach(([key, value]) => {
54
+ if (!isPluralKey(key) && !pluralGroups.has(key)) {
55
+ regular[key] = value;
56
+ }
57
+ });
58
+ return { regular, pluralGroups };
59
+ }
60
+ /**
61
+ * Detect the fold length used in the original .po file by analyzing line lengths
62
+ * Returns the detected fold length, or 76 (gettext default) if no clear pattern
63
+ */
64
+ function detectFoldLength(content) {
65
+ const lines = content.split('\n');
66
+ const quotedLines = lines.filter(line => line.trim().startsWith('"') && line.trim().endsWith('"'));
67
+ if (quotedLines.length < 5) {
68
+ return 76; // Use gettext default
69
+ }
70
+ // Check if the file has multiline strings (indicates intentional wrapping)
71
+ const hasMultilineStrings = lines.some(line => line.trim() === 'msgid ""' || line.trim() === 'msgstr ""');
72
+ if (!hasMultilineStrings) {
73
+ return 76; // Use default for simple files
74
+ }
75
+ // Find the longest line length - this represents the wrap point used
76
+ const maxLength = Math.max(...quotedLines.map(line => line.length));
77
+ // If the longest line is in a reasonable range, use it
78
+ // Otherwise fall back to gettext standard
79
+ if (maxLength >= 70 && maxLength <= 100) {
80
+ return maxLength;
81
+ }
82
+ return 76; // gettext default
83
+ }
84
+ /**
85
+ * Old implementation of updatePoFile for fallback when new entries need to be added
86
+ */
87
+ export function updatePoFileOld(originalContent, translations, options) {
88
+ const parsed = po.parse(originalContent);
89
+ const updatedTranslations = new Set();
90
+ const pluralFormsMap = buildPluralFormsMap(parsed);
91
+ let hasChanges = false;
92
+ const { regular, pluralGroups } = groupPluralTranslations(translations);
93
+ Object.entries(parsed.translations).forEach(([context, entries]) => {
94
+ if (typeof entries === 'object' && entries !== null) {
95
+ Object.entries(entries).forEach(([msgid, entry]) => {
96
+ if (msgid === '')
97
+ return; // Skip header
98
+ const uniqueKey = createUniqueKey(msgid, context !== '' ? context : undefined);
99
+ // Check if this is a plural entry (either complete pair or partial)
100
+ if (entry.msgid_plural) {
101
+ const isCompletePair = pluralGroups.has(uniqueKey);
102
+ const hasSingularOnly = regular[uniqueKey];
103
+ if (isCompletePair) {
104
+ const pluralData = pluralGroups.get(uniqueKey);
105
+ const singularValue = pluralData.singular;
106
+ const currentValue = entry.msgstr[0] || '';
107
+ // Skip updating only if this is a source language entry and values match AND current value is not empty
108
+ const skipSingular = (singularValue === msgid && options?.sourceLanguage === options?.targetLanguage && currentValue.trim() !== '');
109
+ if (!skipSingular && currentValue.trim() !== singularValue.trim()) {
110
+ entry.msgstr[0] = singularValue;
111
+ hasChanges = true;
112
+ }
113
+ const pluralValue = pluralData.plural;
114
+ const currentPluralValue = entry.msgstr[1] || '';
115
+ // Skip updating only if this is a source language entry and values match AND current value is not empty
116
+ const skipPlural = (pluralValue === entry.msgid_plural && options?.sourceLanguage === options?.targetLanguage && currentPluralValue.trim() !== '');
117
+ if (!skipPlural && currentPluralValue.trim() !== pluralValue.trim()) {
118
+ entry.msgstr[1] = pluralValue;
119
+ hasChanges = true;
120
+ }
121
+ updatedTranslations.add(uniqueKey);
122
+ updatedTranslations.add(uniqueKey + PLURAL_SUFFIX);
123
+ }
124
+ else if (hasSingularOnly) {
125
+ // Handle partial plural translation (singular only)
126
+ const singularValue = regular[uniqueKey];
127
+ const currentValue = entry.msgstr[0] || '';
128
+ // Skip updating only if this is a source language entry and values match AND current value is not empty
129
+ const skipSingular = (singularValue === msgid && options?.sourceLanguage === options?.targetLanguage && currentValue.trim() !== '');
130
+ if (!skipSingular && currentValue.trim() !== singularValue.trim()) {
131
+ entry.msgstr[0] = singularValue;
132
+ hasChanges = true;
133
+ }
134
+ updatedTranslations.add(uniqueKey);
135
+ }
136
+ }
137
+ else if (regular[uniqueKey]) {
138
+ const newValue = regular[uniqueKey];
139
+ // Skip updating if this is a source language entry (msgid === msgstr)
140
+ if (newValue === msgid && options?.sourceLanguage === options?.targetLanguage) {
141
+ updatedTranslations.add(uniqueKey);
142
+ return;
143
+ }
144
+ const currentValue = normalizeStringValue(entry.msgstr);
145
+ const normalizedNewValue = normalizeStringValue(newValue);
146
+ // Only update if the normalized content is actually different
147
+ // This prevents unnecessary line wrapping changes
148
+ if (currentValue !== normalizedNewValue) {
149
+ entry.msgstr = [newValue];
150
+ hasChanges = true;
151
+ }
152
+ updatedTranslations.add(uniqueKey);
153
+ }
154
+ });
155
+ }
156
+ });
157
+ // Add new translations that weren't found in existing entries
158
+ // But skip plural suffix keys - they should not be added as separate entries
159
+ Object.entries(regular).forEach(([uniqueKey, value]) => {
160
+ if (!updatedTranslations.has(uniqueKey)) {
161
+ const { msgid, context } = parseUniqueKey(uniqueKey);
162
+ const contextKey = context || '';
163
+ // this can happen with malformed keys
164
+ if (!msgid || msgid.trim() === '') {
165
+ return;
166
+ }
167
+ // Skip adding new entries where msgid === msgstr (source language files only)
168
+ if (value === msgid && options?.sourceLanguage === options?.targetLanguage) {
169
+ return;
170
+ }
171
+ // Skip if this msgid is already used as msgid_plural in an existing entry
172
+ if (pluralFormsMap.has(uniqueKey)) {
173
+ return;
174
+ }
175
+ // Initialize context if it doesn't exist
176
+ if (!parsed.translations[contextKey]) {
177
+ parsed.translations[contextKey] = {};
178
+ }
179
+ parsed.translations[contextKey][msgid] = {
180
+ msgid: msgid,
181
+ msgstr: [value]
182
+ };
183
+ hasChanges = true;
184
+ }
185
+ });
186
+ // Add new plural translations that weren't found in existing entries
187
+ pluralGroups.forEach((pluralData, uniqueKey) => {
188
+ if (!updatedTranslations.has(uniqueKey)) {
189
+ const { msgid, context } = parseUniqueKey(uniqueKey);
190
+ const contextKey = context || '';
191
+ // this can happen with malformed keys
192
+ if (!msgid || msgid.trim() === '') {
193
+ return;
194
+ }
195
+ const pluralKey = uniqueKey + PLURAL_SUFFIX;
196
+ // Try to find the proper msgid_plural from the source file if available
197
+ let msgid_plural = pluralData.plural; // fallback
198
+ if (options?.sourceContent) {
199
+ try {
200
+ const sourceParsed = parsePoFile(options.sourceContent);
201
+ const sourceEntries = sourceParsed.entries;
202
+ // Find the matching source entry with msgid_plural
203
+ const sourceEntry = sourceEntries.find(entry => {
204
+ const sourceKey = createUniqueKey(entry.msgid, entry.msgctxt);
205
+ return sourceKey === uniqueKey && entry.msgid_plural;
206
+ });
207
+ if (sourceEntry && sourceEntry.msgid_plural) {
208
+ msgid_plural = sourceEntry.msgid_plural;
209
+ }
210
+ }
211
+ catch (error) {
212
+ // If source parsing fails, continue with fallback
213
+ console.warn('Failed to parse source content for msgid_plural lookup', error);
214
+ }
215
+ }
216
+ // Initialize context if it doesn't exist
217
+ if (!parsed.translations[contextKey]) {
218
+ parsed.translations[contextKey] = {};
219
+ }
220
+ // Create new plural entry with proper msgid_plural
221
+ parsed.translations[contextKey][msgid] = {
222
+ msgid: msgid,
223
+ msgid_plural: msgid_plural,
224
+ msgstr: [pluralData.singular, pluralData.plural]
225
+ };
226
+ hasChanges = true;
227
+ // Mark both keys as updated
228
+ updatedTranslations.add(uniqueKey);
229
+ updatedTranslations.add(pluralKey);
230
+ }
231
+ });
232
+ // If no actual changes were made, return original content to preserve formatting
233
+ if (!hasChanges) {
234
+ return originalContent;
235
+ }
236
+ // Extract header section from original content
237
+ const lines = originalContent.split('\n');
238
+ const headerEndIndex = lines.findIndex((line, index) => index > 0 && line.trim() === '' && lines[index - 1].includes('"'));
239
+ let headerSection = '';
240
+ if (headerEndIndex > 0) {
241
+ headerSection = lines.slice(0, headerEndIndex + 1).join('\n') + '\n';
242
+ }
243
+ // Use detected fold length from original content
244
+ const foldLength = detectFoldLength(originalContent);
245
+ const compiled = po.compile(parsed, { foldLength }).toString();
246
+ const compiledLines = compiled.split('\n');
247
+ const compiledHeaderEndIndex = compiledLines.findIndex((line, index) => index > 0 && line.trim() === '' && compiledLines[index - 1].includes('"'));
248
+ if (headerSection && compiledHeaderEndIndex > 0) {
249
+ const bodySection = compiledLines.slice(compiledHeaderEndIndex + 1).join('\n');
250
+ return headerSection + bodySection;
251
+ }
252
+ return compiled;
253
+ }
254
+ //# sourceMappingURL=po-utils-fallback.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"po-utils-fallback.js","sourceRoot":"","sources":["../../src/utils/po-utils-fallback.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,gBAAgB,CAAC;AACpC,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,WAAW,EAAE,oBAAoB,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAElH;;GAEG;AACH,SAAS,mBAAmB,CAAC,MAAW;IACtC,MAAM,WAAW,GAAG,IAAI,GAAG,EAA8C,CAAC;IAE1E,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,OAAO,EAAE,OAAO,CAAC,EAAE,EAAE;QACjE,IAAI,OAAO,OAAO,KAAK,QAAQ,IAAI,OAAO,KAAK,IAAI,EAAE,CAAC;YACpD,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,EAAE,KAAK,CAAgB,EAAE,EAAE;gBAChE,IAAI,KAAK,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,YAAY;oBAAE,OAAO;gBAEhD,wDAAwD;gBACxD,MAAM,SAAS,GAAG,eAAe,CAAC,KAAK,CAAC,YAAY,EAAE,OAAO,KAAK,EAAE,CAAC,CAAC,CAAC,OAAO,CAA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,KAAK,GAAG,CAAC,IAAI,IAAI,CAAC,IAAI,EAAE,KAAK,EAAE,IAAI,aAAa,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,CAC1E,CAAC;IAEF,IAAI,aAAa,IAAI,sBAAsB,GAAG,CAAC,EAAE,CAAC;QAChD,MAAM,WAAW,GAAG,aAAa,CAAC,KAAK,CAAC,sBAAsB,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC/E,OAAO,aAAa,GAAG,WAAW,CAAC;IACrC,CAAC;IAED,OAAO,QAAQ,CAAC;AAClB,CAAC"}
@@ -0,0 +1,44 @@
1
+ interface ProjectService {
2
+ listProjects: () => Promise<Array<{
3
+ id: string;
4
+ name: string;
5
+ }>>;
6
+ }
7
+ interface ProjectSetup {
8
+ projectName: string;
9
+ sourceLocale: string;
10
+ outputLocales: string[];
11
+ translationPath: string;
12
+ ignorePaths: string[];
13
+ }
14
+ interface ProjectSelection {
15
+ choice: string;
16
+ project?: {
17
+ id: string;
18
+ name: string;
19
+ };
20
+ }
21
+ export declare function createPromptService(deps?: {
22
+ inquirer?: any;
23
+ }): {
24
+ getApiKey: () => Promise<string>;
25
+ getProjectSetup: () => Promise<ProjectSetup>;
26
+ select: <T>(options: {
27
+ message: string;
28
+ choices: Array<{
29
+ name: string;
30
+ value: T;
31
+ disabled?: boolean;
32
+ }>;
33
+ }) => Promise<T>;
34
+ input: (options: {
35
+ message: string;
36
+ default?: string;
37
+ }) => Promise<string>;
38
+ confirm: (options: {
39
+ message: string;
40
+ default?: boolean;
41
+ }) => Promise<boolean>;
42
+ selectProject: (projectService: ProjectService) => Promise<ProjectSelection>;
43
+ };
44
+ export {};
@@ -1,5 +1,6 @@
1
1
  import chalk from 'chalk';
2
2
  import { createSourceAlignment, SourceAlignmentRequestError } from '../api/source-alignments.js';
3
+ const ALREADY_ALIGNED = 'already_aligned';
3
4
  const MAX_ITEMS_PER_REQUEST = 25;
4
5
  const NOT_FOUND_STATUS = 404;
5
6
  const INVALID_PARAMETERS_STATUS = 422;
@@ -79,7 +80,8 @@ function describeLocale(locale, summary) {
79
80
  parts.push(`${summary.aligned} aligned`);
80
81
  if (summary.unchanged > 0)
81
82
  parts.push(`${summary.unchanged} already ${summary.unchanged === 1 ? 'fits' : 'fit'}`);
82
- const reasons = Object.entries(summary.skipped);
83
+ // Already aligned means there was nothing to do; every push re-checks the keys a branch added.
84
+ const reasons = Object.entries(summary.skipped).filter(([reason]) => reason !== ALREADY_ALIGNED);
83
85
  if (reasons.length > 0) {
84
86
  const total = reasons.reduce((sum, [, count]) => sum + count, 0);
85
87
  const breakdown = reasons.map(([reason, count]) => `${count} ${reason}`).join(', ');
@@ -1 +1 @@
1
- {"version":3,"file":"source-alignment.js","sourceRoot":"","sources":["../../src/utils/source-alignment.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EACL,qBAAqB,EACrB,2BAA2B,EAK5B,MAAM,6BAA6B,CAAC;AAyCrC,MAAM,qBAAqB,GAAG,EAAE,CAAC;AACjC,MAAM,gBAAgB,GAAG,GAAG,CAAC;AAC7B,MAAM,yBAAyB,GAAG,GAAG,CAAC;AAEtC;;;;GAIG;AACH,MAAM,CAAC,KAAK,UAAU,kBAAkB,CACtC,UAAgC,EAChC,OAAyB,EACzB,IAA2B;IAE3B,MAAM,MAAM,GAA0B;QACpC,OAAO,EAAE,KAAK;QACd,YAAY,EAAE,EAAE;QAChB,eAAe,EAAE,EAAE;QACnB,OAAO,EAAE,EAAE;QACX,QAAQ,EAAE,IAAI;KACf,CAAC;IAEF,KAAK,MAAM,CAAC,MAAM,EAAE,gBAAgB,CAAC,IAAI,OAAO,CAAC,UAAU,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC;QAC5E,IAAI,SAAS,GAAyB,EAAE,CAAC;QACzC,IAAI,KAAK,GAAgC,EAAE,CAAC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