Hi there,

There are a number of ways to implement multi-language support,
depending on your personal preference.


Dynamic content sometimes shouldn't be translated, other times it
should be translated.  eg: if you have the car company "Nissan", in
most languages you dont translate, but in Japanese you do.  The
exact circumstances of when to translate, will depend on your
application domain and the linguistic rules of the end-users' language.

One choice you will need to make is how frequently you will allow
updates to your translated strings.  This will determine whether you
need something like a database lookup, or a simple file containing a
relatively infrequently changing set of translations.


Static content is often a bit easier:

- translate the templates (containing the static text) into the
language of choice -> output the HTML content from the appropriate
template file.

- Use H::T::E to callback into a registered 'translate(..)' function
so that you can lookup translations.

- Use a version of H::T which has plugin support for more TMPL_xxx
tags, so that you can lookup translations.

The implementation that you use will depends on whether you have
access to a database to store translations in; and the "page render
time" of your application.  Eg: dynamic lookup of translations will
incur a small performance hit when generating the HTML page; using
H::T::E can be a big performance hit.


There are a few good Perl modules which may help you implement your
translation mechanism:

- Locale::Maketext
  - pros: fast
        : powerful per-language capabilities
  - cons: requires programmer input to implement language rules

- Locale::MakePhrase **
  - pros: powerful meta-language for implementing language rules
        : can use database, file or directory based backing stores
  - cons: slow - rules need to be evaluated

** Note: I wrote this package based on Locale::Maketext, so I may be
a little biased.


Example: Our application outputs 6 languages (English, Italian,
Spanish, Korean, Japanese, Chinese) as well as handling dialects
(en_us vs. en_au vs en), using one set of templates that dynamically
lookup translations from a database.

If you need further info, let me know.

Mathew

PS.  I am working currently working on (at a slow rate...) a module
which joins H::T with Locale::MakePhrase, so as to simplify some of
the user-space code for handling the language-translation TMPL_xxx tags.


Di Domenico, Michael wrote:
> Does anyone have any recommendations on the best way to implement multi
> language support using HTML::Template?  I saw a few posts from a few
> years ago on the subject in the mailing list archives, but otherwise I
> can't find much information on the web.  Unless I'm looking in the wrong
> places.
> 
>  
> 
> Thanks
> 
> 
> 
> 
> ------------------------------------------------------------------------
> 
> -------------------------------------------------------------------------
> Using Tomcat but need to do more? Need to support web services, security?
> Get stuff done quickly with pre-integrated technology to make your job easier
> Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> Html-template-users mailing list
> Html-template-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/html-template-users

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Html-template-users mailing list
Html-template-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/html-template-users

Reply via email to