How to localize the second plist file in settings.bundle?

I have settings.bundle in my application with Root.plist, which is correctly localized using

 Strings Filename Root 

enter image description here

Now I have another plist file named NewInfo. How to localize it? When I use the same string file name "Root", nothing happens.

Any ideas?

+6
source share
2 answers

Edited answer:

The only way I found the localization of your second plist child panel file in the parameter set is to do it manually.

I just checked this and it works:

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

Once you have this, you should see in Xcode that your new preset has these new string files.

Now in your NewInfo.plist file, make sure you have a field called StringsTable and set the value of this parameter to NewInfo (or something else that you called your new string file).

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

Here is a screenshot of Root.plist where I added the string "TEST" to open the child panel. Pay attention to another NewInfo.plist file, and the related lines are in the correct lang.lproj folders (again, I put them there manually in Finder).

enter image description here

Now here is NewInfo.plist with the StringsTable key, which corresponds to the associated .strings file name:

enter image description here

The following are the values ​​of the string files in FR and EN:

enter image description here

enter image description here

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

enter image description here

enter image description here

enter image description here

enter image description here

+11
source

Locate this file in your project inside Xcode. Select it and open the β€œFile Inspector” (View β†’ Utilities β†’ Show File Inspector). You will see the localization there, just click the + button and add the desired language.

+2
source

Source: https://habr.com/ru/post/902863/


All Articles