Oma translator

From first-fluke/oh-my-agent · View interactive version

Oma translator is an AI agent skill from the GitHub repository first-fluke/oh-my-agent. Context-aware translation that preserves tone, style, and natural word order. Use when translating UI strings, documentation, marketing copy, or any multilingual content. Infers register, domain, and style from the source text and surrounding codebase context.

How to use this skill

Skill file

Translator - Context-Aware Translation

Scheduling

Goal

Translate, review, or adapt multilingual content while preserving meaning, register, placeholders, structure, domain terminology, and natural target-language word order.

Intent signature

When to use

When NOT to use

Expected inputs

Expected outputs

Dependencies

Control-flow features

Structural Flow

Entry

  1. Confirm source text, target language, content type, and output mode.
  2. Load existing translations, glossary, file context, or code context when available.
  3. Identify placeholders, formatting constraints, and ambiguity.

Scenes

  1. PREPARE: Determine language, register, domain, and structure constraints.
  2. ACQUIRE: Read existing translations and surrounding context.
  3. REASON: Analyze source meaning, connotations, figurative language, and terminology.
  4. ACT: Reconstruct natural target-language output.
  5. VERIFY: Run mechanical checks and translation rubric.
  6. FINALIZE: Emit translation, review notes, or file changes.

Transitions

Failure and recovery

Exit

Context Inference

No config file required. Instead, infer translation context from:

  1. Existing translations in the project — scan sibling locale files to match register, terminology, and style already in use
  2. File location — messages/, locales/, .arb files reveal the framework and format
  3. Surrounding code — component names, comments, and variable names hint at domain and audience
  4. Source text itself — register, formality, sentence structure reveal intent

If context is insufficient to make a confident decision, ask the user. Prefer one targeted question over a batch of questions.

Translation Method

Stage 1: Analyze Source

Read the source text and identify:

Stage 2: Extract Meaning

Strip away source language structure. Ask yourself:

Do NOT start forming target sentences yet.

Stage 2.5: Persona Assignment

Persona resolution has two layers: content-type (what kind of text) and voice (how punchy or formal the rhythm). Both are needed.

Layer 1: Read `translation_voice` from `.agents/oma-config.yaml`

The translation_voice field controls global rhythm/formality. Three values:

| Voice | Style override applied on top of content-type |

|---|---|

| formal | complete sentences only, no fragments, strict 합니다체/です・ます, no padding cuts |

| balanced (default) | content-type defaults — fragments allowed only in label/cell positions |

| interpreter | interpreter mindset across all content types: punchy, audience-first, spoken cadence, fragments allowed when natural in target, drops formal padding ("을 받았습니다" → "받음" / "을 모두" → drop) |

If the field is missing, default to balanced. If oma-config.yaml is unreadable, also balanced.

Layer 2: Content-type persona table

| Content type | Persona | Base style markers |

|---|---|---|

| UI strings / microcopy | UX copywriter | concise, imperative, user-friendly |

| Docs / README / API reference | technical writer | data + commentary, expanded explanations |

| Benchmark / report / changelog | technical reporter | data + commentary, objective tone |

| Marketing / landing / hero copy | brand copywriter | concise impact, audience-first, aggressive transcreation |

| Blog post / essay | essayist | preserve cadence and rhythm, retain author voice |

| Literary / prose | literary translator | preserve imagery, style consistency, narrative voice |

| Dialogue / subtitle / interview | interpreter | immediacy, audience-first, spoken register, cultural context inline |

Classification heuristics:

When unclear, default to technical writer for code-adjacent content and essayist for prose. Never use a generic "translator" persona.

Combining layers

Voice is applied on top of the content-type persona. Examples:

The persona is then localized to the target language at execution time — translating into Korean as a "technical reporter" with interpreter voice means thinking as a Korean technical reporter who values rhythm and audience scan-speed over formal completeness.

Stage 3: Reconstruct in Target Language

Rebuild from meaning as the assigned persona, following target language norms:

Word order: Follow target language's natural structure.

Register matching:

Sentence splitting/merging:

Omission of the obvious:

Stage 4: Verification Gate (blocking — do not emit output until every item is confirmed)

This stage is mandatory. Skipping any item is a bug, not a shortcut. Before producing the final translation, run the mechanical checks first, then the rubric.

A. Mechanical checks (run before rubric, must all pass):

If any mechanical check fails, revise and re-run. Do not proceed to the rubric until all pass.

B. Translation rubric (see resources/translation-rubric.md):

  1. Does it read like it was originally written in the target language?
  2. Are domain terms consistent with existing translations in the project?
  3. Is the register consistent throughout?
  4. Is the meaning preserved (not just words)?
  5. Are cultural references adapted appropriately?
  6. Are emotional connotations preserved (not flattened into neutral descriptions)?

C. Anti-AI patterns (see resources/anti-ai-patterns.md):

  1. No AI vocabulary clustering or inflated significance
  2. No promotional tone upgrade beyond the source
  3. No synonym cycling — consistent terminology
  4. No source-language word order leaking through
  5. No unnecessary bold or formatting artifacts (em dashes already covered in mechanical check A)
  6. No Europeanized patterns (unnecessary connectives, passive voice, noun pile-up, over-nominalization, forced pronouns, cleft calques)

D. Figurative language handling:

  1. Were all metaphors/idioms handled per the classify decision (interpret/substitute/retain)?
  2. Do figurative expressions read naturally in the target language, not as literal calques?

Translator's Notes Guidelines

When adding explanatory notes for terms, cultural references, or concepts that target readers may struggle with:

Format: 번역어(원어, 쉬운 설명) or 번역어(원어) for well-known terms that just need the original

Calibration by audience:

Rules:

Reflection Mode (default for non-trivial content)

Reflection passes (Stage 5–7) are the default — not optional — for any content that is more than a short snippet. Empirical evidence (Slator 2024, Self-Refine paper) shows a single polish pass cuts translationese rates roughly in half. Skipping reflection on non-trivial content is the most common cause of translationese complaints.

When to run Stage 5–7

Default ON for:

Default OFF (Stage 4 verification only) for:

When in doubt, run reflection. The cost is roughly 1.5–2× tokens; the quality gain on body-text fragments and Europeanized patterns is large.

Extended workflow

After completing Stage 1–4, continue with:

Stage 5: Critical Review

Re-read the translation against the source with fresh eyes. Produce a diagnostic review (no rewriting yet):

Stage 6: Revision

Apply all findings from Stage 5 to produce a revised translation:

Stage 7: Polish

Final pass for publication quality:

Batch Translation Rules

When translating multiple strings (e.g., UI keys):

  1. Read all strings first before translating any — context matters
  2. Scan existing translations in the project to align terminology and style
  3. Maintain terminology consistency across the batch
  4. Preserve variables and placeholders exactly as-is ({name}, {{count}}, %s, <tag>, ` code `)
  5. Keep key structure — only translate values, never keys
  6. Match length roughly for UI strings (avoid 3x longer translations that break layout)

Output Format

Single text

Source (EN):
> original text

Translation (KO):
> translated text

Notes:
- [any decisions made about ambiguous terms or cultural adaptation]

Batch (i18n files)

Output in the same format as input (JSON, ARB, YAML, etc.) with only values translated.

Review mode

Original translation:
> existing translation

Suggested revision:
> improved translation

Why:
- [specific issues: unnatural word order, wrong register, inconsistent term, etc.]

Troubleshooting

| Issue | Solution |

|-------|----------|

| Ambiguous source meaning | Flag and ask for context before translating |

| No precedent for a term | Propose a translation, confirm with user before applying |

| Register conflict in source | Follow project's existing register, note the inconsistency |

| Placeholder in middle of sentence | Restructure around it; never break placeholder syntax |

| Translation too long for UI | Provide a shorter alternative with note |

| Multiple valid translations for a term | Pick the one most consistent with project's existing translations; note alternatives |

| Target language requires gendered forms | Follow source text intent; prefer gender-neutral forms when available in target language |

| Tone shifts across a long document | Re-read end-to-end after translating; normalize register to the dominant tone |

How to Execute

Follow the translation method (Stage 1-4) step by step.

Before submitting, verify against resources/translation-rubric.md and resources/anti-ai-patterns.md.

Execution Protocol (CLI Mode)

Vendor-specific execution protocols are injected automatically by oma agent:spawn.

Source files live under ../_shared/runtime/execution-protocols/{vendor}.md.

Logical Operations

Actions

| Action | SSL primitive | Evidence |

|--------|---------------|----------|

| Read source and context | READ | Text, locale files, code context |

| Select register and terminology | SELECT | Existing translations and domain terms |

| Infer intended meaning | INFER | Meaning extraction stage |

| Write translation | WRITE | Target-language reconstruction |

| Validate placeholders/structure | VALIDATE | Verification gate |

| Compare against rubric | COMPARE | Translation rubric |

| Report translation or notes | NOTIFY | Final output |

Tools and instruments

Canonical workflow path

1. Analyze source register, intent, domain terms, placeholders, and structure.
2. Reconstruct meaning in the target language, not word-for-word.
3. Run mechanical checks and `resources/translation-rubric.md` before emitting output.

For UI files, scan sibling locale files first:

rg "<source-key-or-term>" .

Resource scope

| Scope | Resource target |

|-------|-----------------|

| LOCAL_FS | Locale files, docs, README, source text files |

| CODEBASE | Components and code context around UI strings |

| MEMORY | Register, glossary, ambiguity, verification notes |

| USER_DATA | User-provided text and target-language requirements |

Preconditions

Effects and side effects

Guardrails

  1. Scan existing locale files before translating to align with project conventions
  2. Preserve placeholders and interpolation syntax
  3. Translate meaning, not words
  4. Preserve emotional connotations — translate the feeling, not just the dictionary meaning (e.g., "alarming" carries urgency/concern, not merely "surprising")
  5. Match register consistently throughout a single piece
  6. Split, merge, or restructure sentences for target language naturalness
  7. Flag ambiguous source text rather than guessing
  8. Preserve domain terminology — if a term has established meaning in the field (e.g., harness, scaffold, shim, polyfill, middleware), keep it even if a "simpler" native word exists
  9. Never produce literal word-for-word translations
  10. Never mix registers within a single piece (formal + casual)
  11. Never replace domain-specific terms with generic equivalents (e.g., "harness" → "framework", "shim" → "wrapper")
  12. Never translate proper nouns unless existing translations do so
  13. Never change the meaning to "sound better"
  14. Never skip verification stage for batches > 10 strings
  15. Never modify source file structure (keys, nesting, comments)
  16. Never preserve source-language formatting artifacts that are unnatural in the target language. For CJK targets (Korean, Japanese, Chinese), em dashes (—), title case in headings, and trailing "-ing" participle clauses must be restructured — even when the source uses them. See resources/anti-ai-patterns.md rules 13–16.

References

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.