56 results available
Sign in
Skills directory

next-intl-add-language

github

·

Last changed
Not yet hardened

This version isn't hardened by Chainguard

No hardening report available.


SKILL.md

This is a guide to add a new language to a Next.js project using next-intl for internationalization.

Input validation (required): Before constructing any file path or inserting the language code into TypeScript source files, verify the supplied language code matches BCP 47 format: characters must be exclusively from [a-zA-Z0-9-], with no path separators (/, \), no quotes, no semicolons, and no whitespace. Reject and abort if the input does not match. Do not proceed with any file operation until this check passes.

Preflight path check (required): Before making any changes, verify that the following paths exist in the project:

  • ./messages/en.json
  • src/components/language-toggle.tsx
  • src/i18n/routing.ts
  • src/middleware.ts

If any path is missing or differs, surface the discrepancy to the user and request confirmation of the correct paths before proceeding. Do not guess or create missing directories silently.

  • For i18n, the application uses next-intl.
  • All translations are in the directory ./messages.
  • The UI component is src/components/language-toggle.tsx.
  • Routing and middleware configuration are handled in:
    • src/i18n/routing.ts
    • src/middleware.ts

When adding a new language:

  • Translate all the content of messages/en.json to the new language. The goal is to have all the JSON entries in the new language for a complete translation.
  • Add the path in routing.ts and middleware.ts.
  • Add the language to language-toggle.tsx.

Install

Need this version hardened?

Harden your own skills

Bring Chainguard's hardening pipeline to your first-party skills — custom rulesets, automated remediation, full audit trail.

Provenance

Upstream source

—

Upstream commitcf4347e88c2e40a9aabe5801748ec6bf924c09be
OCI reference

—

License

MIT

Files

HARDENING.md

LICENSE

SKILL.md


The trusted source for open source

Talk to an expert
PrivacyTerms

Product

Chainguard ContainersChainguard LibrariesChainguard VMsChainguard OS PackagesChainguard ActionsChainguard Agent SkillsIntegrationsPricing
© 2026 Chainguard, Inc. All Rights Reserved.
Chainguard® and the Chainguard logo are registered trademarks of Chainguard, Inc. in the United States and/or other countries.
The other respective trademarks mentioned on this page are owned by the respective companies and use of them does not imply any affiliation or endorsement.