> The three things I've found that make multi-language processing difficult
> with H::T are:
> 
> 1. One-time evaluation of a template's page-specific vars (so that
> subsequent displays can deal only in truly variable evaluations).
> 2. No way to say <tmpl_include name="constant_text_<tmpl_var name=LANG>"> to
> use language-specific text determined at run time.
> 3. No way to recurse variables which may have been evaluated with text that
> contains variables.
> 
> #2 and 3 are troubling because, if I can't pull in fragments of a page (for
> a language), then I'm likely to use "Locale::Maketext" to provide me with
> what may be lengthy fragments. If the fragments contain markup (like a
> link), then I'm stuck because the fragment's link will contain an attribute:
> "title=<TMPL_VAR NAME=LINK_TITLE_TEXT>" which will not be evaluated.
> 
> Feeding ->output back into new H::T objects can get around a lot of this. It
> would be a lot easier if those 3 features were available. They don't seem
> like they would require too much kludging.

FWIW, the company I work for uses H::T for page generation, and we handle an 
arbitrary number of languages.  Currently we have the product translated into 4 
different languages, and we have two more on the way.  H::T is used in 
combination with the Locale::MakePhrase package.... however, I use a modified 
H::T....

The reason that I made a custom package of H::T was that the only solutions 
that I could see to make language translations work was:
a) provide a different template for each language, then use the appropriate one 
based on users' language
b) use H::T::E with a callback function so that static template strings could 
run though the translation engine
b) modify H::T so that it supports custom TMPL_xxx tags so that static template 
strings could run through the translation engine

Points (a) and (b) require no changes to H::T, and I can say from experience 
that it works reasonably well.  However, I found:

   <TMPL_VAR EXPR="catalog('some static string')"> 

to be more nasty than:

   <TMPL_CATALOG "some static string">

so I chose to modify H::T.  In the process, I added some extra features to H::T.

If you need more info on how I do language translations, let me know...
Mathew


-------------------------------------------------------
The SF.Net email is sponsored by: Beat the post-holiday blues
Get a FREE limited edition SourceForge.net t-shirt from ThinkGeek.
It's fun and FREE -- well, almost....http://www.thinkgeek.com/sfshirt
_______________________________________________
Html-template-users mailing list
Html-template-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/html-template-users

Reply via email to