where in an XCode project does it set "InfoPlist.strings" as the filename to use for locationalization? - iphone

where in an XCode project does it set "InfoPlist.strings" as the filename to use for locationalization?
Just trying to understand how XCode pulls things together here. For example to set the app name specifically I can change this in "AppName_plist-Info.plist", however if I go localization it seems it then has to be set via the "InfoPlist.strings" files.
I can see in XCode where it specifies the "AppName_plist-Info.plist" file name, in the Target/BuildSettings/Packaging information area, but I don't see mention of "InfoPlist.strings", so how does Xcode/IOS know to override what is in "AppName_plist-Info.plist" based on what's in "InfoPlist.strings"?

Xcode doesn't really override the name, it creates localizations in your apps bundle. iOS will look for the name of the app in de localization folder to which the language of the system is set.
These files have pre-determent names, thus you can not set them.
All the localized files will be for example in bundle.app\en.lproj for english or bundle.app\nl.lprojfor dutch.

Related

Is it possible to have 2 different application icons depending on the language? [duplicate]

This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
Localization of icon and default screen in iPhone
As my question already says, I want to have 2 different application icons.
If for example english is the native language on the device I want it not only to have a different app name but also a different icon.
So is that actually possible?
According to apple documentation, you can do it.
An iOS application should be internationalized and have a
language.lproj folder for each language it supports. In addition to
providing localized versions of your application’s custom resources,
you can also localize your application icons and launch images by
placing files with the same name in your language-specific project
directories. Even if you provide localized versions, however, you
should always include a default version of these files at the
top-level of your application bundle. The default version is used in
situations where a specific localization is not available. For more
information about localized resources, see “Localized Resources in
Bundles.”
This info was extracted from here:
https://developer.apple.com/library/mac/#documentation/CoreFoundation/Conceptual/CFBundles/BundleTypes/BundleTypes.html
You can do it, if you want too... just click on your icon file (consider Icon.png) now simply click on the ‘+’ in that ‘Localization’ pane on the right.
Add languanges that you want to provide support. Consider you have English And Spanish language support, add those two languages. It will create ‘en.lproj’ and ‘es.lproj’.
Now just see those directory, you can see both directories have their own copy of Icon.png. So just replace that image and make sure new file has same name as the replaced one.
Now Run it. And check by changing language in Setting>International>Language
Basic thing is based on language it will check if localization is available for that particular resource, if it exists it will be used.
No, you can't have localized app icons
Sorry, I was very wrong, it is possible. I was quite sure but my information obviously was very outdated :).

about iOS localization

In the following doc:
http://developer.apple.com/library/mac/#documentation/MacOSX/Conceptual/BPInternational/Articles/LanguageDesignations.html
it's mentioned that
In iOS, the bundle interfaces do not take dialect or script information
into account when looking for
localized resources; only the language
designator code is considered.
Therefore if your project includes
language-specific project directories
with both a language and region
designator, those directories are
ignored. The bundle interfaces in Mac
OS X do support region designators in
language-specific project
directories.
I don't quite understand this. Does it mean that the name of .lproj directory cannot contain any region code?
But at least I know that iOS accepts zh_TW.lproj, zh_CN.lproj. How about en_GB.lproj and en-GB_GB.lproj? Or it only knows en.lproj?
This simply means that iOS would support only two digit language codes (e.g. en.lproj, es.lproj etc.). Whereas Mac OS X will support the format Language_Region (e.g. en_GB, en_US etc.).
I think that information is outdated. They must not have updated the Mac development docs when the iOS changes were made.
When you're creating your Localizable.strings or Project.plist file, you will create one per language or language-dialect. Just create the ones you need.
If you're using Xcode 4, be sure to show the "Utilities" (View-->Utilities-->Show Utilities) when the Localizable.strings or Project.plist file is selected. It will have a Localization section that makes adding these easy.
UPDATE: As of iOS 8 you can now use any language or region in iOS.
Apophenia is correct. Although iOS has 30 languages that it will recognize as .lproj folders, it won't accept any regional codes, so telling it fr-CA won't get you French Canadian, but rather will simply use your French or English strings. The only exception to this rule is Chinese, which should be zh-Hans for Simplified Chinese and zh-Hant for Traditional Chinese.
You should always use the two-letter code for the language (en.lproj, fr.lproj, es.lproj, de.lproj, and so on).
There is a complete (and updated) list of the current supported languages and language codes for both iOS and iTunes here:
http://www.ibabbleon.com/iOS-Language-Codes-ISO-639.html
Note that the iTunes App Store has a different list of supported languages, which makes the chart linked to above very handy!

Rename the app in iphone

I have almost finished my iPhone app, but want to rename it as I don't like the name I chose in the beginning. Is this easy to do, and if so, how do I do it?
Go to target-> yourApplicationName(double click/get Info)->Build->ProductNAme
Set your new name for that application there
hAPPY cODING...
I don't know what rename does, but there are a possible 5 names to deal with. There's the name of your .xcodeproj file directory, the name of your target within that project, the Product Name under Packaging in the Build Settings, and the Bundle Display name in the Info.plist, and the name you provide for the app in iTunes Connect. None of these 5 names needs to be the same, and you can name them all slightly differently. In fact this is common.
For instance, you might want the Bundle Display Name to be short so that it will fit under the icon, and it can have spaces in it. The Product Name can be much longer and more descriptive, but can't have spaces. You iTunes Connect name might be longer still, with spaces, and you may have change the spelling, etc. slightly if your preferred spelling is already taken, etc.
In the latest version of xcode.
Project > rename.
Choose new name.
I had the same problem recently and tried Project -> Rename, as well as Target -> application name -> Build -> ProductName
Then, I remembered the .plist file. If you double click the .plist file in your app's resources folder, you'll see "Bundle Name". Changing this did the trick for me!
Change your bundle display name in info.plist file

Change a localized InfoPlist.strings using an Xcode target

Here's an obscure problem. I'm using an InfoPlist.strings to localize my app name. It's only got one value: CFBundleDisplayName = "Mon App". The strings file is localized (putting it in a directory for that localization).
I've just made an extra target, where I change things like the non-localized app name (different Info.plists), and the icon. I'm also changing the Default.png using a run script build phase (copying different files depending on the app type I'm building).
I've tried using the script to copy different versions of my InfoPlist.strings, but I couldn't make it work. Here's what I used:
if($TARGET_NAME == "MonApp")then
cp fr.lproj/MonApp_InfoPlist.strings fr.lproj/InfoPlist.strings
endif
I've seen a post suggesting wincent strings util for processing strings, but wanted to see if there's an easy way to do this. Any help greatly appreciated.
You don't need to do this.
If you have fr.lprog/InfoPlist.strings and en.lproj/InfoPlist.strings in your project, you should see just one InfoPlist.strings entry, with two subitems fr and en. If you drag and drop the InfoPlist.strings file into a Copy Bundle Resources build phase, all localized versions will be copied into the appropriate .lproj files at build time. You don't need to create a separate target or write a script to do this; the right thing happens.

Bundle Display Name in iPhone

Is it possible to modify the BundleDisplay name at runtime ???
Thanks
I'd be really surprised if you could, since doing so would require you to edit the Info.plist file, which is in a write-protected directory. Even if you could modify it, it would cause the code signature to no longer match the application bundle, and the app would refuse to launch.
The closest you can get to using a different display name is to provide localized versions of it.
If you set the Bundle Display Name to a variable ie ${MY_BUNDLE_DISPLAY_NAME} and make sure that gets set in your build phases or from your ENV, or from an XCCONFIG file when building from the command line, the name should be replaced with what you set it with.