Pregunta

I'm currently using the MessageUI framework for sending SMS and Emails, but my app is in Spanish, while the MessageUI interface is in english, how can I change the button texts of the MessageUI?

¿Fue útil?

Solución

Are you sure your project is in spanish? This weekend I had this problem and it was because I had the project in english. I added spanish to the project and removed english and messageui, and other system interfaces appeared in spanish.

You may need to do a clean or even delete te app fron the device and reinstall.

To add spanish click on your project, go to localizations and click the + button and add spanish. then click on english and the - button to remove it

enter image description here

Otros consejos

You don't modify the buttons of the MessageUI interface, as normally its interface is automatically translated in the language of the user (the language set in the settings of the iPhone).

If this is not the case during your tests, this can come from multiple reasons:

  • If your try on the simulator and not on the device, I guess that simulator versions of the frameworks are lightweight versions that does not have every translated strings (whereas of course on the device all localisations are defined). Maybe try on your real device instead
  • If iOS can't find a translation for a given string for the current locale of the phone, it fallback to use the locale defined by the CFBundleDevelopmentRegion Info.plist key. Thus if the translation for your buttons are not found in spanish, it will use the english translation if your CFBundleDevelopmentRegion is set to 'en'. This explains the behavior of the previous point: on the simulator the translation does probably not exist in the framework for spanish (but should exist on the device), so it falls back to english.
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top