Alexander Mikhaylov
Alexander Mikhaylov

Reputation: 1800

Interface language in MFMessageComposeViewController

I'm trying to send sms from my iphone using MFMessageComposeViewController. It shows a modal dialog with filled fields. everything work, but I want to show dialog in Russian Language. I want to see all values (such as "New message", "send", etc) in Russian.

I'v checked default language:

NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
NSArray *languages = [defaults objectForKey:@"AppleLanguages"];
NSString *currentLanguage = [languages objectAtIndex:0];

NSLog(@"Current Locale: %@", [[NSLocale currentLocale] localeIdentifier]);
NSLog(@"Current language: %@", currentLanguage);

And it returns, that language is ru-RU.

How can I set a lang for this dialog?

Upvotes: 3

Views: 577

Answers (1)

Ignacio Inglese
Ignacio Inglese

Reputation: 2605

You need to localize your app for Russian in order for it to show the localized controls you ask for.

All you should need to do is add a ru.lproj folder to your project (you could include here a Localizable.strings file if needed by your app) to let know Xcode that you are actively supporting that language.

For every language you add as language-code.lproj, every native control (MFMessageComposeViewController, MFMailComposeViewController) should consider using that language if set as local on the device.

Upvotes: 3

Related Questions