Localising Resources


#1

I am having trouble using the command line method to convert the text in my Spanish XIB file.

In terminal I receive the following message:

<plist version="1.0"> <dict> <key>com.apple.ibtool.errors</key> <array> <dict> <key>description</key> <string>The strings file "ItemDetailViewController.strings" could not be applied.</string> <key>recovery-suggestion</key> <string>The stringsfile ItemDetailViewController.strings does not appear to contain valid data for UTF-16 string encoding.</string> <key>underlying-errors</key> <array> <dict> <key>description</key> <string>The strings file "ItemDetailViewController.strings" could not be applied.</string> <key>recovery-suggestion</key> <string>The stringsfile ItemDetailViewController.strings does not appear to contain valid data for UTF-16 string encoding.</string> </dict> </array> </dict> </array> </dict> </plist>

I opened the ItemDetailViewController.strings file in Xcode, changed the words to Spanish, saved the file and closed it.

If I reopen this file it has changed to a load of upside “?” with some other characters thrown in, however if I copy and paste it, it appears normal:

[code]ˇ˛
/* Class = “IBUILabel”; text = “Name”; ObjectID = “4”; */
“4.text” = “Nombre”;

/* Class = “IBUILabel”; text = “Serial”; ObjectID = “5”; */
“5.text” = “NumÈro de serie”;

/* Class = “IBUILabel”; text = “Value”; ObjectID = “6”; */
“6.text” = “Valor”;

/* Class = “IBUILabel”; text = “Label”; ObjectID = “7”; */
“7.text” = “Label”;
[/code]

…well, apart from the capital “É” in “NumÉro”, even though I placed a “é” by holding down the “e” on the keyboard and waiting for the popup to appear to choose which character I wanted.

Is anyone able to help with this?

Nick
http://myfirstiphoneapp.co.uk


#2

Continuing on with this chapter I found the answer at the top of Page 324 in the section NSLocalizedString and String Tables.

Maybe this should have been explained in the previous section rather than causing a little head scratching and frustration for the reader?