yapyak
БесплатноБез исполняемых скриптовНе проверенyapyak, an i18n compiler with a small runtime: t() with the source string as the key, ICU plurals and selects, rich text, format.* for numbers, dates and…
от onmax★ 729 звёзд на GitHubОб этом скилле
yapyak compiles t('Save changes') into the module that renders it. The source string is the key. On save, the yapyak plugin extracts every t() call, writes an empty stub to each locale file, and fills the stub through a translator when one is configured.
Read the reference for the project's framework before writing setup or component code:
| Framework | Reference |
|---|---|
| React with Vite | references/react.md |
| React Router | references/react-router.md |
| TanStack Start | references/tanstack-start.md |
| Vue with Vite | references/vue.md |
| Nuxt | references/nuxt.md |
| Svelte with Vite | references/svelte.md |
| SvelteKit | references/sveltekit.md |
| Astro | references/astro.md |
Every YAPnnnn diagnostic, its cause, and its fix: references/diagnostics.md
Install
Requirements: Node.js 22.23.4+, Vite 8+. Frameworks: React 19+, Vue 3.4+, Svelte 5+, Astro 7+, Nuxt 4.1+, React Router 7.9+, SvelteKit 3+, TanStack Start 1.168+.
| Framework | Install | Build config | Processor |
|---|---|---|---|
| React | npm install yapyak @yapyak/vite @yapyak/react |
plugins: [react(), yapyak()] |
react() from @yapyak/react/processor |
| React Router | add @yapyak/react-router |
plugins: [reactRouter(), yapyak()] |
react() |
| TanStack Start | add @yapyak/tanstack-start |
plugins: [tanstackStart(), react(), yapyak()] |
react() |
| Vue | npm install yapyak @yapyak/vite @yapyak/vue |
plugins: [vue(), yapyak()] |
vue() from @yapyak/vue/processor |
| Nuxt | npx nuxi module add yapyak |
modules: ['@yapyak/nuxt'] |
nuxt() from @yapyak/nuxt/processor |
| Svelte | npm install yapyak @yapyak/vite @yapyak/svelte |
plugins: [svelte(), yapyak()] |
svelte() from @yapyak/svelte/processor |
| SvelteKit | add @yapyak/sveltekit |
plugins: [sveltekit(), yapyak()] |
svelte() |
| Astro | npm install yapyak @yapyak/astro |
integrations: [yapyak()] from @yapyak/astro/integration |
astro() from @yapyak/astro/processor |
Steps, in order:
- Install the packages. Add a translator package when the project translates with a model:
@yapyak/anthropic,@yapyak/openai,@yapyak/gemini,@yapyak/ollama, or@yapyak/claude-code. - Register the plugin in the build config, after the framework plugin.
yapyakis a named export of@yapyak/vite. - Create
yapyak.config.tsat the project root with the processor for the framework:
import { defineConfig } from 'yapyak/config';
import { react } from '@yapyak/react/processor';
export default defineConfig({
processors: [react()]
});
- Add
.yapyak/types.d.tsandyapyak.config.tstoincludeintsconfig.json. Nuxt adds the types on its own. - Add the first target locale:
npx yapyak add sv. This createslocales/sv.jsonand regenerates theLocaletype. - Add
.yapyak/to.gitignore. It holds the orphan cache; the locale files are the committed source of truth.
Register one processor per framework in the project. The built-in parser reads .ts, .tsx, .js, .jsx, .mts, .mjs, .cts, and .cjs without one.
Writing text
Wrap every user-facing string in t() from yapyak. Write the sentence in the source language exactly as the reader sees it; it is the key.
// ✓ The sentence is the key
t('Save changes');
// ✗ A synthetic key has no source string to translate
t('common.buttons.save');
Call t() inside the component or function that renders the text. A module-scope call evaluates once and never follows the active locale (YAP0055).
// ✓ Reads the active locale on every render
function SaveButton() {
return t('Save changes');
}
// ✗ Evaluates once when the module loads
const label = t('Save changes');
Write the source as a static string literal and the params as an inline object literal. The compiler reads neither from a variable.
// ✓ Static source, inline params
t('Hi {name}', { name });
// ✗ Template literal (YAP0002)
t(`Hi ${name}`);
// ✗ Variable source
t(label);
// ✗ Params in a variable (YAP0006)
t('Hi {name}', params);
Never concatenate around t() → put the moving part in a placeholder.
// ✓ One message, one placeholder
t('{count} items in your cart', { count });
// ✗ Word order differs per language
t('You have') + ' ' + count + ' ' + t('items');
Call t() in attribute positions too: aria-label={t('Pause')}, :title="t('Settings')", placeholder={t('Search')}. The attribute name is part of the call-site context the translator receives.
Placeholders
Write {name} in the source and pass the value under the same name. TypeScript derives the required keys from the source string.
| Form | Example | Value type |
|---|---|---|
| Plain | `t('Hi {n |
Установить yapyak в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл yapyak?
yapyak, an i18n compiler with a small runtime: t() with the source string as the key, ICU plurals and selects, rich text, format.* for numbers, dates and lists, locale switching and persistence, yapyak.config.ts, translators, the yapyak CLI, and YAPnnnn diagnostics. Use when adding or editing user-facing text in a project that depends on yapyak, when setting up @yapyak/vite, @yapyak/react, @yapyak/vue, @yapyak/svelte, @yapyak/astro, @yapyak/nuxt, @yapyak/react-router, @yapyak/sveltekit or @yapyak/tanstack-start, or when a YAP diagnostic fires.
Как установить скилл yapyak?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл yapyak запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
theme-factory
Toolkit for styling artifacts with a theme. These artifacts can be slides, docs, reportings, HTML landing pages, etc. There are 10 pre-set themes with…
от Anthropicaccess
Manage Discord channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropicconfigure
Set up the Discord channel — save the bot token and review access policy. Use when the user pastes a Discord bot token, asks to configure Discord, asks "how…
от Anthropicaccess
Manage iMessage channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropic