Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 938
Alexander Mikhaylov Avatar asked May 02 '26 14:05

Alexander Mikhaylov


1 Answers

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.

like image 189
Ignacio Inglese Avatar answered May 04 '26 05:05

Ignacio Inglese



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!