I18n
The SwiftUI-based iOS boilerplate includes robust internationalization (i18n) capabilities, supporting multiple languages including FR (French), DE (German), TR (Turkish), EN (English), and ES (Spanish). Localization has been seamlessly integrated across all pages using a string catalog, ensuring a user-friendly experience for a diverse audience.
Features
- 🌐 Language Switching: Users can easily switch between supported languages, allowing for a personalized app experience. The app automatically updates the UI language based on user preferences.
- 📝 String Catalog Management: All text strings are organized within a centralized catalog, making it simple for developers to manage translations and ensure consistency across the app.
- 📱 Seamless Integration: Localization is deeply integrated into the app's architecture, allowing for straightforward updates and additions of new languages in the future.
- 🔄 Dynamic Content: All UI components, including labels, buttons, and alerts, are dynamically loaded based on the selected language, ensuring a coherent and localized experience.
Screenshots
Localization Examples
Here are examples of localized strings in five different languages:
English (EN)
"welcome_message" = "Welcome to our app!";
"goodbye_message" = "Thank you for using our app!";
Turkish (TR)
"welcome_message" = "Uygulamamıza hoş geldiniz!";
"goodbye_message" = "Uygulamamızı kullandığınız için teşekkürler!";
French (FR)
"welcome_message" = "Bienvenue dans notre application !";
"goodbye_message" = "Merci d'utiliser notre application !";
German (DE)
"welcome_message" = "Willkommen in unserer App!";
"goodbye_message" = "Danke, dass Sie unsere App nutzen!";
Spanish (ES)
"welcome_message" = "¡Bienvenido a nuestra aplicación!";
"goodbye_message" = "¡Gracias por usar nuestra aplicación!";
How to Implement Localization
-
Add Language Support:
- In Xcode, go to your project settings.
- Under the Info tab, add the desired languages to the Localizations section.
-
Create String Catalogs:
- Create a Localizable.strings file for each language.
- Populate each file with the relevant translations.
-
Use Localized Strings in SwiftUI:
- Access localized strings using
Text("welcome_message")
within your SwiftUI views, ensuring that the correct language string is displayed based on the user's settings.
- Access localized strings using