Getting Started the declaration of your content
Files extensions
By default, Intlayer watches all files with the following extensions for content declarations:
- .content.ts
- .content.tsx
- .content.js
- .content.mjs
- .content.cjs
The application will search for files that match the ./src/**/*.content.{ts,tsx,js,jsx,mjs,cjs} glob pattern by default.
These default extensions are suitable for most applications. However, if you have specific requirements, refer to the content extension customization guide for instructions on how to manage them.
For a full list of configuration options, visit the configuration documentation.
Declare Your Content
Create and manage your content dictionaries:
src/app/[locale]/page.content.ts
import { t, enu, type DeclarationContent } from "intlayer";interface Content { getStarted: { main: string; pageLink: string; }; numberOfCar: string;}export default { key: "page", content: { getStarted: { main: t({ en: "Get started by editing", fr: "Commencez par éditer", es: "Comience por editar", }), pageLink: "src/app/page.tsx", }, numberOfCar: enu({ "<-1": "Less than minus one car", "-1": "Minus one car", "0": "No cars", "1": "One car", ">5": "Some cars", ">19": "Many cars", }), },} satisfies DeclarationContent<Content>;
If you have an idea for improving this documentation, please feel free to contribute by submitting a pull request on GitHub.
GitHub link to the documentation