Multilanguage site and custom theme: file or t() ?
In a multilanguage file for the themed output (called via theme_render_template) is better the use of one file for each language or one file for all with t() function ? I think one file for each language. M. -- Michel 'ZioBudda' Morelli michel@ziobuddalabs.net Consulenza sistemistica in ambito OpenSource. Sviluppo applicazioni web dinamiche (LAMP+Ajax) Telefono: 0200619074 Telefono Cell: +39-3939890025 -- Fax: +39-0291390660 http://www.ziobudda.net ICQ: 58351764 http://www.ziobuddalabs.it Skype: zio_budda http://www.ziodrupal.net MSN: michel@ziobuddalabs.it JABBER: michel@ziobuddalabs.it
You probably want to pass your strings in a t function. Maintaining multiple identical files makes no sense. Michel Morelli wrote:
In a multilanguage file for the themed output (called via theme_render_template) is better the use of one file for each language or one file for all with t() function ?
I think one file for each language.
M.
On Thu, 25 Jun 2009 17:44:11 +0200 Michel Morelli <michel@ziobuddalabs.it> wrote:
In a multilanguage file for the themed output (called via theme_render_template) is better the use of one file for each language or one file for all with t() function ?
I think one file for each language.
Definitively the later. With the later you have: - automatic fall-back to the main language - import/export through .po files (and other systems) - reuse/separation of layout/language - ... I bet there is more, but the above should be enough Unless there are reasons to present really different layout/informations to different audience and building up conditional logic looks "complicated" you'd better stick with t(). I've used the template system to hide some site dependent business logic... but that's just a coding debt I had to pay later. Using template for supporting languages may seems to offer some advantage when your support for different languages is unbalanced... but it will bite you back. -- Ivan Sergio Borgonovo http://www.webthatworks.it
participants (3)
-
Ivan Sergio Borgonovo -
Michel Morelli -
זהר סטולר