Translate

From 5throck/ai-workspace-standards · View interactive version

Translate is an AI agent skill from the GitHub repository 5throck/ai-workspace-standards. Translation helper for README and documentation files with diff preview and guidance

How to use this skill

Skill file

Purpose

Provides translation helpers for README and documentation files with diff preview, synchronization checking, and translation guidance.

This is NOT an automatic translation tool - it's a helper tool that assists translators in identifying changes and managing translation work systematically.

Scope boundary: this skill is a file-translation process helper (hash sync, diff preview).

Questions about locale configuration (BCP 47 IDs, collation), locale-specific formatting

(dates, numbers, currency, units), or text layout/encoding (RTL, scripts, fonts) belong to

the i18n asset suite — see the workspace constitution §4.4 "I18N Asset Suite" (governance

corpus) and the i18n skills of the same suite. The localize trigger was removed from

this skill for that reason (2026-08-24).

Implementation

Calls the underlying script:

bun scripts/translate-readme.ts "$@"

Usage

Basic Command (README.md → README_ko.md)

/translate

Default values:

Translate Different Files

/translate CONTRIBUTING.md CONTRIBUTING_ko.md

Preview Mode (Dry Run)

/translate --dry-run

Shows changes without modifying files.

With Source/Target Flags

/translate --from README.md --to README_ko.md --dry-run

Understanding Output

1. Hash Synchronization Status

✅ Files are already synchronized (hash: a1b2c3d4e5f6…).
   No translation updates needed.

If you see this message, your translation is up-to-date. No action needed.

⚠️  Warning: Content hashes are out of sync!
   Source content_hash:          a1b2c3d4e5f6…
   Target translated_from_hash:  9f8e7d6c5b4a…

If hashes don't match, the source file has changed and translation update is needed.

2. Change Detection Sections

Changes detected:

   ➕ New section: "Design Principles" (line 45)
   ✏️  Modified section: "Quick Start" (lines 20-35)
   🗑️  Deleted section: "Legacy Content" (line 100)

3. Diff Preview

Diff preview:

------------------------------------------------------------
--- a/README.md
+++ b/README_ko.md
@@ -20,7 +20,7 @@
 ## Quick Start
 
-### 1. Install prerequisites
+### 1. Install prerequisites (Bun required)
 
 | Tool | Version | Purpose | Install |
------------------------------------------------------------

Shows Git-style diff:

4. Next Steps

Next steps:
   1. Review the changes above
   2. Update README_ko.md accordingly
   3. Update frontmatter in README_ko.md
   4. Verify: bun scripts/verify-readme-sync.ts --pre-commit

Provides actionable guidance for translators.


Common Workflows

Regular Translation Updates

  1. Check for changes:

```bash

/translate --dry-run

```

  1. Review changes: Examine the diff preview
  1. Update translation: Edit your translation file
  1. Update hashes:

```bash

bun scripts/verify-readme-sync.ts --update-hashes

```

New Translation File Creation

If the target file doesn't exist yet:

  1. Copy source:

```bash

cp README.md README_ko.md

```

  1. Translate: Edit README_ko.md
  1. Update hashes:

```bash

bun scripts/verify-readme-sync.ts --update-hashes

```


Understanding Frontmatter

content_hash (Source File)

---
content_hash: a1b2c3d4e5f67890abcdef1234567890abcdef1234567890abcdef12
---

Computed from the file body (excluding frontmatter). Changes when content changes.

translated_from_hash (Translation File)

---
translated_from_hash: a1b2c3d4e5f67890abcdef1234567890abcdef1234567890abcdef12
---

Should match the source's content_hash. Indicates which version this translation is based on.


Troubleshooting

Source File Not Found

❌ Error: Source file not found: README.md

Solution: Check that the source file path is correct.

Hash Mismatch After Update

⚠️  Warning: Content hashes are out of sync!

Even after updating the translation:

Solution: Update the translated_from_hash field:

bun scripts/verify-readme-sync.ts --update-hashes

Verification Script Failure

❌ README sync check failed — commit blocked.

During git commit:

Solution:

  1. Update your translation
  2. Update hashes
  3. Commit again

Tips and Best Practices

Regular Checks

Run /translate --dry-run regularly to catch changes early.

Quality Maintenance

Collaboration Workflow

  1. English author updates README.md
  2. Translator runs /translate --dry-run
  3. Translator updates README_ko.md
  4. Both run verification

Advanced Usage

Check Multiple Files

# Shell script example for multiple files
for file in README.md CONTRIBUTING.md; do
    /translate "$file" "ko/$file"
done

Project-Level Files

/translate templates/common/README.md templates/common/README_ko.md

Related Scripts


Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.