Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

premium-translate

БесплатноБез исполняемых скриптовНе проверен

Translates Simple History Premium plugin strings for one or multiple locales. Use when translating or updating premium plugin PO files.

bonnyот bonny★ 315 звёзд на GitHub

Об этом скилле

Translate Premium Plugin Strings

Translate the Simple History Premium plugin's PO files from English to specified locales.

Premium Add-on Path

See CLAUDE.local.md for the premium add-on path. Read it first to determine the correct path.

Do not cd into it. This skill runs from the core plugin repository, and every command below takes the premium path explicitly. Set it once and reuse it:

PREMIUM=/path/from/CLAUDE.local.md/simple-history-premium

Two reasons this matters. cd is not in this skill's allowed-tools, so changing directory triggers permission prompts on every step. More importantly, i18n:make-pot runs wp i18n make-pot . — that . is resolved against the working directory, so running it from the wrong place scans the wrong plugin's source. npm --prefix sets the script's working directory to the prefix, which removes the ambiguity entirely.

All the tooling is on the host — wp, msgfmt, msgunfmt — so no container is needed.

Workflow

Setup

  1. Read CLAUDE.local.md to find the premium add-on path and set $PREMIUM
  2. Read $PREMIUM/translation-config.json to get configured locales
  3. Check existing PO/POT files in $PREMIUM/languages/
  4. Check available npm scripts with npm --prefix "$PREMIUM" run

Determine Locales

Break up $ARGUMENTS into parts — each part is a locale.

If no locales are provided, use all locales defined in the translation config.

Confirm that each locale is valid and defined in the translation config. If not, show an error and exit.

Premium is translated into seven languages only: de_DE, fr_FR, es_ES, sv_SE, nl_NL, pl_PL and it_IT. They were picked from paying customers per country, and the other 15 catalogues were deleted in 1.16.0. See $PREMIUM/languages/README.md for the numbers. Never add a locale to the config on your own: adding a language is Pär's call, made when customers who use it ask.

Show the locales to be translated for confirmation.

Step 1: Update Source Strings (once)

Record the string count before regenerating, so there is something to compare against:

POT="$PREMIUM/languages/simple-history-add-on.pot"
BEFORE=$(grep -c '^msgid "' "$POT")

# Update the POT file with the latest strings from source code.
npm --prefix "$PREMIUM" run i18n:make-pot

echo "msgids: $BEFORE -> $(grep -c '^msgid "' "$POT")"

The count must not go down, and if strings were added to the source it must go up. An unchanged or shrinking count means make-pot scanned the wrong tree — check $PREMIUM before going further, because the next command merges the result into every catalogue.

Match '^msgid "' and not '^msgid': the latter also counts every msgid_plural line and inflates the number.

Then merge the new strings into every locale's PO file:

npm --prefix "$PREMIUM" run i18n:update-po

Step 2: Translate Each Locale

If translating 1-2 locales: Translate sequentially in the main conversation.

If translating 3+ locales: spawn one agent per locale, all in parallel (at most seven). A lower-power model such as Sonnet does this well. Give each agent this workflow, which only touches the untranslated entries:

  1. msgattrib --untranslated --no-obsolete <po> -o <tmp>/todo.po
  2. Fill every msgstr in todo.po, keeping the header and all #., #: and #, php-format lines.
  3. msgcat --use-first <tmp>/todo.po <po> -o <tmp>/merged.po, run msgfmt -c on it, then copy it over <po>.

msgcat reorders and rewraps the file, so after all agents are done run npm --prefix "$PREMIUM" run i18n:update-po once more to put every catalogue back in POT order. Without it the diff shows thousands of moved lines.

Context the strings do not carry on their own, worth passing to every agent:

  • Query-language tokens stay in English, including today, yesterday, YYYY-MM-DD, day:, days: and level:. The parser only accepts the English words.
  • "Move %s earlier" / "Move %s later" move a column up or down in the vertical Columns menu. One run translated them as left/right.
  • "%1$s and %2$s others" in the weekly email means other people.

Translation rules for each locale:

  1. Read the PO file for the locale
  2. For each msgid (English string), provide an accurate translation in the corresponding msgstr
  3. Keep WordPress-specific terms, HTML tags, and placeholders (%s, %d, %1$s) unchanged
  4. Maintain proper PO file format
  5. Use formal tone appropriate for software interface
  6. Only translate user-facing strings, not developer strings or code
  7. Be consistent with WordPress core translations for common terms

Escaping inside msgstr

Double quotes and backslashes must be backslash-escaped. An unescaped quote terminates the string early and makes the whole file unparseable from that line on.

# Wrong — syntax error, and everything after it fails to compile.
msgstr "Miejsce docelowe "%s" nie znalezione."

# Right.
msgstr
Полный SKILL.md на GitHub

Установить premium-translate в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Read
Edit
Write
Bash(cat:*)
Bash(ls:*)
Bash(grep:*)
Bash(echo:*)
Bash(npm:*)
Bash(wp:*)
Bash(msgfmt:*)
Bash(msgunfmt:*)
Bash(msgattrib:*)
Bash(unzip:*)
Bash(for:*)
Glob
Agent

FAQ

Что делает скилл premium-translate?

Translates Simple History Premium plugin strings for one or multiple locales. Use when translating or updating premium plugin PO files.

Как установить скилл premium-translate?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл premium-translate запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить premium-translate с