qz-l.com is Now Multilingual! π
Weβre excited to announce that qz-l.com now supports English, French, and Chinese!
Thanks to our open-source library typed-i18n, all translations are:
- Type-safe β compile-time validation prevents missing or wrong keys.
- Modular β organized by feature/page for easy maintenance and code-splitting.
- Dynamic β switch languages on the fly without page reloads.
- Lightweight β zero runtime dependencies for fast performance.
How We Did It
Using typed-i18n, we structured our translations by modules. Each locale is validated against a reference structure:
Example JSON Module
// locales/common/en.json
{
"hello": "Hello",
"goodbye": "Goodbye"
}
// locales/common/fr.json
{
"hello": "Bonjour",
"goodbye": "Au revoir"
}
Using the i18n instance
i18n.t('common.hello'); // "Hello"
i18n.setLocale('fr');
i18n.t('common.hello'); // "Bonjour"
Tip: This approach allows us to add more languages easily in the future while keeping full type safety.
Try It Out
Visit qz-l.com and use the language selector to experience the site in English, French, or Chinese.
Weβre proud to showcase our open-source library in action and make qz-l.com more accessible to a global audience. π
Links