Asterix
Asterix

Reputation: 29

Cakephp 2.x. How can I get translation from specific .po file?

is there a way to get a translation from a .po file with a specific language?

For example I would like to get the English translation from a .po file even though my default cake language is set to Greek.

Of course I could change the default cake language setting to English and then back to Greekbut I don't find this efficient.

Thanks

Upvotes: 0

Views: 374

Answers (1)

nIcO
nIcO

Reputation: 5001

The __() function uses the I18n::translate() function internally. So you could call it directly like this:

App::uses('I18n', 'I18n');
$translation = I18n::translate('το κείμενό μου', null, null, 6, null, 'eng');

Upvotes: 1

Related Questions