Introduction
Introduction to Localization & Internationalization
Welcome to the Localization & Internationalization guide for Glow Up! In a globalized world, creating applications that support multiple languages and cultures is essential. At Glow Up, we use i18next, a robust and flexible internationalization framework, to ensure our application provides a seamless experience for users worldwide.
Why Localization Matters
Localization (i18n) is more than just translating words—it’s about adapting your application to meet the cultural and linguistic needs of your users. This includes translating text, formatting dates and numbers, handling pluralization, and considering different cultural contexts.
Tools We Use
At Glow Up, our internationalization setup relies on:
- i18next: Our main internationalization library, providing features for translations, pluralization, and more.
- Svelte: Our front-end framework, which integrates seamlessly with i18next to handle translations dynamically.
- Intl API: Used for formatting dates, numbers, and currencies according to the user’s locale.
Key Concepts
- Translation Keys: We use a hierarchical structure for translation keys, grouped by page or feature, and follow the
snake_casenaming convention for consistency. - Variables in Translations: Dynamic content like user names or dates is embedded using variables, enclosed in curly braces
{}. - Fallback Strategy: When a translation is unavailable in the user’s language, we default to
en_USto ensure a smooth experience. - Security: Special characters are escaped to prevent XSS attacks, and we use best practices to secure all user-generated content.
How to Get Started
- Explore the Rules and Guidelines: Check out our Translation Rules for naming conventions and best practices.
- Review Variables: See the Translation Variables section for details on using dynamic content in your strings.
- Understand the Fallback Strategy: Learn how we manage fallback languages and handle missing translations in our Fallback Strategy.