From: "Alex Povolotsky" <[email protected]>
Hello!
How do I define a macro for localization GLOBALLY? I don't like to add
MACRO to every template, nor I don't want to write c.localize() instead of
l()
Alex
I use the following settings in the app configuration file:
'View::TT' => {
PRE_PROCESS => ['locale_date_datetime.tt'],
};
And in the template locale_date_datetime.tt I put:
[% MACRO l(text,args) BLOCK; c.localize(text,args) || text; END ~%]
This template is loaded automaticly and in any other template I can use:
[% l('Text to translate') %]
or
[% l('Text to [_1] translate [_2]', [var1, var2]) %]
In the same template locale_date_datetime.tt I also use other global macros
for printing the DateTime dates in different formats so it can be used for
other things also...
Octavian
_______________________________________________
List: [email protected]
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/[email protected]/
Dev site: http://dev.catalyst.perl.org/