I got a multilingual website. Each domein has its own language. Sometimes i would like to echo one sentence in multiple languages. I'm using wordpress as site engine.
Does anyone know if something like this is possible with gettext?
<?php
echo __('some text', 'en_EN'); // echo this string in English.
echo __('some text', 'nl_NL'); // echo this string in Dutch.
echo __('some text', 'de_DE'); // echo this string in German.
?>
You have to use API for translating the language, as well your function will take three parameters not two parameters, Like from which language to which language then the sentence which you want to translate.
You can use itranslate4 which is easy to use and having below api which fulfills your requirement.
$objTranslation = $api->translate("en", "de",
array("I need to be translated to German") );