No plus or minus button in Xcode localization settings - ios

I need to translate an iOS-Application within two days, but my XCode versions (4.4 and 4.5 Developer Preview) both don't give me the option to add another language. I only get the option to click "Make localized.." but I can only choose english and after choosing it, there are no plus and minus buttons in the utility inspector in Xcode - with no file or project i tried.
Am I missing something here?
Edit:
This is how it looks like:

It moved to the starting in Xcode 4.4 .

I just meet with this problem and I was using xcode 4.5 preview 3. Couldn't believe apple have made this kind of mistakes and not fixed it even when its at preview 3. Therefore I believe they just have changed the way localisation work so I poke around the UI until I finally found it.
They have shifted it. You first have to add the language you want to the project first. Then after it will appear as a check box item in the UI you show. To add the language you need to click go to Project -> Info then click "+" to add new localizations.
Hopes that helps.

The buttons scroll out of view when the "+" is used to extend the list. Use the mouse to grab the bar right below the list of localizations and drag it down to make more room, and the buttons will be visible again. Then you can click on the "+" to see a menu of additional localizations.

It seems Xcode 4.5 DP3 completely miss the +/- buttons in the localization pane.
I tried Nyon solution to add an additional language (actually before seeing this post).
Doing so, I can add a language into the project but I cannot use that new language to localize my files.
But thanks to him, I know now that it is the issue with Xcode DP3.
So, what did was very simple: I use the old Xcode 4.3 to localize my file (with + button in the localization pane).
Then, I have two versions of the files (one for each language, nicely organized into appropriate lproj).
Then I switch back to Xcode 4.5 DP3.
Now, both languages (en and the new one) appear in the localization pane.
And this time, for all my files!
That is, you have to add a language only once in Xcode 4.3, afterwards, the new language will appear in your language list as it should be.

You can add languages in Xcode 4.5 like above.

I think the answer is not complete!... If you start a project for a non English, Japanese, French or German language (in xCode 4.6), then you will be a bit lost on how to localize your resources.
If you just go and try to add a new language as stated by kamesh above, you'll find you can't if you didn't FIRST localized at least one of your resources in the default provided languages by xcode.
So, localize at least one of your resources needed to be localized, and then, add the language you need to add as kamesh, then the next modal presented by xcode will let you add any resources to that new language. (not very intuitive and definitely not documented by apple.)

Related

How to localize images in iOS if they are set up in a storyboard?

I know how to localize storyboard elements like label, buttons etc. However, I faced a problem where I need to localize the images that were setup in a storyboard in the attribute inspector for the Image View.
Is there a way to localize those without setting those images up in the code, in the viewDidLoad method and calling setImage:[UIImage imageNamed: NSLocalizedString(...)]; ?
Any kind of help is highly appreciated!
I guess I figured it out...maybe not the ideal way of doing it but works for me...
Open image folder in your Project Navigator (panel).
When you click one of the images, on the right (Inspector panel) you'll see the button "Localize".
Clicking on that button gives you a pop-up asking if you want it to be the base (in my case I say yes).
So now in the inspector there're check boxes: Base, language 1, language 2 etc (language n - is the languages you added to your project in the localization settings).
So now if you put a check mark into one of the language check boxes, your image file will have a drop down arrow showing that it has some content inside. If you click that, you'll see how it expands showing the localized files with the name of the language in the () brackets.
However, at this point those files are all the same as the base. So now you need to substitute the base files with the localized ones.
If you right click on the file that needs to be localized, say myImage.png(German), open it in Finder, and replace that file with the right one. Important! The name of the file should stay the same!
I'll post the screenshots later, so it's all clear how to do it.
Using Xcode 9.2
you can achieve it easily like the following
1- From Assets
2- Then you will need to change the Direction option AND CHOOSE BOTH
xcode will allow you to add 3 more image for other language resource
3- add your needed image and use it in story board or from code as well

How to preview Storyboard in Xcode using Non-Base localisation

I have a Storyboard in Xcode 5.1 with a base Localization of English, and a second Localization in French.
When I'm using the Xcode Storyboard editor the strings are shown in English, as expected. Is there any way to make Xcode display the Storyboard in my other localization (French)?
I don't want to change Mac OSX's language, I'm hoping there's an option in Xcode somewhere.
EDIT: I have this in my resources folder
If I double-click Main.storyboard then the storyboard opens showing English (base language), as expected.
Is there a way to view Main.storyboard, but showing the text displayed in Main.strings?
EDIT:
I've since discovered (thanks to this tutorial) that there's a 'preview' option in Xcode. To get this, open the storyboard, click the 'assistant' editor, click the 'assistant editor menu button' (immediately to the right of the > arrow at the top left of the assistant window) and select Preview. This shows how the ViewController will look in landscape/portrait 568/480 high modes. Very handy, but still shows everything in English.
If only this'd let me select a localization, it'd be a great way to check the text layout works in different languages..
I believe that Xcode is not prepared to show localized storyboards in Interface Builder when using string files. However, it allows for you to convert formats quite easily. Select your storyboard file and in the utilities panel, select the language you want to preview:
Change the "Localizable Strings" to "Interface Build Cocoa Touch Storyboard":
You should now be able to select the French storyboard file and preview it within IB.
Once you are done, you can convert the file back to "Localizable Strings" reversing this procedure, or using your source code version control system. Then you can update the base file with any necessary adjustments, and verify it is to your liking using this method again.
Xcode 6 now includes a feature to do this.
From What's New in Xcode - New Features in Xcode 6:
Preview in Interface Builder. While designing in Interface Builder, the preview assistant can show how the interface appears in other languages. You can see how your interface responds to longer or shorter languages.
Hurrah!
Just click on you storyboard file and you can devellope it to show your Localization storyboard.
In Your case if you use the localization "base" option, you must see 3 storyboard file (one for "base localization", one for english and one for french).
Sorry for my english but i hope that help you.

Xcode 5.1 method search only allows one character?

I've recently upgraded to Xcode 5.1 and I'm experiencing the most annoying bug. The instant search or method search dialog that allows you to search the methods on the given source file you are looking at isn't allowing me to enter more than one character. I have large source files and I tend to rely on that a lot. Any idea why this might be happening. I've tried re-installing Xcode (simply be dragging it in the trash).
You can find the search field I'm talking about by clicking the method as shown in the screenshot and simply typing something.
When I type the character gets replaced with the last letter entered.
(This one's just informational: I don't think it will fit in a comment, and want to report on what suggestions worked and didn't.)
I ran into this same problem. I accidentally typed some other key combo when trying to do Ctrl+6 to open the Document Items dropdown, and it was all out of whack after that.
As clance_911 mentioned, the filtering would work after clicking in the search box. So for example, to filter for "init", I could hit Ctrl+6 to open the Document Items, type "i" to start filtering (but then any subsequent letters would replace the i), click into the search text box, and continue typing the "nit". This works, but it's a pain.
As Moze pointed out, this seems to be specific to external displays. Sure enough, it worked fine on my MacBook display, but if I moved Xcode over to the external display, it stopped working. In my case, dragging the menu bar in the display Arrangements settings (to make the external monitor the main display) did solve the problem: the filter worked correctly with Xcode in either window. Sorry, Etienne :-(
The other solution that worked for me was simply closing the MacBook: use it in clamshell mode with only the external display. This is my normal setup anyway, but I know that's not ideal for everyone.
It happens if Xcode is open in external display that is not main display.
To fix it, open display setting's Arrangement tab and drag menu bar to display that you are working on.

Single language ios app

I have a project in Xcode 5.0 and I want to support only a specific language different from english, for intance, pt. When the project is created, it has "Use base internationalization" checked. A tried adding my language and removing english, then when I run the app on a device of that language (pt), everything is ok, the controls of a image picker, for instance, are localized. But, if the device's language is english or a different one (for instance fr), the controls are shown in english. How can I force the app to show all controls in my language (pt)?
Maybe it is noob question, but when I uncheck "Use base internationalization" I lose the storyboard, and when I try to check again it asks for files but no options are shown. How can I change the reference language of base internationalization?

How to change default language of UIActionSheet buttons?

In an iOS5 app, I have a UITextView with data detectors for phone numbers and so on. When I tap the underlined link / detected data, everything works as expected, but when I tap that link a little longer, an UIActionSheet appears (Call xyz, Add to Contacts and so on). This is fine as well except the language of those buttons English but it should be German. I already set the default language of the app to German in xcode and also deleted the English localization but the button titles remain as they are. Is it possible to change the language somehow?
Found the answer myself. Originally, I thought I need to have the English localization because when I deleted the (only one) localization, the storyboard file was deleted as well. The solution now was very simple. I added the German localization (the storyboard is copied) and then deleted the English one. This way the action sheet buttons are German now and the storyboard file remains in the project - problem solved.
Sorry for being too stupid to try this before :-/

Resources