[htmltmpl] Locale::Maketext vs Locale::MakePhrase [was: HTML::Template and Locale::Maketext]
Brought to you by:
samtregar
From: Mathew R. <mat...@re...> - 2005-05-27 08:55:43
|
> For example you could use {{ ... }} to hide <TMPL_VAR = EXPR=3Dmaketext('...')>. 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 =3D=3D 0 : "No visitors" _1 =3D=3D 1 : "Only one visitor" ... ie: it scarifices CPU cycles, to allow the expressions to be changed at = runtime. Mathew |