Posted by Paul Haddad
Tue, 28 Nov 2006 03:39:00 GMT
I think I got most of the localization stuff cleaned up. The semi-automated process is conceptually fairly simple.
- Create .nib.strings files from each of the English nibs (these are basically generated with the nibtool -L command)
- Create a “dictionary” of all localized strings
- Update all localized strings files, by getting all the keys from the English version and setting the value to either, the current value, any localized value from the dictionary or the english key.
- Generate a list of strings that aren’t localized (this is basically to make sure nothing is missed).
So this basically creates a bunch of .nib.strings files (one/nib/locale). These then get fed in at build time to nibtool to generate the actual nibs from the English version and the locale strings file.
For the most part I was able to make the English nib elements large enough to accommodate the Japanese strings, though there are a few nibs where this couldn’t be done. For those I created partial nibs that contain just the offending elements and used the nibtool—incremental flag to properly size them.
The only thing I’d like to look at in the future, purely as an optimization step, is to generate the localized nibs on the fly from the English ones. Basically ship with the .nib.strings files and no nibs and have the English nibs translated as they are needed. This should make a pretty big difference size wise on the shipped executable once there are more then a few localizations.
I’m including the scripts I use below in case they are interesting to anyone. They are all written in Ruby and the only other dependency is the plist gem. They aren’t really all fully polished but should serve as a good starting point.
Tags localization, nibs, nibtool, pthpasteboard | no comments | no trackbacks
Posted by Paul Haddad
Sun, 19 Nov 2006 21:22:46 GMT
Version PTHPB 4.0.1 should be here tom. The big change here is that its localized in Japanese.
Localization is one of those things I think needs to be improved in OS X. Sure its real easy to do a localization, but maintenance tends to be a nightmare. Standard .strings are pretty easy to deal with, but nibs get ugly real fast.
The way I’ve dealt with .nibs in the past is to use Localized strings to generate a new Localize nib from the original English nib. This works, but the big problem is that you end up having to make the English nibs be able to handle larger strings. Which means that a lot of times the English rev looks bad.
There’s an “—incremental” flag to nibtool that might help things out, I’ll have to play with it. My preference however would be to separate the localizations from the app bundles. I think it’d be neat if each .nib was versioned and the Cocoa code was smart enough to read in localized versions that match the English/dev revs.
Stick the localizations in App Support or Library dirs and have code smart enough to check/update the Localizers home pages for new revs. I think something like that could really decouple the code from the localizations and I wish Apple would create some nice frameworks to working with this.
I’ll probably play around with some of this for the 4.1.0 release or this stuff is going to drive me crazy real fast.
no comments | no trackbacks
Posted by Paul Haddad
Tue, 14 Nov 2006 05:46:00 GMT
Yes I know another blog and a generic looking typo one at that. But people seem to like them and this one was fairly easy to setup.
So today marked the release of PTHPasteboard 4.0, after what seemed like a never ending process of getting everything polished, help written, bugs fixed, icons commissioned, etc..
I think the entire release came out rather well, the Syncing stuff is particularly useful if you switch between machines several times a day like I do. Its one of those features you almost don’t realize is there, but you miss it if its gone.
So now its on to release 4.1. I think the main things that’ll be added to that one are Japanese localization (though that might come in at 4.0.1), tweaks like deleting individual items from the Main window, customizing the toolbar, auto-update (as opposed to just checking) and what I hope will be a cool new way to select items to paste.
Feel free to comment if you find this blog actually useful. :^)
3 comments | no trackbacks