Installation
WARNING
We recommend scaffolding your project with your favorite web framework before installing Psitta, followed by integrating it with a Web framework for a seamless experience.
NOTE
Psitta is an ESM-only package. Don't use require()
to import it, and make sure your nearest package.json
contains "type": "module"
, or change the file extension of your relevant files to .mjs/.mts
. Refer to Vite's troubleshooting guide for more details. Also, inside async CJS contexts, you can use await import('@psitta/core')
instead.
Prerequisites
Ensure that you have the following prerequisites:
- Node.js installed on your development environment
- Your preferred IDE (Visual Studio Code is recommended)
Official Web Framework Integration
Psitta provides official integrations for Vue and React. These integrations offer features such as locale state management, a versatile component for localizing content with slots, hooks/composables for easy localization, and more.
$ pnpm add @psitta/core @psitta/{framework}
$ npm install @psitta/core @psitta/{framework}
$ yarn add @psitta/core @psitta/{framework}
$ bun install @psitta/core @psitta/{framework}
After installation, proceed to the Configure Guide to set up Psitta for your project.
Your Own Integration advanced
If you prefer manual setup or are not using a Web framework, you can install Psitta directly in your project using one of the following package managers:
$ pnpm install @psitta/core
$ npm install @psitta/core
$ yarn install @psitta/core
$ bun install @psitta/core
After installing Psitta Core, you can implement locale state management, localization functions, locale detection, and more according to your project's needs. Psitta Core includes utilities for implementing i18n. Here are some useful reference links for implementing your integration:
- Localization API Reference: Contains utilities for localizing messages or URLs.
- Detection API Reference: Provides utilities for detecting the user's locale.
- Format API Reference: API for formatting strings or segments. It also includes a reference for interpolation and declension.
- Library Reference: Details of other integration implementations and their usage, which can serve as a base for your integration.