Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using Localizable.strings in iPhone application

I downloaded the three20 library:

http://three20.info/

And I opened the TTCatalog sample project that comes with this library:

http://img16.imageshack.us/img16/3183/screenshot20100302at752.png

As you can see, there are lots of Localizable.strings files.

When I opened the iPhone simulator and changed its language to for example French in the settings, the text on the button still remains in English:

http://img69.imageshack.us/img69/9775/screenshot20100302at812.png

I already checked that there is definitely a corresponding entry for the text "See All" in the Localization.strings of French.

Why and what are the steps to make it use the Localizable.strings files?

(This sample project does not come with any nib/xib file)

EDIT:

After adding the following XML in Info.plist:

...
<dict>
...
    <key>CFBundleLocalizations</key>
    <array>
    <string>de</string>
    <string>en</string>
    <string>es</string>
    <string>fr</string>
    <string>it</string>
    <string>ja</string>
    <string>zh_cn</string>
    <string>zh_tw</string>  
    </array>
</dict>
...

It works now!

like image 541
bobo Avatar asked Mar 02 '10 12:03

bobo


People also ask

How do I add localizable strings?

Step 1: Create Localizable.Select File → New → File… or just tap Ctrl+N or Cmd+N . Search for strings and you will see Strings File in Resource window: Choose Strings File and name the file Localizable : Now, let's select Localizable.

How do you do localization in iOS?

Use the Xcode Export For Localization feature to automatically extract all localizable content, including localized strings referenced from code, stringsdict files, and Interface Builder files, as well as any localized assets.

Does Apple use localization?

In order to maintain its place as one of the biggest brands in the world, successfully leveraging its marketing localization services has been key. Apple has had to adapt its products and materials to fit global audiences, keeping in mind cultural and linguistic nuances.

How do I use localized strings in Swift?

Select the project and under “Localizations”, click the “+” icon. Add any language you want (I selected Italian) then click on “Finish”. Now go back to Localizable. string file, select it and on the File Inspector (right menu) select “Localize”.


1 Answers

Does this thread help http://groups.google.com/group/three20/browse_thread/thread/bee3d5525a32d476 ?

Quoted text, in case the link becomes unavailable:

For localizations inside bundles to work, your app has to have some localized resources itself, because the available localizations are determined by looking at the once available in the main bundle. Alternatively, you can add the available localizations as a setting in your Info.plist, with the key 'CFBundleLocalizations'. Note that the value of this key has to be an array, something the Info.plist editor of XCode does not support, you edit the file 'by hand' to get the localizations in there. If you only need one localization, you can simple set the key 'CFBundleDevelopmentRegion' to the value of your choice.

like image 142
Guillaume Avatar answered Oct 19 '22 00:10

Guillaume