Adding localizable strings on xcode 10.1

11.6k Views Asked by At

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

2

There are 2 best solutions below

1
On BEST ANSWER

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

0
On

You just selected the wrong settings. The picture that you attached is actually under TARGET settings -> Build Settings, rather than project settings.

See the picture below to select "project settings" under xcode 10:

Xcode 10, project settings

enter image description here