Repository navigation
heeng keyboard translator
You meant to type Hebrew, the layout was still English, and שלום came out as akuo. This plugin
notices and offers the repair before Claude acts on the garbled text.
/plugin marketplace add roypadina/padina-claude-code-plugins
/plugin install heeng-keyboard-translator@padina
Needs only Python 3, which macOS ships.
The obvious version of this tool translates the whole message in one direction. That handles the easy case and misses the common one: an Israeli developer mixing Hebrew and English in one sentence where a single layout-switch keystroke didn't land, leaving one or two broken tokens in an otherwise fine sentence.
This plugin analyses each word independently, so all three cases work:
| Case | You typed | It reconstructs |
|---|---|---|
| Whole message in the wrong layout | akuo |
שלום |
| One bad token in a good sentence | שלום, akuo חבר |
שלום, שלום חבר |
| Every switch inverted — different directions in one sentence | akuo, ש אםהק כםםג |
שלום, ש אםהק food |
| Nothing wrong | hello world |
unchanged, and the skill stays silent |
For each token the translator computes both readings — as-if-English-typed-in-Hebrew and the reverse — and scores them against bundled common-word sets (140 Hebrew, 123 English, weighted toward everyday and developer vocabulary).
- High confidence — the original, or exactly one translation, is a real word. It picks that one.
- Low confidence — neither reading is a known word. It leaves the token alone and reports both candidates so you can decide.
Tokens of two characters or fewer are too ambiguous to call. The script still scores them and
returns them at confidence: low with the original kept — skipping them is a rule in the skill, not
a filter in translate.py.
-
It never substitutes silently. It shows the original, the reconstruction and a per-word diff,
then asks via
AskUserQuestionwhether to use it, edit it, or keep the original. - It does not fire inside fenced code blocks, file paths, URLs or identifiers, where a "correction" would be corruption.
- It does not trigger on text that is simply recognisable in either language.
The script is useful on its own:
python3 skills/keyboard-layout-fix/scripts/translate.py --per-word "שלום, akuo חבר"{
"original": "שלום, akuo חבר",
"reconstructed": "שלום, שלום חבר",
"fix_count": 1,
"words": [ { "word": "akuo", "candidates": {...}, "choice": "en_to_he", "confidence": "high" } ]
}Without --per-word it translates the whole string both ways and scores each direction.
.claude-plugin/plugin.json
skills/keyboard-layout-fix/
SKILL.md triggers, workflow, boundaries
keyboard-mapping.json bidirectional US QWERTY ↔ Israeli SI-1452 map
scripts/translate.py per-word translator + plausibility scoring
- Hebrew has no letter case, so uppercase Latin maps to the same Hebrew letter as lowercase.
- Only US QWERTY ↔ Israeli SI-1452. Another layout pair needs a new mapping file — the map is plain JSON, so adding one is mostly data entry.
- The common-word sets are small by design. They are a plausibility signal, not a dictionary; the uncertain cases are handed to you rather than guessed.