intlayer-cli
v3.2.2
Published
IntLayer is a layer of abstraction between the business logic and the data access layer. Manage internationalization in a simple way, through TypeScript, JavaScript or JSON declaration file.
Downloads
422
Maintainers
Readme
Intlayer: Next-Level Content Management in JavaScript
Intlayer is an internationalization library designed specifically for JavaScript developers. It allow the declaration of your content everywhere in your code. It converts declaration of multilingual content into structured dictionaries to integrate easily in your code. Using TypeScript, Intlayer make your development stronger and more efficient.
Why Choose Intlayer?
- JavaScript-Powered Content Management: Harness the flexibility of JavaScript to define and manage your content efficiently.
- Type-Safe Environment: Leverage TypeScript to ensure all your content definitions are precise and error-free.
- Integrated Content Files: Keep your translations close to their respective components, enhancing maintainability and clarity.
- Simplified Setup: Get up and running quickly with minimal configuration, especially optimized for Next.js projects.
- Server Component Support: Perfectly suited for Next.js server components, ensuring smooth server-side rendering.
- Enhanced Routing: Full support for Next.js app routing, adapting seamlessly to complex application structures.
Install Package
Install the necessary packages using npm:
npm install intlayer-cli
yarn add intlayer-cli
pnpm add intlayer-cli
intlayer-cli package
intlayer-cli
package intend to transpile your intlayer declarations into dictionaries.
This package will transpile all intlayer files, such as src/**/*.content.{ts|js|mjs|cjs|json}
. See how to declare your Intlayer declaration files.
To interpret intlayer dictionaries you can interpreters, such as react-intlayer, or next-intlayer
Configuration File Support
Intlayer accepts multiple configuration file formats:
intlayer.config.ts
intlayer.config.js
intlayer.config.json
intlayer.config.cjs
intlayer.config.mjs
.intlayerrc
To see how to configure available locales, or other parameters, refer to the configuration documentation here.
Run intlayer commands
To build your dictionaries, you can run the commands:
npx intlayer build
or in watch mode
npx intlayer build --watch
Use intlayer commands in your package.json
:
"scripts": {
"transpile": "npx intlayer build",
"transpile:watch": "npx intlayer build --watch"
}