Re: [development] Translating database fields
You can do the opposite, define a tt function if the module doesn't exist, it keeps your code cleaner Met vriendelijke groeten, Peter Droogmans Attiks Ketsstraat 94 2140 Borgerhout peter@attiks.com 03-288 61 17 0497-44 44 77 -----Original Message----- From: mark burdett <mfburdett@gmail.com> Sent: woensdag 23 september 2009 18:40 To: development@drupal.org <development@drupal.org> Cc: jeremy@kerneltrap.org <jeremy@kerneltrap.org> Subject: Re: [development] Translating database fields On Wed, Sep 23, 2009 at 7:42 AM, Jennifer Hodgdon <yahgrp@poplarware.com> wrote:
There's a whole section in the Handbook on how to do this: http://drupal.org/node/303984
This is the specific page I used recently, http://drupal.org/node/304002 "Making your custom data translatable" Littering your module with if (module_exists('i18nstrings')) isn't so nice, so I'm hoping that a future version of core will provide a real API for string translation.. (where's the issue for this? :) --mark
Peter Droogmans wrote:
You can do the opposite, define a tt function if the module doesn't exist, it keeps your code cleaner
You need to do it this way: if (!module_exists('i18nstrings') && !function_exists('tt')) { function tt($string) { return $string; } } That way 2 modules trying to define tt() won't run over each other.
participants (2)
-
Earl Miles -
Peter Droogmans