Single language ios app - ios

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?

Related

Swift Bar button item set to system item "save" ignores app language

In my app I have a bar button item in my top navigation bar. I have set the button system item to "Save" which will display the button as Save
But even if my phone has a different language set the button still shows up with the text "Save"- english when I start the app
The language that various UI components appear in your app is based on two things:
The device's list of languages under the "Preferred Language Order" section of the "Language & Region" page of the Settings app.
The languages supported by your app as defined by the localization bundles your app provides.
An app only supports a single language by default. To support additional languages you must add an additional bundle for each language and then provide appropriate localization resources such as strings files and localized storyboards, etc.
Based on your app's supported languages and the devices settings, UI components will appear in a single, chosen language.
Lets say your app supports English, Spanish, and Chinese.
Now lets say a user's device has the languages German and English, in that order, listed on the Language & Region screen.
Your app will appear in English to this user. Based on your question, you seem to expect the Save button to appear in German. But if your app doesn't support German, why have the Save button appear in German and the rest of the app appear in English? That would be confusing.
So now go back to the simple case. You have a basic app and you haven't done any localization yet. Your app only has the one bundle - the default language for your app. Lets say that is English. Since your app only supports English, it would be really confusing for the Save button to be in any other language while the rest of the app is in English. So no matter what language the user has set for their device, the Save button will be in the app's only language, English in this example.

iOS - Internationalisation and Localization

Is it possible to change App language on Button tap ? I'm developing an App which should support multi languages and inside the App, there is option to choose the language (in the form of button). By default, App placeholder text will be in English, once the user choose some other language, placeholder text should change as per the language selected. I have gone through few examples in Internet, i couldn't find anything close to my requirement. I have seen example from appcoda and ray, but switching the language within the app is not provided. can somebody tell me how to achieve this ?
Thanks,
Pradeep

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.

Preview localized versions of strings-translated auto-layout XIBs

I'm migrating away from one-XIB-per-locale to a single Base interface with Auto-Layout that is localized using .strings files.
How can I easily preview localized versions of my interface?
I'd like to see how my UI looks in German, Chinese and Arabic without having to change system-wide language preferences each time.
Selecting another language in Interface Builder's "Jump Bar" just shows me raw the .strings file source. IB's "Simulate Document" only shows me document in my current language.
You can launch application in a particular language with an extra argument:
Foo.app/Contents/MacOS/Foo -AppleLanguages '(de)'
However, that's not enough for Arabic, as it sets the language, but doesn't enable RTL layout:
app -AppleLanguages '(ar)' -NSForceRightToLeftWritingDirection YES -AppleTextDirection YES

No plus or minus button in Xcode localization settings

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.)

Resources