ai-infrastructure-hugg…
Hugging Face Inference SDK patterns for TypeScript/Node.js — InferenceClient setup, chat completion, text generation, streaming, embeddings, image generation,…
Type-safe i18n for Vue 3 Composition API — useI18n, pipe-syntax plurals, i18n-t/d/n components, lazy-loaded locales. Load when a project imports vue-i18n.
$ npx -y skills add agents-inc/skills --skill web-i18n-vue-i18n --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/web-i18n-vue-i18nContext preview
The summary Claude sees to decide when to auto-load this skill.
Type-safe i18n for Vue 3 Composition API — useI18n, pipe-syntax plurals, i18n-t/d/n components, lazy-loaded locales. Load when a project imports vue-i18n.
name: web-i18n-vue-i18n description: Type-safe i18n for Vue 3 Composition API — useI18n, pipe-syntax plurals, i18n-t/d/n components, lazy-loaded locales. Load when a project imports vue-i18n.
> **Quick Guide:** `createI18n({ legacy: false })` selects Composition API mode, and `useI18n()` > returns `t` for messages, `d` for dates, `n` for numbers and `locale` as a writable ref. Plurals > are pipe-separated rather than ICU. `<i18n-t>`, `<i18n-d>` and `<i18n-n>` put components and > styling inside a formatted result. Version boundary: Legacy API mode, the `v-t` directive and the > Rails `%{var}` format are deprecated in v11 and removed in v12; `$tc()` is already gone.
**Detailed Resources:**
---
created by `createI18n`. Follow [examples/core.md](examples/core.md).
Linked messages (`@:key`) resolve against global messages only, so a locally-scoped message cannot reference one.
the locale is not switched until the import resolves. Follow [examples/lazy-loading.md](examples/lazy-loading.md).
---
<critical_requirements>
**Set `legacy: false` in `createI18n`.** It is what enables `useI18n()`; the default is the Options API mode that v11 deprecates and v12 removes.
**Take everything from one `useI18n()` call per component.** Destructure `t`, `d`, `n` and `locale` together — separate calls can resolve to separate composer instances that then disagree about the current locale.
**Await the message load before assigning `locale.value`.** Switching first renders the raw keys until the import resolves.
**Set `fallbackLocale`.** Without it a key missing from the active locale renders as the key rather than as the default locale's text.
</critical_requirements>
---
**Auto-detection:** vue-i18n, useI18n, createI18n, legacy: false, setLocaleMessage, i18n-t, i18n-d, i18n-n, keypath, pluralRules, datetimeFormats, numberFormats, fallbackLocale, globalInjection
**Applies to:**
**Handled elsewhere:**
to locales; the hook shape is in [examples/lazy-loading.md](examples/lazy-loading.md)
[reference.md](reference.md)
---
<philosophy>
Messages are plain JSON resolved through a reactive locale ref, so a locale change re-renders every component that read a message — no subscription, no invalidation step. Two consequences shape the API. Because the composer holds that ref, one component wants one composer, which is why repeated `useI18n()` calls are the recurring bug. And because `t()` returns a string rather than a VNode, anything needing markup inside a translation goes through `<i18n-t>` instead — which is also what keeps `v-html` out of translated content.
</philosophy>
---
<patterns>
One instance, registered once on the app.
export const i18n = createI18n({
legacy: false, // enables useI18n()
locale: DEFAULT_LOCALE,
fallbackLocale: DEFAULT_LOCALE,
messages: { en },
});
app.use(i18n);`globalInjection` defaults to `true`, which is what puts `$t`, `$d` and `$n` in templates.
Full code: [examples/core.md](examples/core.md)
One call, everything destructured from it.
<script setup lang="ts">
const { t, d, n, locale, availableLocales } = useI18n();
</script>
<template>
<h1>{{ t("dashboard.title") }}</h1>
<p>{{ d(updatedAt, "long") }} · {{ n(total, "currency") }}</p>
</template>Full code: [examples/core.md](examples/core.md)
Named placeholders, `{'@'}` to escape a literal, and `@:key` to reference another message with an optional case modifier.
{
"app": { "name": "My App" },
"greeting": "Hello, {name}!",
"welcome": "Welcome to @:app.name!",
"shout": "@.upper:app.name"
}Full code: [examples/core.md](examples/core.md)
Pipe-separated forms rather than ICU. `{n}` and `{count}` both resolve to the value passed as the second argument.
{
"car": "car | cars",
"apple": "no apples | one apple | {count} apples"
}Languages needing more than three forms take a `pluralRules` function per locale, which returns the index of the form to use.
Full code: [examples/core.md](examples/core.md)
`<i18n-t>` puts components into a mes
The official skills marketplace for Agents Inc. 150+ skills covering everything from React and Prisma to Redis, ElevenLabs, and infrastructure tooling. Pick the skills that match your stack and install them via Claude Code. Need more control?
Repo: agents-inc/skills
Hugging Face Inference SDK patterns for TypeScript/Node.js — InferenceClient setup, chat completion, text generation, streaming, embeddings, image generation,…
LiteLLM proxy server setup, TypeScript client patterns via OpenAI SDK, model routing, fallbacks, load balancing, spend tracking, virtual keys, and production…
Serverless GPU compute platform for AI model deployment — web endpoints, GPU functions, model serving, and TypeScript client patterns
Local LLM inference with the Ollama JavaScript client -- chat, streaming, tool calling, vision, embeddings, structured output, model management, and…
Replicate SDK patterns for TypeScript/Node.js -- client setup, predictions, streaming, webhooks, file handling, model versioning, deployments, and training
Together AI SDK patterns for TypeScript — client setup, chat completions, streaming, structured output, function calling, embeddings, image generation,…