Does anyone know whether it's possible to use t() with a non-English base language?
I have a site with a base language of Spanish, plus some other languages, and I need to put a couple of text strings into templates, so I use t(). I would like to write the strings into the templates in Spanish and then use the translation interface to translate them into other languages. Checking the Drupal API for t() seems to indicate strings must be entered into the DB in English and then translated into other languages.
Does anyone know the status on this? Can I use Spanish as input to the t() function?
John Fletcher
Salt Websites internationalised web development
Quoting John Fletcher net@twoedged.org:
Does anyone know whether it's possible to use t() with a non-English base language?
Yes.
Does anyone know the status on this? Can I use Spanish as input to the t() function?
See http://api.drupal.org/api/function/t
t('siempre te esperamos'); and a translator translates to 'you are welcome' for the English version.
-- Earnie http://r-feed.com Make a Drupal difference and review core patches.
Hi Earnie,
Have you ever done this? I had a look at the API page and it indicated to me that translation will only run for non-English languages. In particular this bit of code:
elseif (function_exists('locale') && $langcode != 'en') { $string = locale($string, $langcode); }
Also if I go to admin/build/translate/search, anything I find is not available to be translated into English; English is marked as the "built-in language".
Regards, John
-----Original Message----- From: support-bounces@drupal.org [mailto:support-bounces@drupal.org] On Behalf Of Earnie Boyd
Does anyone know the status on this? Can I use Spanish as input to the t() function?
See http://api.drupal.org/api/function/t
t('siempre te esperamos'); and a translator translates to 'you are welcome' for the English version.
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Hi,
I don't think so, as there is really no english locale that can be translated. In the past I have had to use an english variant like en- uk to translate english strings to english. Basically I found that you can't create a "en" translation.
I always thought that the default english should be called something like C as it is in UNIX.
It has been a while since I did anything with this so it may be different.
Gordon.
On 10/02/2009, at 4:34 AM, John Fletcher wrote:
Does anyone know whether it’s possible to use t() with a non-English base language?
I have a site with a base language of Spanish, plus some other languages, and I need to put a couple of text strings into templates, so I use t(). I would like to write the strings into the templates in Spanish and then use the translation interface to translate them into other languages. Checking the Drupal API for t() seems to indicate strings must be entered into the DB in English and then translated into other languages.
Does anyone know the status on this? Can I use Spanish as input to the t() function?
John Fletcher Salt Websites internationalised web development http://www.saltwebsites.com/ -- [ Drupal support list | http://lists.drupal.org/ ]