Swift 3 / Xcode 8 - How to change the native language of my App?

4

I'm finalizing an application and I could not help noticing that some components of my app are in English:

How to change the native language of the app?
How to make it change automatically according to the language of my device?

    
asked by anonymous 17.03.2017 / 23:08

2 answers

4

To do this, you should use add Portuguese as a language in your project.

By default, the base language is English. To add another language, go to:

  • Accessyour.xcodeproject;
  • Intheupperleftcorner,chooseyourprojectinsteadofyourtarget;
  • Under"Localizations," add the language in question.
  • In doing so, Xcode gives you the option of translating all the documents in your project (applicable, usually .string, .xib, and .storyboard).

    If you add a file after configuring the new language and want to include it in Localizations also, you should access:

  • Click "Locate ..."
  • Add the missing language.
  • If you are using Portuguese as the language on your device, this will cause iOS to "translate" system components into your application.

    To learn more about Internationalization , here's a very good tutorial from Ray Wenderlich: link

        
    21.03.2017 / 11:57
    3

    To change only the base language, go to the folder where your project is located and open the contents of the project package: Thenopentheproject.pbxprojfilewiththeTextEditor.Afterthat,giveCommand+Fandsearchfor"English". It's now easy, just change English to Portuguese and to pt :

        
    25.03.2017 / 04:06