default language, add localizations

Hi all, I'trying to manage with Xcode 11.4. Is it possible to add French language in localization settings? When my project is selected there isn't any language or localizations in general settings and in the editor tab Add Localization displays all the languages french, arabic... but the menu items are greyed out and not accessible for the current displayed source.

Thank you.

Thierry

Answered by Claude31 in 415550022

Yes, XCode is only english.


It's harder for chinese people than for french !


If you have no storyboard, then you have all text created in code.

Then you need to use NSLocalized as here:


let ac = UIAlertController(title: NSLocalizedString("Operation Impossible", comment: "Scan failed"),

message: NSLocalizedString("This device cannot scan QR code ", comment: "Scan failed"),

preferredStyle: .alert)


Then, you will have to create files : Localizable.strings


I explain how to do in my doc.


If that's OK, don't forget to close the thread.

Of course it is possible. Coulmd you detail the steps you follow ?


When my project is selected

You mean you select project in XCode file browse. Correct ?


there isn't any language or localizations in general settings

You selected Target, not Project. Is it ?


and in the editor tab Add Localization displays all the languages french, arabic...

Which editor are you speaking about ?


but the menu items are greyed out and not accessible for the current displayed source.

Which menu ? Which source do you speak about ?


What you should do:

  1. select your project in PROJECT
  2. select Info in the panel
  3. you'll get a + button in Localization area ; click it
  4. then select french in the pop up
  5. apply to the storyboards thjat are proposed

Good morning and thank you, I know the Info Tab gives the popup languages but where it is? I can't find it! When the properties of the selected project have been opened, at display I can see General Signing&Capabilities Resource Tag Build settings Build Phases Build Rules but not Info.

Thierry

It would be easier with a picture, but…


Select the project on the very left pane ("my app", at the top of file brower, with a blue icon.

You should now get a pane, with PROJECT and TARGETS on the left

Select the project name here in PROJECT (you selected a Target)

Then, at top of the new pane, select Info

You should see several areas:

Deployment target

Configurations

Localizations

At the bottom of Localizations, you will see the + button.


Does it work now ?

Without picture it will be practible! I easily found the info tab and localization, I added the french language with the + , now it appears in the list. Under the Resources for each added languages I can read "0 Files localized". After restarting XCode, there are no difference I think another settings and options have to be "enabled". If you have any idea about it don't hesitate. Thank you very much.Thierry

Some more steps needed:

  • Select storyboard.
  • Show the file inspector
  • In localization, check on "French"
  • Then you will see that Main.storyboard is now a folder, with a french entry
  • select it and start localizing.


I have written a document for personal use on steps to localize. It is not a perfect tutorial, more notes (in french) that I gathered progressively. If that may help, please post for a minute a mail address where to send.

Very well! With a project that contains a story board the settings for the localization are available and checkable but in another project (C++) without story board I can't find it! Is Xcode available only in English? Really thanks for your help. Thierry

Accepted Answer

Yes, XCode is only english.


It's harder for chinese people than for french !


If you have no storyboard, then you have all text created in code.

Then you need to use NSLocalized as here:


let ac = UIAlertController(title: NSLocalizedString("Operation Impossible", comment: "Scan failed"),

message: NSLocalizedString("This device cannot scan QR code ", comment: "Scan failed"),

preferredStyle: .alert)


Then, you will have to create files : Localizable.strings


I explain how to do in my doc.


If that's OK, don't forget to close the thread.

Thank you very much Claude31. Bye-bye Thierry

What I have to do to close the thread?

Humm...I think you're just flexing any muscles, no?

default language, add localizations
 
 
Q