--- createdAt: 2025-04-18 updatedAt: 2026-10-08 priority: 9 title: "Vite + Preact i18n - Complete guide to translate your app" description: "Set up Intlayer in a Vite and Preact app: typed per-component content, a locale switcher, localized routes and small bundles." keywords: - Internationalization - Documentation - Intlayer - Vite - Preact - JavaScript slugs: - doc - environment - vite-and-preact applicationTemplate: https://github.com/aymericzip/intlayer-vite-preact-template applicationShowcase: https://intlayer-vite-preact-template.vercel.app history: - version: 8.9.0 date: 2026-05-04 changes: "Update Solid useIntlayer API usage to direct property access" - version: 7.5.9 date: 2025-12-30 changes: "Add init command" - version: 7.0.0 date: 2025-10-28 changes: "Update LocaleRouter component to use new route configuration" - version: 5.5.10 date: 2025-06-29 changes: "Initial history" author: aymericzip --- # Translate your Vite and Preact website using Intlayer ## Table of Contents ## Why Intlayer over alternatives? Compared to main solutions like `preact-i18n` or `i18next`, Intlayer is a solution that comes with integrated optimizations such as: Intlayer is optimized to work perfectly with Preact by offering **component-level content scoping**, **lazy-loaded translations**, and all the features needed for scaling internationalization (i18n). Instead of loading massive JSON files into your pages, load only the necessary content. Intlayer helps **reduce your bundle and page sizes by up to 50%**. Scoping your application's content **facilitates maintenance** for large-scale applications. You can duplicate or delete a single feature folder without the mental burden of reviewing your entire content codebase. Additionally, Intlayer is **fully typed** to ensure your content's accuracy. Co-locating content **reduces the context needed** by Large Language Models (LLMs). Intlayer also comes with a suite of tools, such as a **CLI** to test for missing translations,**[LSP](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en/lsp.md)**, **[MCP](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en/mcp_server.md)**, and **[agent skills](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en/agent_skills.md)**, to make the developer experience (DX) even smoother for AI agents. - [LSP](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en/lsp.md) - [MCP](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en/mcp_server.md) - [agent skills](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en/agent_skills.md) Use automation to translate in your CI/CD pipeline using the LLM of your choice at the cost of your AI provider. Intlayer also offers a **compiler** to automate content extraction, as well as a [web platform](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en/intlayer_CMS.md) to help **translate in the background**. - [web platform](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en/intlayer_CMS.md) Connecting massive JSON files to components can lead to performance and reactivity issues. Intlayer optimizes your content loading at build time. More than just an i18n solution, Intlayer provides an **self-hosted [visual editor](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en/intlayer_visual_editor.md)** and a **[full CMS](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en/intlayer_CMS.md)** to help you manage your multilingual content in **real-time**, making collaboration with translators, copywriters, and other team members seamless. Content can be stored locally and/or remotely. - [visual editor](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en/intlayer_visual_editor.md) - [full CMS](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en/intlayer_CMS.md) ## Step-by-Step Guide to Set Up Intlayer in a Vite and Preact Application