All skills
sergiodxa avatar

/frontend-internationalization-best-practices

@6eae8fd

Internationalization best practices for React Router framework mode using remix-i18next. Use when setting up locales, middleware, resource routes, or language switching.

Use this Skill: https://skilld.dev/gh/sergiodxa/agent-skills/frontend-internationalization-best-practices

This session only. Nothing lands on disk.

ruleslocales-structure.md

≈357 tokens on demand. Your agent reads this file only when SKILL.md points to it.

Structure Locales by Language

Organize translations under app/locales/{lng} and re-export them in a single resource map.

Why

  • Keeps locale resources explicit and discoverable
  • Enables type-safe parity checks between languages
  • Makes server and client loaders consistent

Pattern

// app/locales/en/translation.ts
export default {
  title: "Example",
  description: "A React Router + remix-i18next example",
};

// app/locales/en/index.ts
import type { ResourceLanguage } from "i18next";
import translation from "./translation";

export default { translation } satisfies ResourceLanguage;
// app/locales/es/translation.ts
export default {
  title: "Ejemplo",
  description: "Un ejemplo de React Router + remix-i18next",
} satisfies typeof import("~/locales/en/translation").default;

// app/locales/es/index.ts
import type { ResourceLanguage } from "i18next";
import translation from "./translation";

export default { translation } satisfies ResourceLanguage;
// app/locales/index.ts
import type { Resource } from "i18next";
import en from "./en";
import es from "./es";

export default { en, es } satisfies Resource;

Rules

  1. Keep en as the default source of truth for keys
  2. Use satisfies to enforce parity between locales
  3. Export a single resources object for middleware

Source: SKILL.md on GitHub

1 warning8d5 checks · Risk SAFE
  • Gen Agent Trust Hub8d

    The skill provides guidelines and patterns for implementing internationalization in React Router applications using remix-i18next. It demonstrates secure practices such as using Zod for input validation in resource routes to prevent directory traversal or arbitrary data access, and correctly configuring secure cookies for locale persistence. No security issues were identified.

  • Socket8d

    No alerts

  • Snyk8d

    Risk: LOW · No issues

  • Runlayer7mo

    12/12 files flagged

  • ZeroLeaks5mo

    Score: 93/100 · 2 sections analyzed

Signed by skilld at 6eae8fd. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 2 months ago.

Dormantupdated 8 months ago

README badge

README badge for sergiodxa/agent-skills/frontend-internationalization-best-practices