Good Evening,
I have been working on localization and was moving around various samples.
Thought i should write one too....
May be it helps someone ;)
Trying to write a simpler one in just 5 steps......
Step : One
Create a new Project in Xcode. In our case its a "Single View Application"
I have been working on localization and was moving around various samples.
Thought i should write one too....
May be it helps someone ;)
Trying to write a simpler one in just 5 steps......
Step : One
Create a new Project in Xcode. In our case its a "Single View Application"
Now save project as :
Step : Two
Now before going to User Interface part lets add the localization files for different languages.
We will be using English (default) and French
Right click on the project name >> Add New File >> Resource >> Strings File and then do as shown :
Name this file as "Localizable.strings"
Step : Three
By default it accepts English so we need to add another file for French like this:
Click on the Localizable.string file and open "File Inspector"
GoTo Localization section
Click "+" symbol
You can see a list of Apple Languages like this :
Select French from above list . It appears in grey after selection.
Below Image shows how it looks after french gets added up in localization languages for the app.
And after addition you can see files here also:
Step : Four
Contents that we write in these localization file:
Step : Five
Now lets work on UI.
We will add four labels on the view of ViewController and display the contents on it that gets changed as we change the language.
Below image will show how the IBOutlets are connected.
Now whenever you change the language from settings you will see the change is reflected in the app.
The contents get changed :)
How the output appears:
Hope it helps :)
Enjoy coding...........
thank you very much
ReplyDeleteit is very useful