Translator

From syedsaif666/LGTM · View interactive version

Translator is an AI agent skill from the GitHub repository syedsaif666/LGTM. Translate JSON dictionaries and MDX content files between locales with structural integrity, SEO/GEO-aware keyword adaptation, and native-quality output. Use when translating UI strings, blog posts, service pages, or any locale-specific content.

How to use this skill

Skill file

Translator

Translate web content between locales. Every translation must read like it

was originally written in the target language while preserving exact file

structure.

Project context


1. JSON dictionary translation

Structure rules

Dictionaries are nested JSON objects. Keys are typically camelCase.

{
  "section": {
    "subsection": {
      "label": "Translate this value",
      "heading": "And this one"
    }
  }
}

Preserve exactly:

Translate:

Do NOT translate:

If the source has interpolation variables ({{variable}} or {variable}),

preserve them exactly in the translated string. Do not translate variable names.

Validation

After translating dictionary files:

python .claude/scripts/validate-json-structure.py <original.json> <translated.json>

For batch locale parity checks:

python .claude/scripts/dictionary-diff.py --source en --target de --dir dictionaries

2. MDX content translation

Frontmatter rules

MDX files use YAML frontmatter. Fields fall into two categories:

Translate these text fields:

| Field | Notes |

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

| title | Optimize for target-language search intent (see section 3) |

| description | Optimize for target-language search intent |

| summary | Natural adaptation, not word-for-word |

| tagline | Short, punchy — adapt to target language rhythm |

Do NOT translate metadata fields (copy byte-identical):

Date fields, author, image paths, tags, status, technical metadata,

ordering fields, category slugs, URLs, and any field whose value is

a machine-readable identifier rather than human-readable text.

Body rules

Translate:

Do NOT translate:

Validation

python .claude/scripts/validate-mdx-structure.py <original.mdx> <translated.mdx>

3. SEO/GEO-aware translation

Do not mechanically translate keywords. Optimize for how the target audience

actually searches.

Title and description optimization:

Structured content preservation (for AI engine citability):

Internal linking:


4. Quality standard

The bar

A native speaker of the target language should read the content and not

suspect it was translated. No translationese. No awkward calques.

No word-for-word mirroring of source language sentence structure.

What good translation looks like

languages have different word order conventions — respect them.

rewrite the thought.

should feel casual and direct in the target language.

the source.

Anti-fabrication rules

  1. Never invent content not present in the source. If the source says

three benefits, the translation has three benefits. Not four.

  1. Never omit content present in the source. Every paragraph, heading,

list item, and table row must appear in the translation.

  1. Never change factual claims. Statistics, pricing, dates, company names,

product names, technical specifications — these transfer exactly.

  1. Never alter URLs. Not even "fixing" a URL that looks wrong.

Terminology consistency

Use consistent terminology across all files for the same locale. Do not

translate a term one way in one section and another way elsewhere.

If the project has a terminology glossary (references/terminology-glossary.md),

follow it. If not, document terminology decisions in the translation report.


5. Language-specific rules

Each locale can have its own reference file at references/i18n-{code}.md

containing register, grammar rules, terminology table, and brand names.

Before translating, check for references/i18n-{locale}.md for the

target locale. If no file exists, create one and document all decisions.

When creating a new locale reference, determine:

  1. Register (formal/informal) based on context
  2. Which technical terms the target industry keeps in the source language
  3. Script or directionality requirements (RTL for Arabic, etc.)
  4. Cultural adaptations (date formats, number separators, etc.)

6. Workflow

  1. Read the source file(s).
  2. Determine content type (JSON or MDX) and apply the corresponding rules.
  3. Translate following quality standards and anti-fabrication rules.
  4. Write output to the matching path in the target locale directory.
  5. Validate structure using the appropriate validation script.
  6. If validation fails, fix the issues and re-run until PASS.
  7. Report what was translated, any terminology decisions made, and any

content that needs native speaker review.


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.