iOS Localization: Add International Language Support To Your Swift App

In this blog post I am going to share with you how to add an international language support to your iOS App.

In this blog post I will cover how to:

  • Localize App’s Main.storyboard
  • Localize App’s resources like images
  • Localize user-facing that can be displayed to a user by your app.

Localize App’s Main.storyboard

In this video you will learn how to:

  • Add localization support to your iOS Swift App and it’s Main.storyboard,
  • How to quickly preview user interface in a different language while designing user interface and,
  • How to run application on iOS Simulator with support for different Application Language or Application Region,
  • We will also briefly cover how to export iOS App for Localization and how to import translated app file(.xliff) back into Xcode.

Localize iOS Swift App Resources Like Images

Same approach can be used to localize local app resources like sound files or video files


Localize iOS App User-facing Text Messages with NSLocalizedString Function in Swift

Learn how to localize iOS App text messages that are displayed to user. For example in this video we will localize UIAlertController Title and the main text displayed to a user. We will use NSLocalizedString to read localized text from Localizable.strings. Under this video I will post a show cod snipped of Swift code used in this video.

    @IBAction func runButtonTapped(sender: AnyObject) {
        
        let successMessage = NSLocalizedString("signUpPage.SuccessMessage", comment: "A success message user will see when sign up is successful.")
        
        let alertTitle = NSLocalizedString("signUpPage.SuccessAlertWindowTitle", comment: "Alert message title")
        
        let myAlert = UIAlertController(title: alertTitle, message: successMessage, preferredStyle: UIAlertControllerStyle.Alert)
        
        let okAction = UIAlertAction(title: "Ok", style: UIAlertActionStyle.Default, handler: nil)
        
        myAlert.addAction(okAction)
        
        self.presentViewController(myAlert, animated: true, completion: nil)
        
    }

You can download source code of Xcode project used in these videos from this github url:

https://github.com/simplyi/ios-app-localization.git

I hope these videos are of some value to you! 🙂

Happy learning!

  • César Palma

    Excelent information, thanks!

  • Juan Carlos

    Great, thanks!!

  • Jônatas

    Awesome! Keep the great work.

  • iKhalil

    Hi! Excellent tutorial.

    I have a doubt, how can I add another language just like an indigenous one, is it possible?

  • Sam

    Does add an international language apply for any RTL language
    as soon it apply would worked with any project or i have to repeat the steps every time?