Command Palette

Search for a command to run...

Назад к скиллам
скилл № 81218

core

Smallest Better Translate setup for plain TypeScript, Node.js, Bun, APIs, and shared libraries.

БесплатноБез исполняемых скриптов
jralvarengaот 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/react when React components need hooks or locale switching
  • Add @better-translate/nextjs when Next.js routes or server helpers need locale awareness
  • Add @better-translate/astro when Astro requests need locale awareness
  • Add @better-translate/md when 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), без исполняемых скриптов.

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

Сравнить core с