From: Teemu A. <te...@io...> - 2004-07-31 14:53:16
|
> OpenInteract2::I18N::Initializer > On line 138: > my ( $key, $msg ) = $line =~ /^\s*([\w\.]+)\s*=\s*(.*)$/; > Change to: > my ( $key, $msg ) = $line =~ /^\s*(\S.+\S)\s*=\s*(.*)$/; Well, I noticed that this breaks up if your key has a '=' character. Well, sorry =) I might as well look at how to hack the PO support in which fixes these sort of problems instead of trying to fix this home-grown message file format too extensively. Btw., if the key has a ' character (Like "I don't know"), it breaks up the I18N::Initializer on line 221 (btw. nice use of TT for code generation here). Change: '[% msg_key %]' => qq{[% messages.$msg_key %]}, to: qq{[% msg_key %]} => qq{[% messages.$msg_key %]}, Well, I wonder what happens if the message or the key has characters { or }... ;) Btw., I thought about the PO support a while, it would be nice if the package translation could be maintained as .po files under locale/ or something and upon package installation the .po files are compiled as .mo and put into usual places. Alternative option is to rely on the package maintainer to provide both: po files for translators, compiled mo files for the application. > if ( /_msg\(.*?['"](.+?)['"]/ ) { Well, this line in my script actually does not work if the string in your perl code contains a character ' or ".. oobs. -- -------------- Teemu Arina Dicole project http://www.dicole.org |