Supported frameworks
Polygot is still in its early stages. New framework compatibilities will be added soon. However, it is possible to integrate Polygot into a wide variety of projects due to its compatibility with JSON.
JSON
In order to integrate Polygot to your product, you can use JSON locale files.
Each file must contain phrases from only one language (ex: en.json for english phrases, fr.json for french phrases, ...).
Example 1 (one file per locale):
{
"title": "My application",
"home": {
"header": "The best app",
"CTA": "Start now!"
}
}
Example 2 (one directory per locale):
{
"title": "My application"
}
JavaScript
Polygot supports JavaScript locale files, if they follow a specific format. Using JavaScript files can be interesting in particular to be able to easily import them into another JavaScript file.
Using JavaScript files will also allow you to add comments to your phrases. These comments will be retained when pulling the source or translated files.
Polygot supports both CommonJS and ESM formats, provided that you use the format as shown below:
module.exports = {
"title": "My application",
"home": {
// You can use comments within the exported object
"header": "The best app",
"CTA": "Start now!"
}
}
Frameworks
Here is a non-exhaustive list of frameworks and libraries compatible with Polygot. Generally speaking, Polygot will easily integrate with your programming language/library/custom tool if you use JSON files to store your locales.
Framework | Libraries |
---|---|
Deno | - T-i18n - i18next + i18nextMiddleware + i18next-fs-backend |
Express.js | - i18next + i18nextMiddleware + i18next-fs-backend - i18n-express |
Gatsby | - react-i18next - FormatJS |
Next.js | - next-i18next - FormatJS |
Nuxt.js | Nuxt i18n module |
React | react-i18next |
SolidJS | SolidJS i18n primitive |
Svelte | - svelte-i18n - svelte-i18next |
Vue.js | - vue-i18n - i18next-vue |