[support] Localizing a template

John Fletcher net at twoedged.org
Fri Feb 27 13:01:24 UTC 2009


> First turn on the Locale module. Then, if your text is hardcoded, wrap 
> it in the t() PHP function as follows

Another important thing Francesco - make sure you write the strings with the
t() around them in English and then translate them as described by JP into
Italian. It doesn't work the other way around - source strings have to be in
English.

Not sure if you still will need to have different template files once you
know how to do this. But if you are in need of further customisation, it's
probably better to just stick with one template file but use the functions
available to check the current page language and then do an if/then
statement. I think page.tpl.php is automatically given a variable called
$language which tells you the current language being used.

Regards
John
Salt Websites internationalised web development
http://www.saltwebsites.com/



More information about the support mailing list