私はこのリンクの指示にうまく従いました。今では私のウェブは「traslate()」呼び出しに「locale」を置く必要なしに多言語になっています。ただし、呼び出すたびにTextDomainを配置する必要があります。
$this->traslate("Hello", __NAMESPACE__) //where __NAMESPACE__ is the text domain.
「traslate()」ヘルパーの各呼び出しに配置するのではなく、onBootstrapメソッドにTextDomainを設定したいと思います。setTextDomainメソッドを試しましたが、存在しません。誰かがそれをどのように知っていますか?
onBootStrapコードは次のとおりです。
.....//Code for define $locale.
$sm = $e->getApplication()->getServiceManager();
$translator = $sm->get('translator');
$translator->setLocale($locale);
$traslator->SetTextDomain($textdomain); //This line not work!!!!!