0

I'm using Zend_Translated to translated all my strings

$translator->_('hello')

If my locale is in french this code will print "Bonjour".

When browsing the french version of the site i'd like to output some german text.

$translator->_('hello', array(locale=>'en'))

This will still output "Bonjour" but i'd like "Guten Tag"

How can I get a translation of a string in another language than the current locale?

murze
  • 4,015
  • 8
  • 43
  • 70

1 Answers1

1

If you would like to output some german text you should use

$translator->setLocale('de');
$translator->_('hello');

or

$translator->_('hello', 'de');

ie. either set the locale before translating or specify the locale string as 2nd parameter.

Refer to Handling languages for more information.

wimvds
  • 12,790
  • 2
  • 41
  • 42