How to localize second plist file in settings.bundle?
Asked Answered
I

2

6

I have settings.bundle in my application with a Root.plist that is localized correctly with

Strings Filename Root

enter image description here

Now I have another plist file called NewInfo. How can I localize it? When I use the same Strings Filename "Root" nothing happens.

Any ideas?

Indehiscent answered 1/12, 2011 at 19:37 Comment(0)
Y
11

Edited answer:

The only way I have found to localize your second child pane plist file in the settings bundle is to do it by hand.

I have just tested this and it works:

When you open the Settings.bundle in Finder, in each language.lproj folder, make a copy of the Root.strings file and rename them to NewInfo.strings (for example).

Once you have one this, you should see in Xcode that there are these new string files inside your settings bundle.

Now in your NewInfo.plist file, make sure you have a field called StringsTable and set the value of that to NewInfo (or whatever you called your new strings file).

I have just tested this in Xcode 4.2 and the localization works perfectly:

Here is a screenshot of the Root.plist where I have added a "TEST" row to open child pane. Notice the other NewInfo.plist and the associated strings are in the correct lang.lproj folders (again, i put them there manually in Finder).

enter image description here

Now here is the NewInfo.plist with the StringsTable key that corresponds to the associated .strings filename:

enter image description here

Here are the values of the strings files in FR and EN:

enter image description here

enter image description here

And the resulting settings page in the Simulator in both FR and EN, showing that the localization works:

enter image description here

enter image description here

enter image description here

enter image description here

Yoghurt answered 7/12, 2011 at 12:10 Comment(4)
I think I pointed out correctly that the plist file is inside the settings.bundle archieve, and there is no localization option for it.Indehiscent
Ok I hadn't gathered that sorry. What do you use the NewInfo.plist for, and is there a specific reason why you put it inside the settings.bundle ?Yoghurt
E.g. have a look at the settings of the iOS facebook app, in settings there is a child pane called info to display some information. Here is the previous question I asked on that topic #8308693Indehiscent
Thanks, that helped me dig out an old bug. In my case I had left a Root.strings file at top level of Settings Bundle, in addition to the Root.strings in each xx.lproj folders ; and that caused only this top level Root.strings to be used, not the localized strings.Duckbill
R
2

Find that file in your project, inside the Xcode. Select it and open the File Inspector (View -> Utilities -> Show File Inspector). You'll see Localization in there, just click the + button and add the language you wish.

Ripley answered 1/12, 2011 at 19:50 Comment(1)
This is not possible because you can't expand the settings.bundle file, you can only view the contents in finderIndehiscent

© 2022 - 2024 — McMap. All rights reserved.