Overview
The astro-nanointl package brings a compact and effective solution for integrating internationalization (i18n) in your Astro projects. With a lightweight design, it accommodates both Static Site Generation (SSG) and Server-Side Rendering (SSR), making it a versatile choice for various project strategies. Users can easily manage multilingual support and streamline the localization process without compromising on flexibility.
This tool, designed with a focus on efficiency, allows developers to define their translations either in the file system, through Content Collections, or even fetch them from remote sources. With its emphasis on a clean and intuitive setup, astro-nanointl ensures seamless development experiences while navigating the complexities of internationalization.
Features
Strategy-Agnostic: Supports both Static Site Generation and Server-Side Rendering, allowing you to choose the best strategy for your project deployment.
Current Locale Retrieval: Easily access the current locale through the built-in
currentLocaleproperty from the Astro global, simplifying the localization process.Flexible Translation Storage: Store your translations wherever you prefer—whether in your file system, Content Collections, or remote sources—granting you maximum flexibility.
Schema Matching: Ensure translations match the declared schema within your source code to facilitate a smoother localization process and avoid runtime issues.
Use of Translations Hook: Leverage the
useTranslationsfunction to simplify localization, accommodating a translation schema and data as arguments for streamlined integration.Parametrization and Pluralization: Enhance your translations with built-in transformers for advanced localization needs, allowing for dynamic responses based on parameters and plural forms.
Advanced routing capabilities: While the package doesn’t manage routing directly, it provides an abstraction layer to effectively integrate i18n with your routing setup.