aymericzip/intlayer-skills/intlayer-vanilla

Claude Code and agent skill by aymericzip/intlayer-skills

Trust tier 3
  • community
Source check pending

Checking that the SKILL.md file is still in the repository.

Integrates Intlayer internationalization with plain JavaScript / TypeScript (no UI framework). Use when the user asks to "setup Vanilla JS i18n", translate a static HTML page, use "useIntlayer" without a framework, or switch locale in a vanilla application.

Install

npx vskill@latest install aymericzip/intlayer-skills/intlayer-vanilla

SKILL.md

Intlayer Vanilla JS Usage

Core Philosophy

Intlayer promotes Component-Level Content Declaration. Instead of a massive global translation file, content is declared in *.content.ts files adjacent to the scripts that use them.

vanilla-intlayer mirrors the react-intlayer API without depending on a UI framework: a pub/sub singleton plus callback-based helpers.

Declare Content

File: src/app.content.ts

typescript
import { t, type Dictionary } from "intlayer";
const content = {
key: "app",
content: {
title: t({
en: "Welcome",
fr: "Bienvenue",
es: "Hola",
}),
},
} satisfies Dictionary;
export default content;

Setup

Call installIntlayer() before any content is rendered.

useIntlayer

useIntlayer(key, locale?) returns the content directly. Chain .onChange() to re-render when the locale changes.

typescript
import { useIntlayer } from "vanilla-intlayer";
const title = document.querySelector("h1")!;
const content = useIntlayer("app").onChange((newContent) => {
title.textContent = String(newContent.title);
});
title.textContent = String(content.title);
// Native attributes: use `.value`
// image.alt = content.title.value;
Without a bundler, read the same helpers from the globals of the standalone bundle: window.VanillaIntlayer and window.Intlayer.

useLocale

typescript
import { useLocale } from "vanilla-intlayer";
const { locale, availableLocales, setLocale, subscribe } = useLocale();
const unsubscribe = subscribe((newLocale) => {
document.documentElement.lang = newLocale;
});
setLocale("fr");

Compiler

The Intlayer Compiler can extract all your content keys from your components, using one CLI command (npx intlayer extract) or automatically at app build.

References

Environments
Concepts
Packages

Security

  • Security scanPassed, 90 of 100Pattern checks on the skill's files.
  • Model reviewPassed

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

7-day trend score
0

Not refreshed yet.

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/aymericzip/intlayer-skills/intlayer-vanilla/badge)](https://verified-skill.com/skills/aymericzip/intlayer-skills/intlayer-vanilla)

Something wrong with this skill or its page? Tell us.