In this recipe, we will create an app that will support two different languages.
Create a new Single View Application in Xamarin Studio and name it MultipleLanguageApp
.
Perform the following steps:
Add two labels on the view of
MultipleLanguageAppViewController
.Add two folders to the project. Name them
en.lproj
andes.lproj
, respectively.Add a plain text file in the
en.lproj
folder and name itLocalizable.strings
. Enter the following in the file and save it:// Localized output on MultipleLanguageAppViewController "Have a nice day!" = "Have a nice day!";
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!";
Enter the following code in the
MultipleLanguageAppViewController
class:public override void ViewWillAppear (bool animated) {...