@parhelia/localization 0.1.12903 → 0.1.12904
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/LocalizeItemCommand.d.ts +1 -7
- package/dist/LocalizeItemCommand.d.ts.map +1 -1
- package/dist/LocalizeItemCommand.js +18 -31
- package/dist/LocalizeItemDialog.d.ts.map +1 -1
- package/dist/LocalizeItemDialog.js +35 -97
- package/dist/LocalizeItemUtils.d.ts +2 -1
- package/dist/LocalizeItemUtils.d.ts.map +1 -1
- package/dist/LocalizeItemUtils.js +36 -78
- package/dist/api/discovery.d.ts +0 -25
- package/dist/api/discovery.d.ts.map +1 -1
- package/dist/api/discovery.js +2 -106
- package/dist/constants.d.ts +15 -0
- package/dist/constants.d.ts.map +1 -0
- package/dist/constants.js +21 -0
- package/dist/hooks/useTranslationWizard.d.ts.map +1 -1
- package/dist/hooks/useTranslationWizard.js +3 -3
- package/dist/index.d.ts +11 -10
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +32 -36
- package/dist/services/translationService.d.ts +10 -41
- package/dist/services/translationService.d.ts.map +1 -1
- package/dist/services/translationService.js +6 -48
- package/dist/settings/TranslationServicesPanel.d.ts.map +1 -1
- package/dist/settings/TranslationServicesPanel.js +36 -21
- package/dist/setup/LocalizationSetupStep.d.ts.map +1 -1
- package/dist/setup/LocalizationSetupStep.js +18 -29
- package/dist/sidebar/TranslationSidebar.d.ts.map +1 -1
- package/dist/sidebar/TranslationSidebar.js +10 -20
- package/dist/steps/MetadataInputStep.d.ts +4 -0
- package/dist/steps/MetadataInputStep.d.ts.map +1 -0
- package/dist/steps/MetadataInputStep.js +41 -0
- package/dist/steps/PromptCustomizationStep.d.ts +1 -1
- package/dist/steps/PromptCustomizationStep.d.ts.map +1 -1
- package/dist/steps/PromptCustomizationStep.js +56 -159
- package/dist/steps/ServiceLanguageSelectionStep.d.ts +1 -6
- package/dist/steps/ServiceLanguageSelectionStep.d.ts.map +1 -1
- package/dist/steps/ServiceLanguageSelectionStep.js +165 -92
- package/dist/steps/SubitemDiscoveryStep.d.ts +3 -0
- package/dist/steps/SubitemDiscoveryStep.d.ts.map +1 -0
- package/dist/steps/SubitemDiscoveryStep.js +313 -0
- package/dist/steps/index.d.ts +5 -0
- package/dist/steps/index.d.ts.map +1 -0
- package/dist/steps/index.js +4 -0
- package/dist/steps/types.d.ts +1 -17
- package/dist/steps/types.d.ts.map +1 -1
- package/dist/translation-center/BatchTranslationView.d.ts +8 -0
- package/dist/translation-center/BatchTranslationView.d.ts.map +1 -0
- package/dist/translation-center/BatchTranslationView.js +870 -0
- package/dist/translation-center/RecentTranslations.d.ts +2 -0
- package/dist/translation-center/RecentTranslations.d.ts.map +1 -0
- package/dist/translation-center/RecentTranslations.js +309 -0
- package/dist/translation-center/TranslationManagement.d.ts.map +1 -1
- package/dist/translation-center/TranslationManagement.js +15 -25
- package/dist/types.d.ts +0 -1
- package/dist/types.d.ts.map +1 -1
- package/dist/utils/createVersions.d.ts +14 -0
- package/dist/utils/createVersions.d.ts.map +1 -0
- package/dist/utils/createVersions.js +26 -0
- package/package.json +1 -1
- package/dist/steps/ItemSelectionStep.d.ts +0 -3
- package/dist/steps/ItemSelectionStep.d.ts.map +0 -1
- package/dist/steps/ItemSelectionStep.js +0 -24
- package/dist/steps/ItemSelectionTree.d.ts +0 -13
- package/dist/steps/ItemSelectionTree.d.ts.map +0 -1
- package/dist/steps/ItemSelectionTree.js +0 -327
- package/dist/steps/WizardStepShell.d.ts +0 -17
- package/dist/steps/WizardStepShell.d.ts.map +0 -1
- package/dist/steps/WizardStepShell.js +0 -11
- package/dist/translation-center/TranslationBatches.d.ts +0 -2
- package/dist/translation-center/TranslationBatches.d.ts.map +0 -1
- package/dist/translation-center/TranslationBatches.js +0 -1180
- package/dist/translation-center/TranslationsTitlebar.d.ts +0 -6
- package/dist/translation-center/TranslationsTitlebar.d.ts.map +0 -1
- package/dist/translation-center/TranslationsTitlebar.js +0 -25
- package/dist/translationEvents.d.ts +0 -6
- package/dist/translationEvents.d.ts.map +0 -1
- package/dist/translationEvents.js +0 -4
package/dist/api/discovery.js
CHANGED
|
@@ -1,15 +1,4 @@
|
|
|
1
1
|
import { post } from "@parhelia/core";
|
|
2
|
-
export async function suggestBatchName(req, sessionId) {
|
|
3
|
-
const { data, type } = await post("/parhelia/translation/suggestBatchName", {
|
|
4
|
-
ItemIds: req.itemIds,
|
|
5
|
-
TargetLanguages: req.targetLanguages,
|
|
6
|
-
IncludeSubitems: !!req.includeSubitems,
|
|
7
|
-
}, sessionId);
|
|
8
|
-
if (type !== "success")
|
|
9
|
-
return null;
|
|
10
|
-
const name = data?.name?.trim();
|
|
11
|
-
return name && name.length > 0 ? name : null;
|
|
12
|
-
}
|
|
13
2
|
export async function discoverItemsTree(req, sessionId) {
|
|
14
3
|
const { data, type, details } = await post("/parhelia/translation/discoveritemstree", {
|
|
15
4
|
RootItemIds: req.rootItemIds,
|
|
@@ -23,15 +12,7 @@ export function convertBackendTreeToTreeNodes(trees) {
|
|
|
23
12
|
const convert = (n) => ({
|
|
24
13
|
key: n.id,
|
|
25
14
|
label: n.name,
|
|
26
|
-
data: {
|
|
27
|
-
id: n.id,
|
|
28
|
-
name: n.name,
|
|
29
|
-
path: n.path,
|
|
30
|
-
isFolder: n.isFolder,
|
|
31
|
-
icon: n.icon,
|
|
32
|
-
parentId: undefined,
|
|
33
|
-
hasChildren: (n.children?.length ?? 0) > 0,
|
|
34
|
-
},
|
|
15
|
+
data: { id: n.id, name: n.name, path: n.path, isFolder: n.isFolder, icon: n.icon, parentId: undefined, hasChildren: (n.children?.length ?? 0) > 0 },
|
|
35
16
|
children: n.children?.map(convert) || [],
|
|
36
17
|
});
|
|
37
18
|
return trees.map(convert);
|
|
@@ -39,94 +20,9 @@ export function convertBackendTreeToTreeNodes(trees) {
|
|
|
39
20
|
export function flattenSelectableItemsFromBackendTrees(trees) {
|
|
40
21
|
const out = [];
|
|
41
22
|
const walk = (n) => {
|
|
42
|
-
out.push({
|
|
43
|
-
id: n.id,
|
|
44
|
-
name: n.name,
|
|
45
|
-
path: n.path,
|
|
46
|
-
hasChildren: (n.children?.length ?? 0) > 0,
|
|
47
|
-
parentId: undefined,
|
|
48
|
-
});
|
|
23
|
+
out.push({ id: n.id, name: n.name, path: n.path, hasChildren: (n.children?.length ?? 0) > 0, parentId: undefined });
|
|
49
24
|
n.children?.forEach(walk);
|
|
50
25
|
};
|
|
51
26
|
trees.forEach(walk);
|
|
52
27
|
return out;
|
|
53
28
|
}
|
|
54
|
-
/**
|
|
55
|
-
* Streams the running subitem count for a given root item from the
|
|
56
|
-
* backend. The endpoint returns newline-delimited JSON; each parsed line
|
|
57
|
-
* triggers `onProgress` so the UI can show the count climbing. Filtered
|
|
58
|
-
* server-side via IItemExportFilter + excluded templates.
|
|
59
|
-
*
|
|
60
|
-
* Pass an `AbortSignal` to cancel mid-stream (e.g. user toggles the
|
|
61
|
-
* subitems flag off again).
|
|
62
|
-
*/
|
|
63
|
-
export async function streamSubitemCount(req, onProgress, options) {
|
|
64
|
-
let url = "/parhelia/translation/discoverSubitemCountStream";
|
|
65
|
-
if (options?.sessionId)
|
|
66
|
-
url += "?sessionId=" + options.sessionId;
|
|
67
|
-
const response = await fetch(url, {
|
|
68
|
-
method: "POST",
|
|
69
|
-
body: JSON.stringify({ ItemId: req.itemId, Language: req.language }),
|
|
70
|
-
credentials: "include",
|
|
71
|
-
headers: {
|
|
72
|
-
"Content-Type": "application/json",
|
|
73
|
-
Accept: "application/x-ndjson",
|
|
74
|
-
},
|
|
75
|
-
signal: options?.signal,
|
|
76
|
-
});
|
|
77
|
-
if (!response.ok || !response.body) {
|
|
78
|
-
throw new Error(`Failed to start subitem count stream (${response.status})`);
|
|
79
|
-
}
|
|
80
|
-
const reader = response.body.getReader();
|
|
81
|
-
const decoder = new TextDecoder();
|
|
82
|
-
let buffer = "";
|
|
83
|
-
let lastCount = 0;
|
|
84
|
-
try {
|
|
85
|
-
while (true) {
|
|
86
|
-
const { value, done } = await reader.read();
|
|
87
|
-
if (done)
|
|
88
|
-
break;
|
|
89
|
-
buffer += decoder.decode(value, { stream: true });
|
|
90
|
-
let newlineIndex;
|
|
91
|
-
while ((newlineIndex = buffer.indexOf("\n")) >= 0) {
|
|
92
|
-
const line = buffer.slice(0, newlineIndex).trim();
|
|
93
|
-
buffer = buffer.slice(newlineIndex + 1);
|
|
94
|
-
if (!line)
|
|
95
|
-
continue;
|
|
96
|
-
try {
|
|
97
|
-
const parsed = JSON.parse(line);
|
|
98
|
-
if (typeof parsed.count === "number") {
|
|
99
|
-
lastCount = parsed.count;
|
|
100
|
-
onProgress({ count: parsed.count, complete: !!parsed.complete });
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
catch {
|
|
104
|
-
// Ignore malformed line; keep streaming.
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
// Flush any trailing partial line.
|
|
109
|
-
const tail = buffer.trim();
|
|
110
|
-
if (tail) {
|
|
111
|
-
try {
|
|
112
|
-
const parsed = JSON.parse(tail);
|
|
113
|
-
if (typeof parsed.count === "number") {
|
|
114
|
-
lastCount = parsed.count;
|
|
115
|
-
onProgress({ count: parsed.count, complete: !!parsed.complete });
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
catch {
|
|
119
|
-
// Drop malformed trailing data.
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
finally {
|
|
124
|
-
try {
|
|
125
|
-
reader.releaseLock();
|
|
126
|
-
}
|
|
127
|
-
catch {
|
|
128
|
-
// already released
|
|
129
|
-
}
|
|
130
|
-
}
|
|
131
|
-
return lastCount;
|
|
132
|
-
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export declare const DISCOVERY_CONFIRMATION_THRESHOLD = 100;
|
|
2
|
+
export declare const EXCLUDED_TEMPLATE_IDS: string[];
|
|
3
|
+
export declare const DIALOG_DIMENSIONS: {
|
|
4
|
+
width: string;
|
|
5
|
+
height: string;
|
|
6
|
+
};
|
|
7
|
+
export declare const STEP_STATES: {
|
|
8
|
+
readonly COMPLETED: "completed";
|
|
9
|
+
readonly CURRENT: "current";
|
|
10
|
+
readonly PENDING: "pending";
|
|
11
|
+
};
|
|
12
|
+
export declare const STORAGE_KEYS: {
|
|
13
|
+
readonly TRANSLATION_PROVIDER: "editor.translationProvider";
|
|
14
|
+
};
|
|
15
|
+
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,gCAAgC,MAAM,CAAC;AAGpD,eAAO,MAAM,qBAAqB,UAEjC,CAAC;AAGF,eAAO,MAAM,iBAAiB;;;CAG7B,CAAC;AAGF,eAAO,MAAM,WAAW;;;;CAId,CAAC;AAGX,eAAO,MAAM,YAAY;;CAEf,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
// Discovery configuration
|
|
2
|
+
export const DISCOVERY_CONFIRMATION_THRESHOLD = 100; // Pause every N subitems
|
|
3
|
+
// Template IDs to exclude from translation
|
|
4
|
+
export const EXCLUDED_TEMPLATE_IDS = [
|
|
5
|
+
"de8bfdac-5f9f-40c3-a680-2fce9997ae28" // System template ID
|
|
6
|
+
];
|
|
7
|
+
// Dialog dimensions
|
|
8
|
+
export const DIALOG_DIMENSIONS = {
|
|
9
|
+
width: "75vw",
|
|
10
|
+
height: "75vh"
|
|
11
|
+
};
|
|
12
|
+
// Step progress indicators
|
|
13
|
+
export const STEP_STATES = {
|
|
14
|
+
COMPLETED: "completed",
|
|
15
|
+
CURRENT: "current",
|
|
16
|
+
PENDING: "pending"
|
|
17
|
+
};
|
|
18
|
+
// Local storage keys
|
|
19
|
+
export const STORAGE_KEYS = {
|
|
20
|
+
TRANSLATION_PROVIDER: "editor.translationProvider"
|
|
21
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useTranslationWizard.d.ts","sourceRoot":"","sources":["../../src/hooks/useTranslationWizard.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,qBAAqB,EAAE,uBAAuB,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"useTranslationWizard.d.ts","sourceRoot":"","sources":["../../src/hooks/useTranslationWizard.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,qBAAqB,EAAE,uBAAuB,EAAE,MAAM,gBAAgB,CAAC;AAOhF,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,uBAAuB;;;EA8FlE"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useState, useEffect } from "react";
|
|
2
2
|
import { getLanguagesAndVersions } from "@parhelia/core";
|
|
3
|
-
import { getTranslationStatus, getTranslationProviders
|
|
3
|
+
import { getTranslationStatus, getTranslationProviders } from "../services/translationService";
|
|
4
4
|
import { localStorageService } from "@parhelia/core";
|
|
5
5
|
export function useTranslationWizard(props) {
|
|
6
6
|
const [wizardData, setWizardData] = useState({
|
|
@@ -24,7 +24,7 @@ export function useTranslationWizard(props) {
|
|
|
24
24
|
if (providers.length > 0) {
|
|
25
25
|
const savedProvider = localStorageService.getString("editor.translationProvider");
|
|
26
26
|
// Validate that saved provider exists in current providers by name
|
|
27
|
-
const validProvider = savedProvider && providers.find(
|
|
27
|
+
const validProvider = savedProvider && providers.find(p => p.name === savedProvider)
|
|
28
28
|
? savedProvider
|
|
29
29
|
: providers[0]?.name || "";
|
|
30
30
|
const defaultProvider = validProvider;
|
|
@@ -56,7 +56,7 @@ export function useTranslationWizard(props) {
|
|
|
56
56
|
languageMap.set(language.languageCode, languageData);
|
|
57
57
|
});
|
|
58
58
|
});
|
|
59
|
-
setWizardData(
|
|
59
|
+
setWizardData(prevData => ({
|
|
60
60
|
...prevData,
|
|
61
61
|
translationProviders: providers,
|
|
62
62
|
translationProvider: defaultProvider,
|
package/dist/index.d.ts
CHANGED
|
@@ -1,39 +1,40 @@
|
|
|
1
|
-
import { ItemSelectionStep } from "./steps/ItemSelectionStep";
|
|
2
1
|
import { ServiceLanguageSelectionStep } from "./steps/ServiceLanguageSelectionStep";
|
|
2
|
+
import { SubitemDiscoveryStep } from "./steps/SubitemDiscoveryStep";
|
|
3
|
+
import { TranslationWizardData } from "./steps/types";
|
|
3
4
|
import { EditorConfiguration } from "@parhelia/core";
|
|
4
5
|
declare const DEFAULT_TRANSLATION_WIZARD_CONFIGURATION: {
|
|
5
6
|
steps: ({
|
|
6
7
|
id: string;
|
|
7
8
|
name: string;
|
|
8
9
|
description: string;
|
|
9
|
-
component: typeof
|
|
10
|
-
|
|
10
|
+
component: typeof ServiceLanguageSelectionStep;
|
|
11
|
+
skipCondition?: undefined;
|
|
11
12
|
} | {
|
|
12
13
|
id: string;
|
|
13
14
|
name: string;
|
|
14
|
-
nextButtonLabel: string;
|
|
15
15
|
description: string;
|
|
16
|
-
component: typeof
|
|
16
|
+
component: typeof SubitemDiscoveryStep;
|
|
17
|
+
skipCondition: (data: TranslationWizardData) => boolean;
|
|
17
18
|
})[];
|
|
18
19
|
};
|
|
19
20
|
declare const SINGLE_ITEM_TRANSLATION_WIZARD_CONFIGURATION: {
|
|
20
21
|
steps: {
|
|
21
22
|
id: string;
|
|
22
23
|
name: string;
|
|
23
|
-
nextButtonLabel: string;
|
|
24
24
|
description: string;
|
|
25
25
|
component: typeof ServiceLanguageSelectionStep;
|
|
26
26
|
}[];
|
|
27
27
|
};
|
|
28
|
-
export { DEFAULT_TRANSLATION_WIZARD_CONFIGURATION, SINGLE_ITEM_TRANSLATION_WIZARD_CONFIGURATION
|
|
28
|
+
export { DEFAULT_TRANSLATION_WIZARD_CONFIGURATION, SINGLE_ITEM_TRANSLATION_WIZARD_CONFIGURATION };
|
|
29
29
|
export { LocalizeItemDialog } from "./LocalizeItemDialog";
|
|
30
30
|
export { localizeItemCommand } from "./LocalizeItemCommand";
|
|
31
31
|
export { TranslationManagement } from "./translation-center/TranslationManagement";
|
|
32
|
-
export {
|
|
32
|
+
export { RecentTranslations } from "./translation-center/RecentTranslations";
|
|
33
|
+
export { BatchTranslationView } from "./translation-center/BatchTranslationView";
|
|
33
34
|
export { LocalizationSetupStep } from "./setup/LocalizationSetupStep";
|
|
34
35
|
export { TranslationServicesPanel } from "./settings/TranslationServicesPanel";
|
|
35
|
-
export type { LocalizeItemCommand, LocalizeItemCommandContext, LocalizeItemCommandData
|
|
36
|
-
export { defaultTranslateAll, performDefaultTranslation, type StartedTranslation, type TranslationResult
|
|
36
|
+
export type { LocalizeItemCommand, LocalizeItemCommandContext, LocalizeItemCommandData } from "./LocalizeItemCommand";
|
|
37
|
+
export { defaultTranslateAll, generateBatchId, performDefaultTranslation, type StartedTranslation, type TranslationResult } from "./LocalizeItemUtils";
|
|
37
38
|
export * from "./steps/types";
|
|
38
39
|
export type { TranslationProviderInfo, TranslationStatus } from "./steps/types";
|
|
39
40
|
export type LocalizationConfigOptions = {
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,4BAA4B,EAAE,MAAM,sCAAsC,CAAC;AACpF,OAAO,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AAEpE,OAAO,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAC;AAatD,OAAO,EACL,mBAAmB,EAGpB,MAAM,gBAAgB,CAAC;AAUxB,QAAA,MAAM,wCAAwC;;;;;;;;;;;;8BAalB,qBAAqB;;CAchD,CAAC;AAEF,QAAA,MAAM,4CAA4C;;;;;;;CAUjD,CAAC;AAkCF,OAAO,EAAE,wCAAwC,EAAE,4CAA4C,EAAE,CAAC;AAClG,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,qBAAqB,EAAE,MAAM,4CAA4C,CAAC;AACnF,OAAO,EAAE,kBAAkB,EAAE,MAAM,yCAAyC,CAAC;AAC7E,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AACtE,OAAO,EAAE,wBAAwB,EAAE,MAAM,qCAAqC,CAAC;AAC/E,YAAY,EACV,mBAAmB,EACnB,0BAA0B,EAC1B,uBAAuB,EACxB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,mBAAmB,EACnB,eAAe,EACf,yBAAyB,EACzB,KAAK,kBAAkB,EACvB,KAAK,iBAAiB,EACvB,MAAM,qBAAqB,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,YAAY,EAAE,uBAAuB,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAEhF,MAAM,MAAM,yBAAyB,GAAG;IACtC;;;;OAIG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IAEpB;;;OAGG;IACH,qBAAqB,CAAC,EAAE,OAAO,CAAC;CACjC,CAAC;AAEF;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,qBAAqB,CACnC,aAAa,EAAE,mBAAmB,EAClC,OAAO,CAAC,EAAE,yBAAyB,uBAsHpC"}
|
package/dist/index.js
CHANGED
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { ItemSelectionStep } from "./steps/ItemSelectionStep";
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
2
|
import { ServiceLanguageSelectionStep } from "./steps/ServiceLanguageSelectionStep";
|
|
3
|
+
import { SubitemDiscoveryStep } from "./steps/SubitemDiscoveryStep";
|
|
4
4
|
import { PromptCustomizationStep } from "./steps/PromptCustomizationStep";
|
|
5
5
|
import { localizeItemCommand } from "./LocalizeItemCommand";
|
|
6
6
|
import { TranslationSidebar } from "./sidebar/TranslationSidebar";
|
|
7
7
|
import { TranslationManagement } from "./translation-center/TranslationManagement";
|
|
8
|
-
import {
|
|
9
|
-
import { TranslationBatches } from "./translation-center/TranslationBatches";
|
|
8
|
+
import { RecentTranslations } from "./translation-center/RecentTranslations";
|
|
10
9
|
import { TranslationServicesPanel } from "./settings/TranslationServicesPanel";
|
|
11
10
|
import { Languages as LucideLanguages, LayoutGrid as LucideLayoutGrid, Globe as LucideGlobe, } from "lucide-react";
|
|
12
11
|
const LanguagesIcon = LucideLanguages;
|
|
@@ -15,43 +14,40 @@ const GlobeIcon = LucideGlobe;
|
|
|
15
14
|
const DEFAULT_TRANSLATION_WIZARD_CONFIGURATION = {
|
|
16
15
|
steps: [
|
|
17
16
|
{
|
|
18
|
-
id: "
|
|
19
|
-
name: "
|
|
20
|
-
description: "Select
|
|
21
|
-
component:
|
|
17
|
+
id: "service-language-selection",
|
|
18
|
+
name: "Configure Translation",
|
|
19
|
+
description: "Select translation provider and target languages for your content.",
|
|
20
|
+
component: ServiceLanguageSelectionStep,
|
|
22
21
|
},
|
|
23
22
|
{
|
|
24
|
-
id: "
|
|
25
|
-
name: "
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
23
|
+
id: "subitem-discovery",
|
|
24
|
+
name: "Discover Subitems",
|
|
25
|
+
description: "Find and include child items that should also be translated.",
|
|
26
|
+
component: SubitemDiscoveryStep,
|
|
27
|
+
skipCondition: (data) => !data.includeSubitems,
|
|
29
28
|
},
|
|
30
29
|
{
|
|
31
30
|
id: "prompt-customization",
|
|
32
|
-
name: "
|
|
33
|
-
|
|
34
|
-
description: "Choose the translation provider and provider settings.",
|
|
31
|
+
name: "Customize Prompt",
|
|
32
|
+
description: "Optionally customize the translation prompt.",
|
|
35
33
|
component: PromptCustomizationStep,
|
|
34
|
+
skipCondition: (data) => {
|
|
35
|
+
// Skip if custom prompt is not enabled (checkbox unchecked)
|
|
36
|
+
const serviceData = data.serviceCustomData?.get(data.translationProvider);
|
|
37
|
+
return !serviceData || !serviceData.enableCustomPrompt;
|
|
38
|
+
},
|
|
36
39
|
},
|
|
37
40
|
],
|
|
38
41
|
};
|
|
39
42
|
const SINGLE_ITEM_TRANSLATION_WIZARD_CONFIGURATION = {
|
|
40
43
|
steps: [
|
|
41
44
|
{
|
|
42
|
-
id: "language-selection",
|
|
43
|
-
name: "
|
|
44
|
-
|
|
45
|
-
description: "Select target languages for your content.",
|
|
45
|
+
id: "service-language-selection",
|
|
46
|
+
name: "Configure Translation",
|
|
47
|
+
description: "Select translation provider and target languages for your content.",
|
|
46
48
|
component: ServiceLanguageSelectionStep,
|
|
47
49
|
},
|
|
48
|
-
|
|
49
|
-
id: "prompt-customization",
|
|
50
|
-
name: "Provider",
|
|
51
|
-
nextButtonLabel: "Select Provider",
|
|
52
|
-
description: "Choose the translation provider and provider settings.",
|
|
53
|
-
component: PromptCustomizationStep,
|
|
54
|
-
},
|
|
50
|
+
// No SubitemDiscoveryStep - single item translation only
|
|
55
51
|
],
|
|
56
52
|
};
|
|
57
53
|
/**
|
|
@@ -80,18 +76,19 @@ const translationManagementWorkspace = {
|
|
|
80
76
|
title: "Translation Management",
|
|
81
77
|
icon: _jsx(GlobeIcon, { strokeWidth: 1 }),
|
|
82
78
|
component: _jsx(TranslationManagement, {}),
|
|
83
|
-
|
|
79
|
+
menuBar: _jsx(_Fragment, {}),
|
|
84
80
|
supportsSidebars: false,
|
|
85
81
|
sortOrder: 30,
|
|
86
82
|
};
|
|
87
|
-
export { DEFAULT_TRANSLATION_WIZARD_CONFIGURATION, SINGLE_ITEM_TRANSLATION_WIZARD_CONFIGURATION
|
|
83
|
+
export { DEFAULT_TRANSLATION_WIZARD_CONFIGURATION, SINGLE_ITEM_TRANSLATION_WIZARD_CONFIGURATION };
|
|
88
84
|
export { LocalizeItemDialog } from "./LocalizeItemDialog";
|
|
89
85
|
export { localizeItemCommand } from "./LocalizeItemCommand";
|
|
90
86
|
export { TranslationManagement } from "./translation-center/TranslationManagement";
|
|
91
|
-
export {
|
|
87
|
+
export { RecentTranslations } from "./translation-center/RecentTranslations";
|
|
88
|
+
export { BatchTranslationView } from "./translation-center/BatchTranslationView";
|
|
92
89
|
export { LocalizationSetupStep } from "./setup/LocalizationSetupStep";
|
|
93
90
|
export { TranslationServicesPanel } from "./settings/TranslationServicesPanel";
|
|
94
|
-
export { defaultTranslateAll,
|
|
91
|
+
export { defaultTranslateAll, generateBatchId, performDefaultTranslation } from "./LocalizeItemUtils";
|
|
95
92
|
export * from "./steps/types";
|
|
96
93
|
/**
|
|
97
94
|
* Configures the localization extension for the editor.
|
|
@@ -123,8 +120,7 @@ export function configureLocalization(configuration, options) {
|
|
|
123
120
|
configuration.localization = {};
|
|
124
121
|
}
|
|
125
122
|
configuration.localization.multiItem = enableMultiItem;
|
|
126
|
-
configuration.localization.translationManagement =
|
|
127
|
-
enableTranslationManagement;
|
|
123
|
+
configuration.localization.translationManagement = enableTranslationManagement;
|
|
128
124
|
if (!configuration.commands.allItemCommands) {
|
|
129
125
|
configuration.commands.allItemCommands = [];
|
|
130
126
|
}
|
|
@@ -151,9 +147,9 @@ export function configureLocalization(configuration, options) {
|
|
|
151
147
|
label: "Translation Status",
|
|
152
148
|
panels: [
|
|
153
149
|
{
|
|
154
|
-
id: "
|
|
155
|
-
label: "
|
|
156
|
-
content: _jsx(
|
|
150
|
+
id: "recent-translations",
|
|
151
|
+
label: "Recent Translations",
|
|
152
|
+
content: _jsx(RecentTranslations, {}),
|
|
157
153
|
},
|
|
158
154
|
],
|
|
159
155
|
},
|
|
@@ -9,7 +9,7 @@ export type TranslationApiResponse<T> = {
|
|
|
9
9
|
export type TranslationRequestResponse = {
|
|
10
10
|
jobId: string;
|
|
11
11
|
};
|
|
12
|
-
export declare function requestTranslation({ itemId, targetLanguage, sourceLanguage, sessionId, provider, metadata, batchId
|
|
12
|
+
export declare function requestTranslation({ itemId, targetLanguage, sourceLanguage, sessionId, provider, metadata, batchId }: {
|
|
13
13
|
itemId: string;
|
|
14
14
|
targetLanguage: string;
|
|
15
15
|
sourceLanguage: string;
|
|
@@ -53,8 +53,7 @@ export type TranslationStructureResponse = {
|
|
|
53
53
|
export declare function getTranslationStructure(settings: TranslationStructureSettings): Promise<import("@parhelia/core").ExecutionResult<TranslationApiResponse<TranslationStructureResponse>>>;
|
|
54
54
|
export declare function ensureTranslationStructure(settings: TranslationStructureSettings): Promise<import("@parhelia/core").ExecutionResult<TranslationApiResponse<TranslationStructureResponse>>>;
|
|
55
55
|
export type TranslationJobRecord = {
|
|
56
|
-
id?:
|
|
57
|
-
sequenceId?: number;
|
|
56
|
+
id?: number;
|
|
58
57
|
itemId: string;
|
|
59
58
|
targetLanguage: string;
|
|
60
59
|
sourceLanguage: string;
|
|
@@ -64,17 +63,10 @@ export type TranslationJobRecord = {
|
|
|
64
63
|
message?: string;
|
|
65
64
|
batchId?: string;
|
|
66
65
|
metadata?: string | null;
|
|
67
|
-
itemName?: string | null;
|
|
68
|
-
itemPath?: string | null;
|
|
69
|
-
workerInstanceId?: string | null;
|
|
70
|
-
claimedAtUtc?: string | null;
|
|
71
|
-
lastHeartbeatUtc?: string | null;
|
|
72
|
-
attemptCount?: number;
|
|
73
|
-
totalCost?: number | null;
|
|
74
66
|
};
|
|
75
67
|
export declare function listBatchTranslationJobs(batchId: string): Promise<import("@parhelia/core").ExecutionResult<TranslationJobRecord[]>>;
|
|
76
68
|
export type TranslationBatchInfo = {
|
|
77
|
-
|
|
69
|
+
batchId: string;
|
|
78
70
|
createdAtUtc?: string;
|
|
79
71
|
startedAtUtc?: string;
|
|
80
72
|
completedAtUtc?: string;
|
|
@@ -87,34 +79,10 @@ export type TranslationBatchInfo = {
|
|
|
87
79
|
errorJobs?: number;
|
|
88
80
|
metadata?: string | null;
|
|
89
81
|
lastUpdatedUtc?: string;
|
|
90
|
-
totalCost?: number | null;
|
|
91
82
|
exists?: boolean;
|
|
92
83
|
};
|
|
93
84
|
export declare function getBatchInfo(batchId: string): Promise<import("@parhelia/core").ExecutionResult<TranslationBatchInfo>>;
|
|
94
|
-
export
|
|
95
|
-
fromUtc?: string;
|
|
96
|
-
status?: string;
|
|
97
|
-
user?: string;
|
|
98
|
-
provider?: string;
|
|
99
|
-
targetLanguage?: string;
|
|
100
|
-
itemIdOrPath?: string;
|
|
101
|
-
itemIncludeSubitems?: boolean;
|
|
102
|
-
};
|
|
103
|
-
export declare function listBatches(take?: number, skip?: number, filters?: ListBatchesFilters): Promise<import("@parhelia/core").ExecutionResult<TranslationBatchInfo[]>>;
|
|
104
|
-
export type DeleteBatchResponse = {
|
|
105
|
-
success: boolean;
|
|
106
|
-
id: string;
|
|
107
|
-
deletedJobs: number;
|
|
108
|
-
};
|
|
109
|
-
export declare function deleteBatch(id: string): Promise<import("@parhelia/core").ExecutionResult<DeleteBatchResponse>>;
|
|
110
|
-
export type AbortTranslationResponse = {
|
|
111
|
-
success: boolean;
|
|
112
|
-
batchId: string;
|
|
113
|
-
id?: string;
|
|
114
|
-
abortedJobs: number;
|
|
115
|
-
};
|
|
116
|
-
export declare function abortJob(id: string): Promise<import("@parhelia/core").ExecutionResult<AbortTranslationResponse>>;
|
|
117
|
-
export declare function abortBatch(id: string): Promise<import("@parhelia/core").ExecutionResult<AbortTranslationResponse>>;
|
|
85
|
+
export declare function listBatches(take?: number, skip?: number): Promise<import("@parhelia/core").ExecutionResult<TranslationBatchInfo[]>>;
|
|
118
86
|
export declare function subscribeToBatch(batchId: string, sessionId: string): Promise<import("@parhelia/core").ExecutionResult<{
|
|
119
87
|
success: boolean;
|
|
120
88
|
message: string;
|
|
@@ -138,26 +106,27 @@ export type BatchTranslationError = {
|
|
|
138
106
|
error: string;
|
|
139
107
|
};
|
|
140
108
|
export type BatchTranslationResponse = {
|
|
141
|
-
|
|
109
|
+
batchId: string;
|
|
142
110
|
started: BatchTranslationResult[];
|
|
143
111
|
skipped: BatchTranslationError[];
|
|
144
112
|
};
|
|
145
|
-
export declare function requestBatchTranslation({ sessionId, provider, batchMetadata, languageMappings, itemIds
|
|
113
|
+
export declare function requestBatchTranslation({ sessionId, batchId, provider, batchMetadata, languageMappings, itemIds }: {
|
|
146
114
|
sessionId: string;
|
|
115
|
+
batchId: string;
|
|
147
116
|
provider: string;
|
|
148
117
|
batchMetadata?: string;
|
|
149
118
|
languageMappings: LanguageMapping[];
|
|
150
119
|
itemIds: string[];
|
|
151
120
|
}): Promise<import("@parhelia/core").ExecutionResult<BatchTranslationResponse>>;
|
|
152
121
|
export type RetryBatchTranslationJobRequest = {
|
|
153
|
-
sourceTranslationId?:
|
|
122
|
+
sourceTranslationId?: number;
|
|
154
123
|
itemId: string;
|
|
155
124
|
sourceLanguage: string;
|
|
156
125
|
targetLanguage: string;
|
|
157
126
|
metadata?: string | null;
|
|
158
127
|
};
|
|
159
128
|
export type RetryBatchTranslationStartedJob = {
|
|
160
|
-
sourceTranslationId?:
|
|
129
|
+
sourceTranslationId?: number;
|
|
161
130
|
itemId: string;
|
|
162
131
|
sourceLanguage: string;
|
|
163
132
|
targetLanguage: string;
|
|
@@ -165,7 +134,7 @@ export type RetryBatchTranslationStartedJob = {
|
|
|
165
134
|
jobId: string;
|
|
166
135
|
};
|
|
167
136
|
export type RetryBatchTranslationSkippedJob = {
|
|
168
|
-
sourceTranslationId?:
|
|
137
|
+
sourceTranslationId?: number;
|
|
169
138
|
itemId: string;
|
|
170
139
|
sourceLanguage: string;
|
|
171
140
|
targetLanguage: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"translationService.d.ts","sourceRoot":"","sources":["../../src/services/translationService.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAC7C,OAAO,EAAE,uBAAuB,EAAE,MAAM,gBAAgB,CAAC;AAGzD,MAAM,MAAM,sBAAsB,CAAC,CAAC,IAAI;IACtC,OAAO,EAAE,OAAO,CA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C;IACf,cAAc,EAAE,MAAM,CAAC;IACvB,cAAc,EAAE,MAAM,CAAC;IACvB,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,MAAM,MAAM,6BAA6B,GAAG;IAC1C,aAAa,EAAE,MAAM,CAAC;IACtB,YAAY,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,+BAA+B,EAAE,CAAC;IAC3C,OAAO,EAAE,+BAA+B,EAAE,CAAC;CAC5C,CAAC;AAEF,wBAAsB,qBAAqB,CAAC,EAC1C,SAAS,EACT,aAAa,EACb,QAAQ,EACR,IAAI,GACL,EAAE;IACD,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,+BAA+B,EAAE,CAAC;CACzC,oFAKA"}
|
|
@@ -1,14 +1,6 @@
|
|
|
1
1
|
import { get, post } from "@parhelia/core";
|
|
2
|
-
export async function requestTranslation({ itemId, targetLanguage, sourceLanguage, sessionId, provider, metadata, batchId
|
|
3
|
-
return await post("/parhelia/translation/requestTranslation", {
|
|
4
|
-
itemId,
|
|
5
|
-
targetLanguage,
|
|
6
|
-
sourceLanguage,
|
|
7
|
-
sessionId,
|
|
8
|
-
provider,
|
|
9
|
-
metadata,
|
|
10
|
-
batchId,
|
|
11
|
-
});
|
|
2
|
+
export async function requestTranslation({ itemId, targetLanguage, sourceLanguage, sessionId, provider, metadata, batchId }) {
|
|
3
|
+
return await post("/parhelia/translation/requestTranslation", { itemId, targetLanguage, sourceLanguage, sessionId, provider, metadata, batchId });
|
|
12
4
|
}
|
|
13
5
|
export async function getTranslationStatus(itemId) {
|
|
14
6
|
return await get(`/parhelia/translation/getTranslations?itemId=${itemId}`);
|
|
@@ -52,36 +44,8 @@ export async function listBatchTranslationJobs(batchId) {
|
|
|
52
44
|
export async function getBatchInfo(batchId) {
|
|
53
45
|
return await get(`/parhelia/translation/batchInfo?batchId=${encodeURIComponent(batchId)}`);
|
|
54
46
|
}
|
|
55
|
-
export async function listBatches(take = 100, skip = 0
|
|
56
|
-
|
|
57
|
-
params.set("take", String(take));
|
|
58
|
-
params.set("skip", String(skip));
|
|
59
|
-
if (filters.fromUtc)
|
|
60
|
-
params.set("fromUtc", filters.fromUtc);
|
|
61
|
-
if (filters.status)
|
|
62
|
-
params.set("status", filters.status);
|
|
63
|
-
if (filters.user)
|
|
64
|
-
params.set("user", filters.user);
|
|
65
|
-
if (filters.provider)
|
|
66
|
-
params.set("provider", filters.provider);
|
|
67
|
-
if (filters.targetLanguage)
|
|
68
|
-
params.set("targetLanguage", filters.targetLanguage);
|
|
69
|
-
if (filters.itemIdOrPath)
|
|
70
|
-
params.set("itemIdOrPath", filters.itemIdOrPath);
|
|
71
|
-
if (filters.itemIncludeSubitems)
|
|
72
|
-
params.set("itemIncludeSubitems", "true");
|
|
73
|
-
return await get(`/parhelia/translation/batches?${params.toString()}`);
|
|
74
|
-
}
|
|
75
|
-
export async function deleteBatch(id) {
|
|
76
|
-
return await post("/parhelia/translation/deleteBatch", {
|
|
77
|
-
id,
|
|
78
|
-
});
|
|
79
|
-
}
|
|
80
|
-
export async function abortJob(id) {
|
|
81
|
-
return await post("/parhelia/translation/abortJob", { id });
|
|
82
|
-
}
|
|
83
|
-
export async function abortBatch(id) {
|
|
84
|
-
return await post("/parhelia/translation/abortBatch", { id });
|
|
47
|
+
export async function listBatches(take = 100, skip = 0) {
|
|
48
|
+
return await get(`/parhelia/translation/batches?take=${take}&skip=${skip}`);
|
|
85
49
|
}
|
|
86
50
|
export async function subscribeToBatch(batchId, sessionId) {
|
|
87
51
|
return await post("/parhelia/translation/subscribeToBatch", { batchId, sessionId });
|
|
@@ -89,14 +53,8 @@ export async function subscribeToBatch(batchId, sessionId) {
|
|
|
89
53
|
export async function unsubscribeFromBatch(batchId, sessionId) {
|
|
90
54
|
return await post("/parhelia/translation/unsubscribeFromBatch", { batchId, sessionId });
|
|
91
55
|
}
|
|
92
|
-
export async function requestBatchTranslation({ sessionId, provider, batchMetadata, languageMappings, itemIds
|
|
93
|
-
return await post("/parhelia/translation/requestBatchTranslation", {
|
|
94
|
-
sessionId,
|
|
95
|
-
provider,
|
|
96
|
-
batchMetadata: batchMetadata || "",
|
|
97
|
-
languageMappings,
|
|
98
|
-
itemIds,
|
|
99
|
-
});
|
|
56
|
+
export async function requestBatchTranslation({ sessionId, batchId, provider, batchMetadata, languageMappings, itemIds }) {
|
|
57
|
+
return await post("/parhelia/translation/requestBatchTranslation", { sessionId, batchId, provider, batchMetadata: batchMetadata || "", languageMappings, itemIds });
|
|
100
58
|
}
|
|
101
59
|
export async function retryBatchTranslation({ sessionId, sourceBatchId, provider, jobs, }) {
|
|
102
60
|
return await post("/parhelia/translation/retryBatchTranslation", { sessionId, sourceBatchId, provider, jobs });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TranslationServicesPanel.d.ts","sourceRoot":"","sources":["../../src/settings/TranslationServicesPanel.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"TranslationServicesPanel.d.ts","sourceRoot":"","sources":["../../src/settings/TranslationServicesPanel.tsx"],"names":[],"mappings":"AAgEA;;;GAGG;AACH,wBAAgB,wBAAwB,4CAotBvC;AAED,eAAe,wBAAwB,CAAC"}
|