1 unstable release
0.1.3 | Dec 30, 2024 |
---|
#964 in Science
123 downloads per month
25KB
196 lines
🎬 Demo
Framework | Live Demo |
---|---|
Yew | |
Dioxus | TODO |
Leptos | TODO |
📜 Intro
i18nrs is a lightweight and powerful internationalization library for Wasm-based frameworks like Yew, Dioxus, and Leptos. It provides seamless tools to manage translations, change languages, and localize your applications.
🤔 Why Use i18nrs?
The following features make i18nrs a must-have for your Wasm-based projects:
- 🌐 Multi-Language Support: Effortlessly support multiple languages in your application with a flexible configuration system.
- 📦 Easy Integration: Simple setup and integration with Wasm frameworks like Yew, Dioxus, and Leptos.
- 🔄 Dynamic Language Switching: Change languages on the fly and persist the selection using
LocalStorage
orSessionStorage
. - ⚙️ JSON-Based Translations: Load translations from JSON files with full validation.
- 🗝️ Nested Key Translation: Use nested keys like
menu.file.open
for organized and structured translations.
🛠️ Features
- Configuration Management: Centralized configuration for languages and translation data.
- Browser Storage Support: Store and retrieve the selected language using
LocalStorage
orSessionStorage
. - Fallback System: Automatically falls back to the default language if a key is missing.
- Advanced Key Resolution: Supports dot-separated keys for nested translations (e.g.,
settings.profile.name
).
📚 Yew Usage
Refer to our guide for integrating i18nrs with your Yew app.
🧬 Dioxus Usage (TODO)
Refer to our guide for integrating i18nrs with your Dioxus app.
🌱 Leptos Usage (TODO)
Refer to our guide for integrating i18nrs with your Leptos app.
🤝 Contributions
Contributions are welcome! Whether it's bug fixes, feature requests, or adding support for new frameworks, we would love your help to make i18nrs better.
- Fork the repository.
- Create a new branch for your feature/bugfix.
- Submit a pull request for review.
📜 License
i18nrs is licensed under the MIT License. You are free to use, modify, and distribute this library in your projects.
Dependencies
~8–17MB
~226K SLoC