Pikku i18n

From pikkujs/pikku · View interactive version

Pikku i18n is an AI agent skill from the GitHub repository pikkujs/pikku. User-facing text in a Pikku frontend: Paraglide messages, writing or rewording a label, heading or button (including wording picked in the preview), translatable copy, adding a language, enum/status/role labels, RTL (Arabic, Hebrew, Farsi, Urdu). Not backend error messages or logs.

How to use this skill

Skill file

Pikku i18n

Every visible string is a message

Never hardcode display text: add a key to messages/en.json and render m.the__key(), even in an English-only app. The messages are the seam a second language slots into, and the deploy pipeline type-checks them, so an i18n mistake blocks the build rather than the release.

Change messages with the CLI, not by hand

To add or reword a message, run pikku i18n key. It writes the catalogue files

itself, so there is no JSON to edit and no tsc to run: the Vite plugin

recompiles on message edits, and the running app picks the change up.

pikku i18n key overview__tests_heading en="Tests" --update   # reword; other locales are left as they were
pikku i18n key account__title en="Your account" de="Dein Konto"   # add; locales you do not give are marked to translate

Name only the locales you mean to change. --update is required for a key that

already exists, so a typo cannot silently create a new one. A wording the user

picked in the preview arrives with its key (… · key overview__tests_heading);

use that key rather than searching the source for the text.

Change messages with the CLI, not by hand

To add or reword a message, run pikku i18n key. It writes the catalogue files

itself, so there is no JSON to edit and no tsc to run: the Vite plugin

recompiles on message edits, and the running app picks the change up.

pikku i18n key overview__tests_heading en="Tests" --update   # reword; other locales are left as they were
pikku i18n key account__title en="Your account" de="Dein Konto"   # add; locales you do not give are marked to translate

Name only the locales you mean to change. --update is required for a key that

already exists, so a typo cannot silently create a new one. A wording the user

picked in the preview arrives with its key (… · key overview__tests_heading);

use that key rather than searching the source for the text.

Pick the reference

Three axes, and a brief usually means only one

"The entire UI is German" is about the product, not the codebase. Reading it as about the codebase is the most expensive mistake here.

baseLocale stays en whatever language the product speaks: it names the message _source_ catalogue every other locale derives from. Set defaultLocale instead.

Direction is one setting, not per-component work

Set dir once at the document root from the active locale and the browser mirrors everything, provided every custom style is flow-relative (margin-inline-start, text-align: start, Tailwind ms-*/me-*), not physical (margin-left, text-align: left, ml-*/mr-*). Write logical properties from the start, even in an English-only app. Root dir does not flip icon artwork: chevrons and back/forward arrows need their own treatment (references/rtl.md).

What NOT to do

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.