Localization

 Iso country code list:

(www.iso.org/iso/country_codes.htm)


macOS/IOS Localization

1.string file is named "Localizable.strings" in the application bundle inside the appropriate localization folder

2.labels[0].text = NSLocalizedString("LABEL_ONE", comment: "The number 1")

ex:suppose we have several labels which text should be translated , a title(we call it localeLabel ) and collection of several labels

@IBOutlet var localeLabel : UILabel!

@IBOutlet var flagImageView : UIImageView!

@IBOutlet var labels : [UILabel]!


****the localization files are added automatically when you add support for each language you want to support, 

to do it click on your project in Project Navigator and select Info tab

Main.storyboard become a group in Project Navigator on left side,any XIB file also becomes a group of localized item

in fact Storyboard and XIB will be the group of localized items, underneath several folders will be created 

one folder is called Base.lproj for base language and others for each languages ex: fr.lproj , or It.lproj,....

Inside each language folder you will fine a file named "Main.string" and that's the unicode text file containing the text to translate ,


for every translation there is a file yy.xliff (ex:fr.xliff for French) , To generate it go to Editor-Export For Localization

then export , send it to translator they add a new reserved tag 

<target>xxxxx</target> where xxxx is translated text for each entry in xliff file 

 © Xosrov 2016