Re: XIB and AppleGlot
Re: XIB and AppleGlot
- Subject: Re: XIB and AppleGlot
- From: Eric Slosser <email@hidden>
- Date: Fri, 5 Jun 2009 15:31:41 -0400
On Jun 5, 2009, at 1:25 PM, Jonathan Hess wrote:
On Jun 5, 2009, at 3:38 AM, Eric Slosser wrote:
On Jun 4, 2009, at 8:46 PM, Jonathan Hess wrote:
On Jun 4, 2009, at 6:28 AM, Eric Slosser wrote:
How does one use AppleGlot and XIBs?
I have an app, "My.app", that was previously localized. I'm
working on version 2.0.
My app is starting to use XIB files. These get compiled into
NIBs in My.app.
The AppleGlot docs seem to say I should put My.app 2.0 into
_NewBase, and My.app 1.0 into _OldLoc.
When I do that, the nibs that came from xibs are ignored
(my.app.wg doesn't contain any of the strings from those nibs).
If I put NewDialog.xib into my.app, I see its strings in the .wg.
It seems like I be putting the source code form of the
"<language>.lproj" folders into _OldBase, but none of the docs
say that.
Can someone point me at a discussion of how to use AppleGlot in
the presence of XIB files?
And (if it's not covered by default): What to do when the
previous shipped app had a non-compiled Foo.nib, and the about-to-
ship app has Foo.xib in the souces, and thus a compiled Foo.nib
in the built app.
I believe the file names in _OldBase, _NewBase, and _OldLoc need
to match. It sounds like your files in _OldBase and _OldLoc are
probably .nib files, but you're files in _NewBase are .xib files.
You can upgrade the files in _OldBase and _OldLoc to .xib files
with something like this:
cd _OldLoc
find . -name "*.nib" -type d -exec ibtool --upgrade {} \;
cd _OldBase
find . -name "*.nib" -type d -exec ibtool --upgrade {} \;
Thanks for the suggestion, Jon. All the places have .nib files,
but the ones in _Newbase are compiled .nibs.
But as yours is the best suggestion I got, I'll try upgrading the
nibs in _OldBase and _OldLoc to .xibs and copying .xibs into the
built product in _Newbase.
It sounds like you are localizing the built product, rather than the
source. If that's the case, you can enable IBC_FLATTEN_NIBS = YES in
your build settings. The build settings UI presents IBC_FLATTEN_NIBS
as "Flatten Compiled XIB Files" in the "Interface Builder XIB
Compiler" section. Turning that option on will cause the built NIB
files to still be editable by IB and ibtool, which will allow
AppleGlot to process them.
You should not ship NIB files built this way. If you do, they will
work, but they're also much larger than the completely stripped NIB
files that you get when this build setting is turned on.
Yes, I've been using the built product. Isn't that the way it's always
been done?
I've come to the conclusion that I'm supposed to use the source
versions of xibs and nibs. So after copying built versions of the
app into _OldBase, _OldLoc, and _NewBase, I'll replace any nib or xib
in xx.lproj/ with the contents from my source tree.
Sound right? If so, any other resources that need to be in source form?
BTW, I tried the IBC_FLATTEN_NIBS setting and found it's a little
different than you describe:
1) it's YES (on) by default (and was on for me)
2) for shipping, "on" is right. the nibs are flat, small, and not
editible.
3) for localizing, "off" is right. the nibs are bundles, bigger, and
editable.
I played with "ibtool --upgrade" today and found that it fails to
convert built nibs if the nib has a plugin dependency. No amount of
"--plugin" helps. That was what makes me think source form of nibs
and xibs are the way to go.
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden