From: Chris W. <ch...@cw...> - 2004-02-13 22:17:08
|
On Feb 13, 2004, at 2:15 PM, Teemu Arina wrote: > ... > For Chris, I would like to hear more about the final details how > internationalization is going to be implemented in the next release, > before I > start to work on my own =) I just posted updated docs to the SF site. http://openinteract.sourceforge.net/docs/oi2-snapshot/ In particular you want to read: http://openinteract.sourceforge.net/docs/oi2-snapshot/OpenInteract2/ Manual/I18N.shtml The thirty-second version: - We're using Locale::Maketext for everything - Every package can define a set of message files (normally in msg/); these use a slightly modified Java message bundle syntax (easy to write!) - All message files for all languages get read in at server startup and classes for Locale::Maketext generated from them - On every request OI determines what language you're using (customizable, of course) I don't have the template interaction there yet -- basically, TT2 will have two global functions in your template namespace: # Grab a message from the correct message bundle using # $message_key and interpolating any arguments as # necessary MSG( $message_key, [ arg1, arg2, ... ] ) # Return a Locale::Maketext handle LH() Programmatically you grab a Locale::Maketext handle from the request object: my $lh = CTX->request->language_handle; Let me know if you have any ideas/features/improvements in this area. I've tried to make it as easy as possible to ship localized applications by allowing the packages to define their own messages. And retrieving the messages is I think also pretty simple. I'm in the middle of creating english localization files all the packages shipped with OI2. Talk about a boring job... :-) Later, Chris -- Chris Winters Creating enterprise-capable snack systems since 1988 |