develooper Front page | perl.perl5.porters | Postings from July 2010

Re: [perl #76402] [PATCH] Locale::Maketext One Sided Lexicons

Thread Previous | Thread Next
Jesse Vincent
July 8, 2010 08:33
Re: [perl #76402] [PATCH] Locale::Maketext One Sided Lexicons
Message ID:

On Tue  6.Jul'10 at  9:43:59 -0700, Todd Rinaldo wrote:
> # New Ticket Created by  Todd Rinaldo 
> # Please include the string:  [perl #76402]
> # in the subject line of all future correspondence about this issue. 
> # <URL: >
> This is a bug report for perl from,
> generated with the help of perlbug 1.39 running under perl 5.12.1.
> -----------------------------------------------------------------
> [Please describe your issue here]
> This patch with tests provides One Sided Lexicons
> Setting $Onesided = 1 in your package treats the class's %Lexicon as one sided.
> What that means is if the hash's keys and values will be the same (IE your main
> Lexicon) you can specify it in the key only and leave the value blank.
> The advantages are a smaller file, less prone to mistyping or mispasting, and most
> important of all someone translating it can simply copy it into their module and
> enter their translation instead of having to remove the value first.

Locale::Maketext already has functionality to do what you want. 
The _AUTO meta-entry in %Lexicon allows fallthrough to use the requested
$key as the $value.  And then your base lexicon uses even _less_ memory.

The value of having your translators hand-copy the content of your
default lexicon doesn't feel like much of a win for the added


Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About