0
subjectLabel.text = NSLocalizedString(@"Kind Information", @"Info Label");

or

message.text= NSLocalizedString(@"Something Message",nil);

which is the correct one and what is the difference between these 2 examples?

1 Answers1

1

The correct way is

 subjectLabel.text = NSLocalizedString(@"Kind Information", @"Info Label");

enter image description here

Shehata Gamal
  • 98,760
  • 8
  • 65
  • 87
  • see red icon it's a clarifying comment above the pair in the key-value strings file – Shehata Gamal Feb 15 '18 at 07:48
  • can you tell me one small thing? Suppose I am using Japanese and Chinese language, and I am writing code in English then what will be sample example. I understood how to create and write localization file with key and value. I want to know how to write in Xcode like subjectLabel.text = NSLocalizedString(@"Click Button", @"Action"); how to write ? – Mallikarjun Hanagandi Feb 15 '18 at 07:51
  • I'm suffering understanding what u want drag the label as IBoutlet and assign the localized string to it in viewDidLoad , if this what u mean – Shehata Gamal Feb 15 '18 at 07:57
  • What I want is that, whatever the static names of labels and button are there that names are I want to make localizable. – Mallikarjun Hanagandi Feb 15 '18 at 08:01
  • you can't localize IBOutlets and function names , coding is in English it's separate from the fact that you want to localize the app to multiple languages – Shehata Gamal Feb 15 '18 at 08:06