eddx-translate
Skill1 starsChanged 4 months agoMITView on GitHub
Translate text labels inside EdrawMax/EdrawMind (.eddx) diagrams between languages while preserving shapes, layout, styles, and metadata. Use when the user asks to translate an Edraw diagram, localize text in .eddx files, or replace terminology across multiple shapes in a flowchart/mindmap. Triggers on: "翻译 eddx", "translate Edraw/eddx diagram", ".eddx 英文化", "替换 .eddx 中的文字", "译 .eddx 流程图". Only targets <tp> text nodes in pages/page1.xml — coordinates, styles, and non-text ZIP entries are untouched. Source file is never modified; a translated copy is produced.
In this repository4 other files it gives its agents.
- kb-ingestSkill
- meeting-minutes-exportSkill
- meeting-minutesSkill
- pptx-translateSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
13 rules. About 0 are common, 4 are distinctive, and 9 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈4
Distinctive · estimate
This author's own choices. Worth a look.
9
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 32
Input
.eddx: Read-only source. Never modified. - Very specific: line 52
Read pages/page1.xml as UTF-8.
- Very specific: line 53
Use regex to find all <tp ...>TEXT</tp> nodes.
- Very specific: line 59
Keys: must match the exact trimmed text inside <tp> nodes character for character — any mismatch (extra space, wrong punctuation) causes …
- Very specific: line 75
Use the bundled script scripts/eddx_translate.py to apply the mapping:
- Distinctive: line 80
Only the text content (group 2) is replaced when an exact key match exists in the mapping.
- Very specific: line 81
All attributes on <tp>, surrounding XML, ZIP metadata — everything else — is left intact.
- Distinctive: line 101
If the script reports "0 text nodes replaced", the most likely cause is key mismatch.
- Distinctive: line 105
Keep the same term translated the same way across all shapes.
- Very specific: line 117
Never modify the source file: Always write a new .eddx file.
- Very specific: line 118
Only translate text inside
<tp>elements: Do not touch <Text>, <TextBlock>, <pp>, <shape>, or other attributes unless the user explicitly … - Very specific: line 119
Preserve the ZIP structure: Use the original infolist() to maintain entry order, compression type, and external attributes.
- Distinctive: line 163
After completion, present the following to the user:
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
eddx-translate
Translate visible text in EdrawMax/EdrawMind (.eddx) diagrams between languages without altering shapes, layout, styles, or metadata.
Overview
Edraw .eddx files are ZIP archives containing XML (shapes, text, styles) and assets (thumbnails, metadata). All visible text in a single-page diagram lives in pages/page1.xml inside <tp> (text paragraph) elements. This skill translates only those <tp> text nodes, leaving every other XML attribute, coordinate, style, and ZIP entry untouched.
Core Principle: Source files are never modified. A new .eddx file is always produced.
File Format Requirements
| Item | Details |
| Supported | .eddx — EdrawMax / EdrawMind native format (PowerPoint-like ZIP container) |
| Not Supported | .eddxd (derivative), .eddx.html (HTML export), or other non-native formats |
| Page Limit | Single-page only — text is read from pages/page1.xml. Multi-page diagrams are not yet supported |
| Architecture | .eddx files are ZIP archives. The script unpacks, edits, and repacks them |
File Organization Rules
- Input
.eddx: Read-only source. Never modified. - Mapping JSON: Provided by the user or generated by the AI agent (see Workflow, Step 3).
- Output
.eddx: Saved adjacent to the input file with the suffix.translated.eddx.- Example:
diagram.eddx→diagram.translated.eddx - An explicit output path can be provided as the third argument.
- Example:
Workflow
Step 1: Validate Input
- Confirm the file path exists and has the
.eddxextension. - Open the file with
zipfileand list its entries. Expected entries include:pages/page1.xml— the page XML containing<tp>text nodesdocument.xml,theme.xml,thumbnail.jpeg,rels/*
Step 2: Extract and Present Text
- Extract the
.eddxZIP to a temporary directory (never extract into the source file's directory). - Read
pages/page1.xmlas UTF-8. - Use regex to find all
<tp ...>TEXT</tp>nodes. - Collect unique trimmed text values.
- Present the extracted text to the user for them to provide a translation mapping, or — if the request is clear (e.g., "translate to Chinese") — ask whether the user wants the AI to auto-generate the mapping.
Step 3: Build a Translation Mapping
- Keys must match the exact trimmed text inside
<tp>nodes character for character — any mismatch (extra space, wrong punctuation) causes the replacement to fail silently. - Values are the replacement text (Chinese or English).
- Preserve the original line-break structure. If the source uses a single
<tp>for a multi-line label, keep it as a single entry in the mapping.
Mapping JSON format:
{
"Start": "开始",
"End": "结束",
"Process": "处理中",
"Decision": "判断"
}Step 4: Apply Translations
- Use the bundled script
scripts/eddx_translate.pyto apply the mapping:python scripts/eddx_translate.py <input.eddx> <mapping.json> [output.eddx] - The script uses the regex pattern
(<tp[^>]*>)([^<]*)(</tp>)to locate each<tp>node. - Only the text content (group 2) is replaced when an exact key match exists in the mapping.
- All attributes on
<tp>, surrounding XML, ZIP metadata — everything else — is left intact. - The script reports the number of
<tp>nodes replaced. If zero nodes matched, it prints a warning (keys may be incorrect).
Step 5: Verify Output
- The script runs
zipfile.testzip()on the new archive to confirm ZIP integrity. - It parses
pages/page1.xmlwithxml.etree.ElementTreeto confirm the XML is well-formed. - Manually or programmatically confirm the source file's hash/size has not changed.
- Report results to the user (see Output Format).
Translation Quality Guidelines
For best results, follow these rules when building the mapping:
Key Matching (Critical)
- Exact string matching only. The script does not normalize quotes, trim whitespace, or do fuzzy matching. A trailing space or mismatched quote character (
"vs"vs") will cause the translation to fail. - Copy keys directly from the extracted text list (Step 2) rather than re-typing them.
- If the script reports "0 text nodes replaced", the most likely cause is key mismatch.
Terminology Consistency
- Keep the same term translated the same way across all shapes. For example, if "Submit" is mapped to "提交" in one shape, use the same mapping everywhere.
- For product names, acronyms, and proper nouns, confirm with the user whether to translate or preserve.
Text Structure
- Do not merge or split
<tp>nodes. Each<tp>in the source should map to exactly one entry in the JSON. If a label spans multiple lines inside one<tp>, preserve the line break in the translation. - Do not add or remove HTML/XML tags. The script only handles plain text content.
Important Rules
- Never modify the source file. Always write a new
.eddxfile. - Only translate text inside
<tp>elements. Do not touch<Text>,<TextBlock>,<pp>,<shape>, or other attributes unless the user explicitly asks. - Preserve the ZIP structure. Use the original
infolist()to maintain entry order, compression type, and external attributes. - Use UTF-8 encoding for both reading and writing XML.
- Warn the user that Edraw text boxes may look cramped because container widths were calculated for the original language. Suggest manual width adjustment in Edraw if needed.
Using the Bundled Script
The skill includes scripts/eddx_translate.py, which performs the exact workflow described above:
python scripts/eddx_translate.py <input.eddx> <mapping.json> [output.eddx]Arguments:
| Position | Required | Description |
| 1 | Yes | Input .eddx file path |
| 2 | Yes | JSON mapping file path (see format above) |
| 3 | No | Output .eddx path. Default: <input>.translated.eddx |
Exit codes:
0— Success (even if 0 nodes matched; a warning is printed)1— Missing arguments, invalid file, or script error
Typical User Prompts That Trigger This Skill
| Language | Example Prompt |
| Chinese | "把这份 .eddx 里的英文改成中文" |
| Chinese | "翻译这个 Edraw 流程图里的文字" |
| Chinese | "把这个 .eddx 文件里的术语替换成英文" |
| English | "Translate this Edraw diagram's labels into Chinese" |
| English | "Replace English terms in my .eddx file and save as a new file" |
| English | "Localize the text in this mindmap .eddx" |
Output Format
After completion, present the following to the user:
- New file path:
diagram.translated.eddx(or custom path) - Translation count: Number of
<tp>nodes translated - Source integrity: Confirmation that the source file was left untouched
- Warning: Brief note about possible text-box overflow (English→Chinese expansion or Chinese→English contraction may affect layout)
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

