i18n
Skill1 starsChanged 47 days agoMITView on GitHub
Internationalization for Astro — URL-prefix routing, per-locale t() dictionaries, language switcher, localized OG images, and hreflang. Documents the astro-v7-template default (en at root, /de/ prefix) — individual projects can and do override this, always check the project's astro.config.mjs first. Use when adding a new language, creating translated pages, fixing language switcher behavior, setting up hreflang links, or debugging locale routing. Load this skill whenever locale, language, translation, or "German" comes up in an Astro context.
47 other projects use a version of this.
Adopted by
Most recently taken up by
- oivanfelipe/claude-skillstheir own version, first seen Nov 8, 2026
- DnsQueen/orcinus-skillstheir own version, first seen Nov 8, 2026
- lobehub/lobehubtheir own version, first seen Nov 5, 2026
- Cure-Consulting-Group/ProductEngineeringSkillstheir own version, first seen Nov 4, 2026
- sorawit-w/agent-skillstheir own version, first seen Nov 1, 2026
- darknecrocities/SkillBuildertheir own version, first seen Nov 1, 2026
Used with
Projects with it also use oss-pr, pr-automation and 10 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
CES-LtdSkilloss-pr
Use when creating a pull request, after committing changes, or when user invokes /oss-pr. Covers branch management, quality checks, commit, push, and PR creation.
Also in 3 projects that use this
CES-LtdSkillpr-automation
PR Automation Orchestrator: poll open PRs, check CI, run review, fix, and merge eligible PRs. Use when: (1) Invoked by daemon via scripts/pr-automation.sh, (2) User says "/pr-automation".
Also in 3 projects that use this
volovelySkillpr-fix
This skill should be used when the user asks to "fix PR comments", "address PR feedback", "resolve PR comments", provides a GitHub PR URL with intent to fix, or says "pr-fix". It reads all review comments on a PR, decides which need code fixes vs. replies, makes the fixes, and posts replies — all with explicit user approval before any GitHub action.
Also in 3 projects that use this
GitHubSkillstate-management
CoreAI Sandbox's TanStack Query + mock-JSON data layer. USE WHEN: editing data-fetching hooks (`app/hooks/use*.ts`), adding mock data in `app/data/`, or wiring a component to query state.
Also in 4 projects that use this
xfstudioSkillgraphql
GraphQL gives clients exactly the data they need - no more, no less. One endpoint, typed schema, introspection. But the flexibility that makes it powerful also makes it dangerous. Without proper controls, clients can craft queries that bring down your server. This skill covers schema design, resolvers, DataLoader for N+1 prevention, federation for microservices, and client integration with Apollo/urql. Key insight: GraphQL is a contract. The schema is the API documentation. Design it carefully.
Also in 3 projects that use this
MicrosoftSkillbump-version
Bump the VoxelPic version to a user-specified value. USE FOR: setting or updating the project version across all files that embed it. Applies to requests like 'bump version to X.Y.Z', 'set version', or 'update version'.
Also in 4 projects that use this
- +2 more from CES-Ltd
Other versions47 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 47
- lobehub/lobe-chat★ 84ksame name
- lobehub/lobehub★ 84ksame name
- iOfficeAI/AionUi★ 34ksame name
- massCodeIO/massCode★ 7.1ksame name
- leookun/cursor-byok★ 3.2ksame name
- Pixeval/Pixeval★ 3.2ksame name
- akiver/cs-demo-manager★ 2ksame name
- d-kimuson/claude-code-viewer★ 1.3ksame name
- huoshen80/ReinaManager★ 737same name
- OpenClaudia/openclaudia-skills★ 731same name
37 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository81 other files it gives its agents.
- accessibility-action-planSkill
- accessibility-auditSkill
- accessibility-finding-explainerSkill
- accessibility-report-summarySkill
- agent-config-authoringSkill
- agents-sdkSkill
- ai-ux-patternsSkill
- alt-text-generatorSkill
- anti-ai-copySkill
- aria-usage-reviewSkill
- astro-architectureSkill
- astro-client-scriptsSkill
- astro-component-a11y-reviewSkill
- before-after-accessibility-commsSkill
- bfsg-risk-language-softenerSkill
- biomeSkill
- blog-from-transcriptSkill
- brand-voice-dnaSkill
- case-study-from-auditSkill
- client-email-after-auditSkill
- cloudflare-email-serviceSkill
- cloudflare-one-migrationsSkill
- cloudflare-oneSkill
- cloudflareSkill
- complexity-judgmentSkill
- component-doc-writerSkill
- content-clarity-a11y-checkSkill
- content-qaSkill
- conversation-retrospectiveSkill
- darkmodeSkill
- deep-researchSkill
- design-directionsSkill
- design-systemsSkill
- durable-objectsSkill
- faq-from-issuesSkill
- form-accessibility-reviewSkill
- frontend-designSkill
- handoffSkill
- image-to-webpSkill
- keyboard-navigation-reviewSkill
- knowledge-baseSkill
- landing-and-site-builderSkill
- landingpage-from-briefingSkill
- lighthouse-axe-result-explainerSkill
- linkedin-post-from-contentSkill
- llm-councilSkill
- local-business-seoSkill
- mcp-builderSkill
- mdx-contentSkill
- motion-designSkill
- native-html-uiSkill
- newsletter-from-auditSkill
- overlay-tool-risk-explainerSkill
- playwrightSkill
- post-auditSkill
- remotionSkill
- sandbox-migrate-to-nextSkill
- sandbox-nextSkill
- sandbox-sdkSkill
- sandbox-stableSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
9 rules. 0 are common, 2 are distinctive, and 7 are very specific to this project.
0
Common
Most of the 38 edited versions we read keep these.
2
Distinctive
This author's own choices. Worth a look.
7
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 131
Create src/pages/<name>.astro with const locale = 'en'.
- Very specific: line 133
Add translation keys to both en.ts and de.ts.
- Very specific: line 134
Add nav links via localePath('/<name>', locale).
- Distinctive: line 135
Add OG image entries for both locales in the OG generator.
- Very specific: line 139
Add the locale to astro.config.mjs (locales: ['en', 'de', 'fr']).
- Very specific: line 141
Create src/i18n/fr.ts and register it in src/i18n/index.ts.
- Very specific: line 142
Create src/pages/fr/ and duplicate the localized pages with const locale = 'fr'.
- Very specific: line 143
Update the sitemap config: locales: { en: 'en', de: 'de', fr: 'fr' }.
- Distinctive: line 144
Add OG image entries for the new locale.
“Common” is measured: kept by at least 6 in 10 of the 38 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
i18n
Before applying any of this: check the project's astro.config.mjs for defaultLocale/locales/prefixDefaultLocale, and check whether localePath/switchLocalePath/useTranslations are actually imported anywhere in src/pages. This skill documents the astro-v7-template default — projects frequently override the locale direction (e.g. a German-market site making de the unprefixed default), and some projects abandon the shared-dictionary pattern entirely in favor of hand-duplicated per-locale page files with hardcoded content. Don't assume either pattern without verifying against the actual project first.
Architecture (astro-v7-template default)
Two layers:
- Astro i18n routing — URL prefixing (
/de/contact). - App-level translations —
t('key')per locale.
Typical locales
enas default without prefix —/,/contact.deprefixed —/de/,/de/contact.
(Some projects flip this — de as the unprefixed default for a German-only market, en prefixed. Same mechanism, just swap which locale has the empty prefix in astro.config.mjs and langPrefixes/routeMap.)
Astro config
// astro.config.mjs
export default defineConfig({
i18n: {
defaultLocale: 'en',
locales: ['en', 'de'],
routing: {
prefixDefaultLocale: false, // EN at root, DE at /de/
},
},
});Utilities
// Build a locale-prefixed path
localePath('/contact', 'en'); // → '/contact'
localePath('/contact', 'de'); // → '/de/contact'
// Detect locale from URL
getLocaleFromPath('/de/contact'); // → 'de'
getLocaleFromPath('/contact'); // → 'en'
// Swap locale in the current path
switchLocalePath('/de/contact', 'en'); // → '/contact'
switchLocalePath('/contact', 'de'); // → '/de/contact'
// Translation helper
const t = useTranslations(dictionary);
t('nav.home'); // → 'Home'Translation files
src/i18n/
en.ts # English
de.ts # German
index.ts # t() helper wiring// src/i18n/en.ts
export default {
'nav.home': 'Home',
'nav.contact': 'Contact',
'home.title': 'My site',
'contact.title': 'Contact',
'contact.send': 'Send',
'404.title': '404 — Page not found',
} as const;// src/i18n/index.ts
import type { Locale, Translations } from '@/lib/i18n';
import { useTranslations } from '@/lib/i18n';
import de from './de.js';
import en from './en.js';
const translations: Record<Locale, Translations> = { en, de };
export function t(locale: Locale) {
return useTranslations(translations[locale]);
}Page pattern
Each locale gets its own page file:
src/pages/
index.astro # EN homepage
contact.astro # EN contact
de/
index.astro # DE homepage
contact.astro # DE contact---
import { localePath } from '@/lib/i18n';
import { t } from '@/i18n';
const locale = 'de';
const tr = t(locale);
const links = [
{ href: localePath('/', locale), label: tr('nav.home') },
{ href: localePath('/contact', locale), label: tr('nav.contact') },
];
---
<BaseLayout title={tr('home.title')} lang={locale}>
<Navbar slot="header" links={links}>
<a href="/contact">EN</a>
</Navbar>
<h1>{tr('home.title')}</h1>
</BaseLayout>Adding a new page (both locales)
- Create
src/pages/<name>.astrowithconst locale = 'en'. - Create
src/pages/de/<name>.astrowithconst locale = 'de'. - Add translation keys to both
en.tsandde.ts. - Add nav links via
localePath('/<name>', locale). - Add OG image entries for both locales in the OG generator.
Adding a new locale
- Add the locale to
astro.config.mjs(locales: ['en', 'de', 'fr']). - Extend your
Localetype (['en', 'de', 'fr'] as const). - Create
src/i18n/fr.tsand register it insrc/i18n/index.ts. - Create
src/pages/fr/and duplicate the localized pages withconst locale = 'fr'. - Update the sitemap config:
locales: { en: 'en', de: 'de', fr: 'fr' }. - Add OG image entries for the new locale.
Sitemap and hreflang
sitemap({
i18n: {
defaultLocale: 'en',
locales: { en: 'en', de: 'de' },
},
}),The integration emits <xhtml:link rel="alternate" hreflang="…"> for each localized URL automatically.
Language switcher pattern
<!-- On EN pages: link to DE version -->
<a href="/de/contact" class="text-xs font-medium no-underline">DE</a>
<!-- On DE pages: link to EN version -->
<a href="/contact" class="text-xs font-medium no-underline">EN</a>Build the href with switchLocalePath(Astro.url.pathname, otherLocale) if you want a switcher that works on any page.
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
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.

