How to make iOS app name localizable? [duplicate] - iphone

This question already has answers here:
How to localize bundle display name in iPhone app?
(6 answers)
Closed 5 years ago.
I'm trying to find the easiest way to localize my app. I'm using sqlite, so I need basically only to switch my database name. Problem is the app name - can it be localized from code or I have to make x apps for x languages, so anyone will have app name in his/hers native language? The latter one seems like already rejected app to me... anyone?

I assume you mean the Bundle Display Name that appears on the device's home screen:
You should create a localized file called InfoPlist.strings similar to the Localizable.strings file that you use for the usual text snippets.
In the InfoPlist.strings you can localize the different keys from your Info.plist. To localize the app name add:
"CFBundleDisplayName" = "My localized app name";
To localize a file: Simply create a new strings file in Xcode. Then reveal the right Xcode pane and add localizations via the menu shown here:
Using this technique you can localize any file you like. Simply add the correct version to your bundle. If you then use [[NSBundle mainBundle] pathFor... you will automatically get the path to the correct localization. We do this for sqlites, strings and sometime even images.

Related

custom fonts is not work in my iOS app [duplicate]

This question already has answers here:
Custom font is not working in my App?
(8 answers)
Closed 9 years ago.
Hai i have using already custom font ,But now i try to add font file it wont work properly ,i will try to use angry bird font file to add my application its not working.Remaining font file also not supporting i don't know i am doing correctly r not.My reference links http://refactr.com/blog/2012/09/ios-tips-custom-fonts/
https://wiki.appcelerator.org/display/guides/Custom+Fonts#CustomFonts-Sampleapp
Custom Fonts are easy as pie in iOS. If you use the Approach from http://refactr.com/blog/2012/09/ios-tips-custom-fonts/ like in your question you are read to go. But there is a really great difference in the font family name that you get from the font explorer from OSX and the actual family name in iOS.
You can get the family name via [UIFont familyNames] in your code. Now you have a Family name. Log this to your console via NSLog and then simply use [UIFont fontNamesForFamilyName:#"the_family_name_of_the_font"].
More information for familyNames and fontNamesForFamilyName:
Here are the steps transcribed:
1) Add your custom font files into your project using Xcode as a resource
2) Add a key to your Info.plist file called Fonts provided by application.
3) Make this key an array
4) For each font you have, enter the full name of your font file (including the extension) as items to the Fonts provided by application array
5) Save Info.plist
Now in your application you can simply call
[myLabel setFont:[UIFont fontWithName:#"Swis721 Lt BT" size:[lbl minimumFontSize]]]; //use font name not file name.

Xcode: URL Types: Icon?

The Xcode docs, explain that the CFBundleURLIconFile key contains the name of the icon image file (minus the extension) to be used for displaying URLs of this type.
My remaining questions are:
What icon image should I use? Like, if the URL type is for another app, should I use that app's app icon?
What size(s)? If many sizes, how do I name them so that the sizes are used correctly?
Where is it displayed? I'm wondering for an iPhone app.
Apple does not specify this specifically, but my interpretation is that it should be an Icon representing the application which should/will open/handle URLs of this type.
On OS X, the normal approach would be to use an Icon File (.icns). I suspect you should try that on your iOS app. If that doesn't work, duplicate the naming scheme of the the standard app icon files.
Try viewing a PDF in Safari on iOS. If you have iBooks, it should show a button saying "Open in iBooks" and shows an icon next to it. This icon is the icon you would be setting.
I hope this is thorough enough to answer your questions. If not, please explain what needs clarification.

How can i change display name with code

I want to dynamically change display name from within the application. Is there a way it? i dont want to use .plist. i want to use with xcode from application. Thanks
${PRODUCT_NAME} How can i call this value with code ?
The app name is defined in the app's info.plist file..
That come in Main Bundle..and iOS does not allow anything to be written and updated in Main Bundle..
So you cant programmatically change contents of app info.plist having app's name...bundle identifier ..etc
No, it's not possible. The Info.plist and everything in the app bundle is read-only once it's installed on an iPhone.
Add the following code to get the product name
NSDictionary *infoPList = [[NSBundle mainBundle] infoDictionary];
NSString *appName = [infoPList objectForKey:#"CFBundleDisplayName"];
appName is the value of "Bundle display name" or Product Name
I don't believe so.
You can localise it -- i.e., display different names depending on the language in use -- but I don't think you can change the name dynamically. That's probably a good thing... it could get pretty confusing if abused.

How do I change the text directly beneath the icon of my iphone app

There is small text beneath the icon names when you are in the home screen of the ipod.
My text is much too long and it looks like "Cedr..egg"
I was wondering if there was a way to change that text to a shorter name?
I think what you're looking for is Bundle Display Name in the info.plist file.
You can change the name of the app by renaming the app in the Applications folder in iTunes.
If you are looking to do this in Xcode you are looking for the LocalizedApplicationNames.strings file.
NOTE: This may prevent automatic upgrades in the future.

How to Show a GPL licence in iphone application bundle

i am making an app for iphone and for that i am using certain free libraries.My problem is that i want to show their complete license of nearly 4-5 pages in my application bundle so that a user can open settings in iphone and see that licensing page at one time but i am unable to do it.I have read these Specifiers for making an application bundle .
PSGroupSpecifier
PSTitleValueSpecifier
PSTextFieldSpecifier
PSSliderSpecifier
PSToggleSwitchSpecifier
PSMultiValueSpecifier
PSChildPaneSpecifier
but i want to show a page full of text like Settings->General->About->Leagl
just like in iphone through PSChildPaneSpecifier .Please help me how to do this>???
Thanks
You can create the same effect as used by Apple's iWorks apps for the license > section of the settings, without using any custom preference controller. Note this works for iOS 5 on the iPad, I have not tried it elsewhere. Use a PSChildPaneSpecifier for the initial control in the root plist. This points to the name of another plist file which will be the displayed child pane. You do not add .plist to the name within the root.plist file, it is implied. This plist file must be within the settings bundle. Next, use PSGroupSpecifiers in the child pane as the controls. For each paragraph use another PSGroupSpecifier - so the thing will scroll. Only use the Title section of the PSGroupSpecifier. The next gotcha that I found, was that by putting the strings in the plist file, the text was clipped in portrait orientation, so a placeholder string needs to go in the plist file and a StringTable used to point to a strings file. Text read from the strings file is properly kerned and displays without clipping.
The iPhone's "Legal" page is a custom preference controller which you can't use (not even with undocumented methods – you need to write a preference bundle in system locations which AppStore apps can't reach at all).
If you'd like to display the license, show it in the app.
I think you are going to need to use something like a UITextView, just make it non-editable. You can make in unobtrusive in your app but I think that is the only way to have 4-5 pages.
I don't think there is a nice way of displaying this in the preferences bundle. Personally I would either provide a series of url links or bring the preferences into the app itself. There is a good framework on github here that you may be able to modify.