Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to make Cocoa understand that my iPhone app isn't in English?

I work on an iPhone app that is purely in Swedish and it will never be localized to any other languages. All the strings in the app is in Swedish, so we don't even have Localizable.strings.

The problem is that the strings generated by Cocoa (such as Done and Edit) are in English. I've tried setting Localization native development region in the Info.plist to Swedish, but that changed nothing. It shouldn't be harder than that to tell Cocoa that my app is in Swedish, but obviously it is.

I've also tried a bunch of other stuff without any luck. So what do I need to do to make Cocoa localize its strings to Swedish?

like image 675
Erik B Avatar asked Oct 24 '22 02:10

Erik B


1 Answers

The strings generated by Cocoa (such as Done and Edit) are in English because your iPhone language settings are set to English (in Settings -> General -> International -> Language ). If you set the language settings to Swedish you should see the texts in Swedish.

This is how the iPhone works by default, if you want to change the texts of some buttons to force them to Swedish you will have to create an outlet of them and change the text manually. For example like this UIBarButtonItem (with a default text Done (in english)):

UIBarButtonItem *doneButton = [[[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemDone target:self action:@selector(doneContact)] autorelease];
doneButton.title =@"Whatever";
self.navigationItem.rightBarButtonItem = doneButton;

I hope that this may help you...

like image 67
Carles Estevadeordal Avatar answered Oct 27 '22 01:10

Carles Estevadeordal