From 3690c464361dd4b879f8041653e96be211dc6016 Mon Sep 17 00:00:00 2001 From: Albrecht Degering Date: Thu, 3 Sep 2026 09:34:52 +0200 Subject: [PATCH] fix translator parser and move controls to sticky sidebar --- CHANGELOG.md | 8 + README.md | 2 +- package-lock.json | 4 +- package.json | 2 +- public/CHANGELOG.md | 8 + public/README.md | 2 +- public/toolbox-app.json | 2 +- src/components/Workbench.tsx | 628 +++++++++++++++---------------- src/styles.css | 31 ++ src/toolbox/manifest.source.json | 2 +- src/version.ts | 2 +- 11 files changed, 368 insertions(+), 323 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d5ba639..6121c11 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,14 @@ - Added language pair selection, glossary storage and fuzzy in-context suggestions. - Added local-only import/export pipeline with portal handoff integration. +## 0.1.2 - 2026-09-03 + +- Fixed parsing of multiple JS-like const/let/var translations in one file so + both locales are discovered (e.g. `const de = ...; const en = ...;`). +- Added language handling sidebar with merged language-selection/workspace controls. +- Kept glossary and output panels in the sticky right sidebar to reduce layout + drift while reviewing long translation lists. + ## 0.1.1 - 2026-09-02 - Improved parser robustness for JS-like translation files with multiple declarations. diff --git a/README.md b/README.md index eb14a3f..971cb66 100644 --- a/README.md +++ b/README.md @@ -33,7 +33,7 @@ npm run test:browser ## Release -`npm run release:artifact` creates a deterministic `release/translator-tools-0.1.0.zip` and checksum sidecar. +`npm run release:artifact` creates a deterministic `release/translator-tools-0.1.2.zip` and checksum sidecar. ## Licence diff --git a/package-lock.json b/package-lock.json index 9014365..f806e32 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "translator-tools", - "version": "0.1.1", + "version": "0.1.2", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "translator-tools", - "version": "0.1.1", + "version": "0.1.2", "license": "GPL-3.0-or-later", "dependencies": { "@add-ideas/toolbox-contract": "0.3.0", diff --git a/package.json b/package.json index a5a9eb7..ec486d3 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "translator-tools", - "version": "0.1.1", + "version": "0.1.2", "description": "Review and translate i18next-like JSON language files locally.", "license": "GPL-3.0-or-later", "author": "Albrecht Degering", diff --git a/public/CHANGELOG.md b/public/CHANGELOG.md index d5ba639..6121c11 100644 --- a/public/CHANGELOG.md +++ b/public/CHANGELOG.md @@ -6,6 +6,14 @@ - Added language pair selection, glossary storage and fuzzy in-context suggestions. - Added local-only import/export pipeline with portal handoff integration. +## 0.1.2 - 2026-09-03 + +- Fixed parsing of multiple JS-like const/let/var translations in one file so + both locales are discovered (e.g. `const de = ...; const en = ...;`). +- Added language handling sidebar with merged language-selection/workspace controls. +- Kept glossary and output panels in the sticky right sidebar to reduce layout + drift while reviewing long translation lists. + ## 0.1.1 - 2026-09-02 - Improved parser robustness for JS-like translation files with multiple declarations. diff --git a/public/README.md b/public/README.md index eb14a3f..971cb66 100644 --- a/public/README.md +++ b/public/README.md @@ -33,7 +33,7 @@ npm run test:browser ## Release -`npm run release:artifact` creates a deterministic `release/translator-tools-0.1.0.zip` and checksum sidecar. +`npm run release:artifact` creates a deterministic `release/translator-tools-0.1.2.zip` and checksum sidecar. ## Licence diff --git a/public/toolbox-app.json b/public/toolbox-app.json index 9a6a62c..951b5d2 100644 --- a/public/toolbox-app.json +++ b/public/toolbox-app.json @@ -3,7 +3,7 @@ "schemaVersion": 1, "id": "de.add-ideas.translator-tools", "name": "Translator Tools", - "version": "0.1.1", + "version": "0.1.2", "description": "Review and edit translation bundles in the browser with glossary suggestions.", "entry": "./", "icon": "./favicon.svg", diff --git a/src/components/Workbench.tsx b/src/components/Workbench.tsx index 9e33431..00ded2d 100644 --- a/src/components/Workbench.tsx +++ b/src/components/Workbench.tsx @@ -228,7 +228,7 @@ function parseNamedAssignments( ): Array<{ name: string; value: unknown }> { const values: Array<{ name: string; value: unknown }> = []; const declarationRegex = - /(?:^|[\s;])(?:export\s+)?(?:const|let|var)\s+([a-zA-Z_$][\w$]*)\s*=\s*/guy; + /(?:^|[\s;])(?:export\s+)?(?:const|let|var)\s+([a-zA-Z_$][\w$]*)\s*=\s*/gu; for (let cursor = 0; cursor < source.length;) { declarationRegex.lastIndex = cursor; @@ -895,327 +895,325 @@ export function Workbench({ {importWarning &&

{importWarning}

} {rawImportError &&

{rawImportError}

} +
+
+
+
+
+

Review strings

+

Source and target side by side

+
+
+ + + {formatCount(glossaryRows.length)} rows ·{" "} + {formatCount(totalMissing)} missing + +
+
-
-
-

Language pair

-

Choose authoritative and target language

+ {rows.length === 0 ? ( +

+ Open a file to review and edit translation keys. +

+ ) : ( +
+ + + + + + + + + + + {glossaryRows.map((row) => { + const suggestions = row.suggestions; + return ( + + +
Key + {effectiveSourceLanguage.toUpperCase()} (authoritative) + {effectiveTargetLanguage.toUpperCase()} (review)Suggestions
{formatPath(row.key)} + +