Locale::Maketext vs Locale::MakePhrase [was: HTML::Template and Locale::Maketext]

"Mathew Robertson" <[email protected]>
Newsgroups gmane.comp.lang.perl.modules.html-template
Organization RedSheriff
Message-ID <0dee01c56299$b9947600$a901000a@mat>
> For example you could use {{ ... }} to hide <TMPL_VAR EXPR=maketext('...')>. This could yield to:
>
>     <p>{{We have [quant,_1,visitor] today,, visitor_count}}></p> </body>


The syntax of:

    We have [quant,_1,visitor] today

was one of the my dislikes of Locale::Maketext.

Locale::Maketext assumes that the programmer knows:
a) the method to call; this case 'quant' (is there ever any other method to call?)
b) that _1 applies to the word 'visitor' - in reality the sales department may not like the wording that was chosen by the programmer.

It also compile-caches the result so that the only way to change the value, it to re-start the Perl interpreter.


With Locale::MakePhrase, it contains an expression engine so that the translator can do the equivalent of:

   _1 == 0    : "No visitors"
   _1 == 1    : "Only one visitor"
   ...

ie: it scarifices CPU cycles, to allow the expressions to be changed at runtime.

Mathew


-------------------------------------------------------
This SF.Net email is sponsored by Yahoo.
Introducing Yahoo! Search Developer Network - Create apps using Yahoo!
Search APIs Find out how you can build Yahoo! directly into your own
Applications - visit http://developer.yahoo.net/?fr=offad-ysdn-ostg-q22005
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.