Adding localizable strings on xcode 10.1

Metareven picture Metareven · Nov 20, 2018 · Viewed 7.5k times · Source

I have a swift app where I now want to add translations for some of the strings used in the app using NSLocalizedString.

In order to do this, I added a file named Localizable.strings to the project and pressed the "localize" button in the file inspector in order to add multiple languages to it. However only english appeared in the localization list, and I seem to be unable to add more.

Having looked around at SO and just googling around, many of the articles on how to do this mention that I should add more languages to my project under build settings. But the only setting I can change under Localization is one named "Localized String Macro Names", and there is no option to add languages there. There is also no "Use Base Internationalization" marker to check.

I have also tried to click on my project, then Editor -> Add Localization, but there all the languages are greyed out and I am unable to chose any of them.

I therefore suppose that you are supposed to do this differently in the latest version of xcode (10.1 atm). Can anyone help me figure out how you are supposed to do it?

enter image description here

Answer

Deryck Lucian picture Deryck Lucian · Nov 20, 2018

It's about the project settings. Take a look at the image:

enter image description here

Under the Localizations you add new languages. After you add the language here you select which files you want to localize.

// update

Click on the top right button shown in the screen below and select your project under the PROJECT tab.

enter image description here