Book Image

iOS Development with Xamarin Cookbook

By : Dimitrios Tavlikos (USD)
Book Image

iOS Development with Xamarin Cookbook

By: Dimitrios Tavlikos (USD)

Overview of this book

Table of Contents (22 chapters)
iOS Development with Xamarin Cookbook
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Creating an app for different languages


In this recipe, we will create an app that will support two different languages.

Getting ready

Create a new Single View Application in Xamarin Studio and name it MultipleLanguageApp.

How to do it...

Perform the following steps:

  1. Add two labels on the view of MultipleLanguageAppViewController.

  2. Add two folders to the project. Name them en.lproj and es.lproj, respectively.

  3. Add a plain text file in the en.lproj folder and name it Localizable.strings. Enter the following in the file and save it:

    // Localized output on MultipleLanguageAppViewController
    "Have a nice day!" = "Have a nice day!";
  4. Add another plain text file in the es.lproj folder and name it the same as before: Localizable.strings. Enter the following in the file and save it:

    // Localized output on MultipleLanguageAppViewController
    "Have a nice day!" = "¡Qué tenga un buen día!";
  5. Enter the following code in the MultipleLanguageAppViewController class:

    public override void ViewWillAppear (bool animated)
    {...