Go to project-> New Files-> Resource-> String File-> Save as Localizable.string
now
Now go on to setting up the project again ... then select the project instead of the goal in the setting ... Where you have only two options ... Go to the information section where you will find localization ... add your language here for localization.
the created file is already in the basic internationalization mode ... now go to the file and right-click the localization button in the sidebar ... click on it and select the language that you added to your project.
- now this file adds a drop-down menu in it .. click on the arrow ... which will show you the localized .string file now the first is basic English ... which is the default and second localized string file ...
- copy all the text you print in both files as follows
Base file-> "Enter a search keyword" = "Enter a search keyword"; Localize file → "Enter the search keyword" = "Localized string";
now, to use this localized string, you can get strings like this
label.text = NSLocalizedString("your String",nil);
Note. The string file should have the name "Localizable" ... if you do not save it with that name ... this will not work .. and you must provide a path every time you use a localized string
source share