core
Smallest Better Translate setup for plain TypeScript, Node.js, Bun, APIs, and shared libraries.
от jralvarenga★ 23 звезды на GitHub
Установить core в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Об этом скилле
Core Skill
Use this guide when you want the smallest possible Better Translate setup.
What this package is for
@better-translate/core is the base translation engine.
Use it when:
- the app is plain TypeScript
- the code runs on Node.js, Bun, or an API
- you want one shared translator file before adding framework adapters
Smallest correct setup
Create one translator file and export it:
import { configureTranslations } from "@better-translate/core";
const en = {
home: {
title: "Hello",
},
} as const;
const es = {
home: {
title: "Hola",
},
} as const;
export const translator = await configureTranslations({
availableLocales: ["en", "es"] as const,
defaultLocale: "en",
fallbackLocale: "en",
messages: { en, es },
});
Keep TypeScript autocomplete available
TypeScript key autocomplete depends on the shared exported translator.
- Keep each messages object
as const - Export one shared
translator - Call
translator.t(...)from code that needs typed keys
import { translator } from "./i18n";
translator.t("home.title");
translator.t("home.title", { locale: "es" });
That keeps locale values and translation keys inferred from the messages you configured.
When to add another package
- Add
@better-translate/reactwhen React components need hooks or locale switching - Add
@better-translate/nextjswhen Next.js routes or server helpers need locale awareness - Add
@better-translate/astrowhen Astro requests need locale awareness - Add
@better-translate/mdwhen content files should follow the same locale setup
Auto-extract strings without naming keys
Use { bt: true } in any t() call to write source text directly instead of inventing a key:
t("Hello world", { bt: true });
Then run npx bt extract to generate keys automatically and rewrite the calls. See skills/cli/SKILL.md for the full setup.
Main idea
Do not create one translation system per framework.
Create one core translator first, then let adapters read from it.
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл core?
Smallest Better Translate setup for plain TypeScript, Node.js, Bun, APIs, and shared libraries.
Как установить скилл core?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл core запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
theme-factory
AnthropicToolkit for styling artifacts with a theme. These artifacts can be slides, docs, reportings, HTML landing pages, etc. There are 10 pre-set themes with…
access
AnthropicManage Discord channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
configure
AnthropicSet 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…
access
AnthropicManage iMessage channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…