IOS: Add languages as Localizable.strings - iphone

I want to localize my app, and I add French and Spanish to the target properties other than English
But, those languages are not showing inside the file inspector to select. Only 'English' and Something called 'Base'.
Any Help?

If you go to the "Info" pane of your project, you'll see a panel that shows your Deployment Target, Configurations and also the current localizations that you support (including a checkmark for "Use Base Internationalization"). Base Internationalization, b.t.w., allows you to have a single storyboard file that has different string files populating the string fields in the storyboard. It works for iOS 6 and newer.
When you start, it might look like this:
Here I've added Hindi as a language possibility:
And when you're done, you have the checkbox to choose from:

You need to add in your Info Project the localizations (I can't add image sorry).
And next you need to create a new file in your project named "Localizable.strings" and Localize this file in your identity menu.
++

Just click on your project in "Info" panel , where you can see "Localizations" and add the languages you want.

Related

How is the name of the first item in the MacOS app menu localized?

I found that the name of the first menu was dictated by BundleName and $(PRODUCT_NAME). I wanted him to support localization, and each region displayed a name, but I didn't find it.
Are there any relevant documents or cases that can give me some help, thank you?.
In your project, add a Strings file named InfoPlist.strings and add an entry for CFBundleName then localize the file and the entry per supported language:
CFBundleName = "¡Mi aplicación!";
This will allow the name of the app to appear localized in the app menu and also in the standard about panel.
Other Info.plist string entries can be localized in the InfoPlist.strings file as well (e.g., CFBundleGetInfoString, NSHumanReadableCopyright, NSContactsUsageDescription, etc.). To see the keys in Xcode, open the Info.plist file and control-click in the editor pane of the plist to see the contextual menu and select Show Raw Keys/Values.

Adding custom fonts to the keyboard extension ios 8

How can I add custom fonts to ios 8 Keyboard extenstion like this.Can anyone have a tutorial or example from which I can refer.Like this example https://itunes.apple.com/us/app/fontkeyboard-for-ios-8-use/id914787397?mt=8
1.In the above link they have the special characters as letters, Please refer below URL
http://fsymbols.com/letters/
2.In Your Extension,You have to maintain the two arrays one is with regular letter (A,B,C,D….)to show on your Keyboard
3.Second one is the Special character that you want to display in your target E.g..,(Ⓐ,Ⓑ,Ⓒ,Ⓓ..) (⒜,⒝,⒞,⒟….)
4.Use can directly copy the special characters from the above reference URL,and then you return the value of selected letter
5.If you want to give an options like the referred app,you need to maintain the array of those letters and return the value that you wanted to display for that selected letter.
Here is the keyboard button action,the insertText method used to insert your text to the target.
Please find my blog on how to creating third-party keyboards :Here's a link
Please find my sample project on github : Simple Custom Keyboard Sample
This is an old question but incase new people need the answer I will add mine. Gagan's answer (above) is quite elaborate and +1 for the github code; however, to my understanding the question is how to add font to custom keyboard, which could mean more than adding special characters to the keyboard keys (Gagan's answer), for example adding letters of languages not supported by apple.
In any case, to add a custom font to iOS keyboard extension, do the following steps:
Step 1. Drag/Add your ttf font to the Keyboard extension folder
(NOT to the host app) of your project in xcode.
Step 2. While importing make sure to check "Copy items if needed" and finish.
Step 3. Select Info.plist under Supporting Files section of the Keyboard extension folder
Step 4. At the end of the list add a string array
called "Fonts provided by the Application" xcode will autocomplete it
for you.
Step 5. Extend the newly added array and add the name of your
font/fonts eg. "Example.ttf"
Step 6. Now to make sure the font is copied to the final binary app, go to project properties and in the Targets section select the keyboard extension, then in the "Build Phases" tab and the "Copy Bundle Resources" subsection add/link the custom font.
That should get you a custom font in your keyboard extension!
Notice that in the steps the Keyboard extension is mentioned repeatedly on purpose, because thats the catching point when adding custom font to the extension compared to adding font to normal applications and it should not be confused with host app of the extension. iOS Custom Keyboard project in xcode usually comprises a host app which is pretty much a normal iOS app and the actual keyboard extension, both are displayed as folders in the Project Navigator.
If the custom font is needed to be used in the host app, then the steps are similar, only then make sure the destination is the host app folder and once again select the host app Target in the project properties when adding to the Bundle resources.

Switching to Base Internationaliztion

My app is currently localized for English and Japanese, with seperate storyboards for each. I want to switch to base localization so that I only have to maintain a single storyboard. I've checked the "Use Base Internationalization" box in the project's info tab and chosen the English iPhone and iPad storyboards for the base.
I assume I should delete the Japanese iPhone and iPad storyboards I had previously used, but I don't see an option to delete them when right-clicking on their files in the file inspector. Should I delete these old storyboards, and, if so, how?
** Edit **
Changing the 'Main Interface' shown in the screenshot doesn't allow me to delete the Japanese storyboard. It's hard to tell which storyboard to select in the dropdown because its width is more narrow than the storyboard names, but that's a separate issue.
This tutorial drives you through the process step-by-step. This is how it worked for me:
Remove all localizations and leave only the base.
Ensure that the localized files were moved from the project directory (in Finder)
Add the localizations one-by-one
The localized strings are extracted from the storyboard only when the localization is created. The Tutorial above provides a script that can help you keeping the localized files up to date if the storyboard is changed.
In your case, you will have to merge the existing translations into the new files but I suppose it is not a huge deal compared to the gain with using a single file.
For reference, the process is described in this official tutorial too: http://developer.apple.com/library/ios/referencelibrary/GettingStarted/RoadMapiOS/chapters/InternationalizeYourApp/InternationalizeYourApp/InternationalizeYourApp.html
After cleaning and reloading, I was able to remove the Japanese storyboards by clicking on the - in the project settings:

iPhone - System strings not localized on device

I build a project using XCode 4 and I was running on the simulator since now. I had noticed that the strings in System type "Edit" and "Save" buttons where in english, but everything in my simulator was set to french. I suspected a bug like the one I had in XCode 3.
But now I'm running on my pure french configured iPhone, and those buttons are still in english, and are not localised as in other apps I can use.
I noticed that in my info.plist, the "Localization native development region" was set to "en" by default. I've changed this to "Fr" or "France" in the drop down menu, but that does not chage anything.
How may I correct this to make those buttons show a localized title ?
I had basically the same question, but Black Frog's answer didn't really help me. I did some research and this is what I found out:
The localization is primarily based on the bundle. With info.plist you can add localizations that aren't in the bundle, but you can't remove localizations that are present in the bundle.
The preferred way to add a French localization in Xcode 4 is to do the following:
Open project in Xcode >= 4.0.2
Click on project file
Select item under Project title on the right
Check Localizations table.
Select the localization you want to duplicate (English)
Click + and select the language you want you're app to use (French)
If you don't wan't to support English there are two additional steps:
Select the localization you want to remove (English)
Click - and delete the files
Special thanks to Nekto who helped me figure this out.
You have to create localized version of your nib files. Or you can set the text of each button/label to a localized string in view load.

How can I make Info.plist show English names?

I have a project with two Info.plist files (one for each target). In the second Info.plist, when I add a field it shows the internal name instead of the English name. For example UISupportedInterfaceOrientations instead of "Supported Interface Orientations".
Also, when I click on the dropdown list to see all options, some of the options that are available in the first .plist file are not in the second (eg CFBundleIconFiles). The two problems are really the same thing (anything which shows the internal name does not appear in the dropdown).
The Bundle Verion is 1.1 in both files, the CFBundleInfoDictionaryVersion are both the same, as are the plist version and the DTD.
What's stopping the second plist from giving me these options? Thanks.
alt text http://img.skitch.com/20100708-ctia2e6yfwgd7twdnepryidayr.jpg
Xcode has a couple of different editors to show the contents of plist files. One of them is the generic plist editor, which shows the names of the keys without translation. The plist editor can also be in the specialized Info.plist mode, where it knows about the structure of this special type of plist file and translates keys to english.
I don't know how Xcode decides which editor to use, so the following is just guessing: I assume Xcode looks into the selected target to check the path to the Info.plist file and if it is the edited file, uses the specialized editor. So if you have one target selected, but open the other targets Info.plist it might use the generic editor instead.
Xcode also manages file types for each file in the project. You can override Xcode's automatic guesses by opening the file's settings (click on the file in the outline view and press command-I). Maybe there's a file type to identify Info.plist files.
As a last resort, you can always open the file by right clicking it in the outline view. In the context menu from "Open as ..." you can choose how to open it. I usually use "Source Code File" since I like to see the original XML.
Typically, there are times when not all options are shown. If you know it is supposed to exist, you can just add the key (via copy/paste) from the XML file of the other info.plist. I normally just open it up as XML and work in that mode (which gives non-English names).
All keys can be found here: http://developer.apple.com/iphone/library/documentation/General/Reference/InfoPlistKeyReference/Articles/AboutInformationPropertyListFiles.html
In the latest XCode, it has been converting everything automatically to English names for me though even when I try to paste as a non-English name in the property list editor.
Short Answer
Select iPhone Info.plist from the View > Property List Type menu.
Explanation
This actually has nothing to do with the plist file itself. It's how Xcode (via the Property List Editor) presents the file.
You can test this by, in Finder, making a copy of a correctly-displaying plist file. Open the copy in the Property List Editor (usually the default application). The copy usually won't display the English names (until you change the Property List Type).
Xcode will remember the type you select and save it in the .xcodeproj file.