Website i18n

From macalbert/envilder · View interactive version

Website i18n is an AI agent skill from the GitHub repository macalbert/envilder. Envilder website internationalization workflow. Use when adding, editing, or reviewing translated strings, creating localized pages, or verifying i18n completeness. Covers the full lifecycle from type definition to locale files.

How to use this skill

Skill file

Website i18n

Every user-visible string on the Envilder website MUST go through the i18n

system. Never hardcode text in components.

When to Use

File Locations

| What | Where |

|------|-------|

| Translation types | src/website/src/i18n/types.ts |

| Locale files | src/website/src/i18n/{en,ca,es}.ts (one per locale) |

| i18n utilities | src/website/src/i18n/utils.ts |

| Astro i18n config | src/website/astro.config.mjs → i18n.locales |

| Pages (default locale) | src/website/src/pages/*.astro |

| Pages (other locales) | src/website/src/pages/<locale>/*.astro |

Adding New Translations: 4-Step Workflow

1. Define the type

Add the new key structure in src/website/src/i18n/types.ts:

// In the Translations interface
section: {
  title: string;
  description: string;
};

2. Add strings to every locale file

Update all locale files in src/website/src/i18n/:

TypeScript will error if any locale is missing a key defined in types.ts.

3. Use in component

Access translations via the useTranslations helper:

---
import { useTranslations } from '../i18n/utils';
const { lang = 'en' } = Astro.props;
const t = useTranslations(lang);
---
<h2>{t.section.title}</h2>
<p>{t.section.description}</p>

4. Create localized pages

For new pages:

Check astro.config.mjs → i18n.locales to discover all active locales.

Terms That MUST NOT Be Translated

Product names, CLI flags, code tokens, and acronyms stay in English:

envilder, AWS SSM, Azure Key Vault, GitHub Action, envilder.json,

.env, --map, --envfile, envilder exec, --provider, --push, CI/CD, IAM,

RBAC, CLI, API, JSON, YAML, Node.js, pnpm, npx

Constraints

globals from astro.config.mjs

without updating all references

Verification

After adding translations:

  1. TypeScript compilation catches missing keys (tsc --noEmit or dev server)
  2. Navigate to each locale in dev server to verify text renders
  3. Optionally delegate to @i18n Reviewer for linguistic quality check
Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.