Change language in the app. Simple approach to localize strings/images. Written in Swift.
All logic is in Localizable.swift file.
Just copy this file to your project.
Recommendation: do not localize storyboards or xibs. Make it simpler. Put all your localized strings in Localizable.strings file.
Reproduce step 2 for needed languages.
Recommendation: do not localize storyboards/xibs. Always set strings from code.
Extend enum Language with appropriate languages used in the project
enum Language: String {
case english = "en"
case arabic = "ar"
case ukrainian = "uk"
//...
"main_page_language".localized
"flag".localizedImage
To change language just set Language case to Language.language static property.
It will change app language and semantic if need.
To enable changes it will restart the app within instantiating initial view controller from Main storyboard.
Language.language = Language.english
Roman Sorochak - iOS developer - [email protected]
Localizable is released under the MIT license. See LICENSE for details.