Re: Adding more localized *.strings
Re: Adding more localized *.strings
- Subject: Re: Adding more localized *.strings
- From: Laurence Harris <email@hidden>
- Date: Mon, 30 Apr 2007 22:13:57 -0400
On Apr 30, 2007, at 10:45 AM, James Blair wrote:
I'm having trouble adding localization strings for new languages to
an XCode project containing existing localizations.
In a previous version of the product, we supported a small number
of localizations (English, French, and a few
others). I am now working on an updated version that will include
more languages (Italian is one). So, I created
new *.strings files with the new translations, carefully saved them
with UTF-16 encoding, and imported them into
my project (see link 1 below).
The file layout on disk looks like this:
foo.xcodeproj
en.lproj/bar.strings
fr.lproj/bar.strings
it.lproj/bar.strings
I can see the same layout in the built bundle (foo.bundle) that I
include in my framework. In my XCode project,
these show up as localizations of the bar.strings resource. (I see
the triangle next to bar.strings, as
mentioned in other posts to this group.) It appears that I'm on the
right track. To test each of these
localizations, I switched my preferred locale in System
Preferences, logged out and back in, and then ran my
application.
You shouldn't need to log and and back in for this. I can run my
application in any supported language just by moving that language to
the top of the list in International and launching my application. I
don't even have to close System Preferences.
The problem is the correctly localized strings are only displayed
when I'm running in the originally supported
locales, but never in the newly supported ones. So, English and
French display the correct localizations, but
Italian does not (it falls back on English). The question is, why?
I'm a little confused. Does the copy of your application that you're
running contain the Italian resources everywhere they're supposed to
be? If so it doesn't sound like an Xcode issue. If not, then there's
no point in trying to run in the missing languages.
Larry
My suspicion is that there is some XCode project setting somewhere
that enumerates which localizations I support,
and I just forgot to update that setting. But I've pored through
just about every project setting I could find,
and everything looks right to me. I did notice some Apple
documentation on managing localizations in an XCode
project (link 2), but couldn't really figure out how that window
works. Clicking "Add Localization" just brings
up a dialog, and when I type in the name of a new language and
"Add," nothing seems to change.
I also tried running "plutil" on my strings files (link 3), and all
of them checked out okay. At one point, I ran
the "files" command on the files, too, and that revealed something
interesting -- the localizations that work were
encoded with big endian UTF-16, while the localizations that failed
were using little endian UTF-16. Finally, I
thought I had the solution! Sadly, re-saving the little endian
files as big endian didn't fix the problem.
So now I'm running out of ideas. Can anyone help?
XCode version: 2.4.1
OS X version: 10.4.9
Intel-based Mac Pro
Link 1:
http://developer.apple.com/documentation/DeveloperTools/Conceptual/
XcodeUserGuide/Contents/Resources/en.lproj/000_xc_workflow/
chapter_2_section_6.html#//apple_ref/doc/uid/TP40002661-TPXREF222
Link 2:
http://developer.apple.com/documentation/DeveloperTools/Conceptual/
XcodeUserGuide/Contents/Resources/en.lproj/03_07_ed_localize/
chapter_24_section_1.html#//apple_ref/doc/uid/TP40002683-CFHIFBGJ
Link 3:
http://developer.apple.com/documentation/MacOSX/Conceptual/
BPInternational/index.html#//apple_ref/doc/uid/10000171i
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden