agentleFS
aymericzipaymericzip/intlayer-skills/skills/intlayer-astro/SKILL.md

intlayer-astro

Skill5 starsChanged 47 days agoApache-2.0View on GitHub

Integrates Intlayer internationalization with Astro applications. Use when the user asks to "setup Astro i18n", use "getIntlayer" in Astro components, or manage server-side content in Astro.

1 other project uses a version of this, 1 of them edited.

Adopted by

Most recently taken up by

The file

Files
SKILL.md

Intlayer Astro Usage

Setup

  • Astro

The intlayer() integration in astro.config.ts builds the dictionaries and adds a middleware that resolves the locale of every request into Astro.locals.intlayer.

Server-side (Astro Components)

---
import { useIntlayer, useLocale } from "astro-intlayer";

// Locale resolved by the middleware (e.g. /es/about -> 'es')
const { locale } = useLocale();
const content = useIntlayer("my-dictionary-key");
---
<h1>{content.title}</h1>

Framework Islands

Islands use their framework package (react-intlayer, vue-intlayer, svelte-intlayer, solid-intlayer, preact-intlayer, lit-intlayer) and receive the server-detected locale as a prop.

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

  • Astro
  • Astro and React
  • Astro and Vue
  • Astro and Svelte
  • Astro and Solid
  • Astro and Preact
  • Astro and Lit

Concepts

  • Variants
  • Collections
  • Compiler
  • Formatters (number, currency, date, …)

Packages

  • Intlayer Exports
  • Astro Intlayer Exports
  • astro-intlayer intlayer
  • astro-intlayer onRequest
  • astro-intlayer useDictionary
  • astro-intlayer useIntlayer
  • astro-intlayer useLocale

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.