2014-03-27 65 views
0

我似乎無法找到一種方法來設置閃存消息中的翻譯文本。 我正在使用JSMTranslationbundle進行翻譯。使用jmsTranslationBundle在Flash消息中設置翻譯的消息

這是我最好的拍攝。 ('驗證成功請求')*/$ this-> get('session') - > getFlashBag() - > set('message.success',$ this-> get('譯者) - >反式('checklist_instance.verifiaction_success'));。

但它只是在模板中返回我的密鑰。 任何想法?

非常感謝。

回答

0

您是否嘗試過在翻譯調用之前直接使用註釋?

$this->get('session')->getFlashBag()->set(
    /** @Desc("Verification successfully requested") */ 
    $this->get('translator')->trans('checklist_instance.verification_success') 
); 

這也可能是與JMSTranslationBundle一個問題,如果您使用的是非常非常老的版本(< 2012年2月)。

備註:您在翻譯密鑰中有拼寫錯誤(例如,驗證而不是驗證)。