i18n-multi-language
Skill10 starsChanged 6 months agoMITView on GitHub
Use when adding multi-language support, translations, locale switching, date/number formatting, or RTL layout. Not for single-language apps unless preparing for i18n later.
In this repository56 other files it gives its agents.
- accessibility-passSkill
- analytics-eventsSkill
- api-error-handlingSkill
- audit-logging-backendSkill
- background-jobs-and-cronSkill
- dark-mode-and-themingSkill
- dashboard-charts-rechartsSkill
- edge-functions-and-webhooksSkill
- email-and-notificationsSkill
- error-states-and-empty-uiSkill
- feature-flags-and-togglesSkill
- file-upload-storageSkill
- lovable-prompting-playbookSkill
- lovable-ship-checklistSkill
- migration-playbookSkill
- multi-tenant-backendSkill
- onboarding-copySkill
- optimistic-updatesSkill
- payment-failed-and-recoverySkill
- payment-webhook-idempotencySkill
- payment-webhook-testingSkill
- performance-budgetSkill
- pg-cron-recipesSkill
- pg-cron-scheduled-jobsSkill
- pg-cron-with-pg-net-edgeSkill
- postgres-full-text-searchSkill
- postgres-triggers-and-functionsSkill
- pricing-and-billingSkill
- programmatic-seo-content-qualitySkill
- programmatic-seo-pagesSkill
- rate-limiting-edgeSkill
- realtime-and-subscriptionsSkill
- refactor-safe-diffSkill
- release-notesSkill
- seo-core-web-vitalsSkill
- seo-landing-pageSkill
- seo-meta-tags-spaSkill
- seo-sitemap-generationSkill
- seo-ssr-and-prerenderingSkill
- seo-structured-dataSkill
- server-input-validationSkill
- shadcn-patternsSkill
- soft-delete-and-archivingSkill
- stripe-one-time-payment-webhooksSkill
- stripe-payment-webhooksSkill
- supabase-auth-flowsSkill
- supabase-database-designSkill
- supabase-rls-and-authSkill
- support-replySkill
- tanstack-infinite-queriesSkill
- tanstack-mutations-and-invalidationSkill
- tanstack-prefetch-and-hydrationSkill
- tanstack-query-alternativeSkill
- tanstack-router-data-loadersSkill
- tanstack-start-server-routesSkill
- typed-api-hooks-formsSkill
The file
We split this skill into the rules it gives an agent
4 rules. About 0 are common, 1 is distinctive, and 3 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 11
Use i18next (react-i18next) for strings.
- Very specific: line 76
Never concatenate "$" + amount or hand-format dates.
- Very specific: line 85
Use Tailwind logical properties (ps-4 / pe-4 instead of pl-4 / pr-4).
- Distinctive: line 86
Test layout in Arabic/Hebrew at least once.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
i18n multi-language
Use i18next (react-i18next) for strings; Intl for dates, numbers, and currency.
Setup
src/
i18n/
index.ts # i18next init
locales/
en/common.json
es/common.json// src/i18n/index.ts
import i18n from "i18next";
import { initReactI18next } from "react-i18next";
import en from "./locales/en/common.json";
import es from "./locales/es/common.json";
i18n.use(initReactI18next).init({
resources: { en: { common: en }, es: { common: es } },
lng: localStorage.getItem("lang") ?? navigator.language.split("-")[0] ?? "en",
fallbackLng: "en",
defaultNS: "common",
interpolation: { escapeValue: false },
});Usage
const { t } = useTranslation();
<h1>{t("dashboard.title")}</h1>
<p>{t("welcome", { name: user.name })}</p>JSON:
{
"dashboard": { "title": "Dashboard" },
"welcome": "Welcome, {{name}}"
}Pluralization
{ "items_one": "{{count}} item", "items_other": "{{count}} items" }t("items", { count });Dates, numbers, currency — use Intl
new Intl.DateTimeFormat(locale, { dateStyle: "medium" }).format(date);
new Intl.NumberFormat(locale, { style: "currency", currency: "USD" }).format(amount / 100);
new Intl.RelativeTimeFormat(locale, { numeric: "auto" }).format(-3, "day");Never concatenate "$" + amount or hand-format dates.
Locale switcher
- Persist the chosen locale (user profile or localStorage).
- Set
<html lang={locale}>and (if RTL)dir="rtl".
RTL support
- Use Tailwind logical properties (
ps-4/pe-4instead ofpl-4/pr-4). - Test layout in Arabic/Hebrew at least once.
DB content
For user-generated multi-language content, store one row per locale or a JSON column keyed by locale code. Do not concat languages into one column.
Avoid
- Hardcoded strings in JSX once i18n is enabled — every visible string goes through
t(). - Concatenating translated fragments (
t("welcome") + " " + name) — use interpolation. - Translating error codes — translate user-facing messages, not stable
errorslugs. - Shipping with a single language but i18next scaffolding that nobody owns — pick a path.
Checklist
- All visible copy uses
t(). Intlfor dates / numbers / currency.<html lang>reflects current locale.- RTL tested if supporting Arabic/Hebrew.
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.

