2014-06-10 47 views
2

我在項目中使用JMS Translation Bundle(https://github.com/schmittjoh/JMSTranslationBundle)。JMS Translation Bundle @Ignore

我有這個函數,它返回一個數組,每個標籤之前都有@Ignore。但即使存在@Ignore,JMS也會生成翻譯密鑰。

private function getStatusSelect() 
{   
    return array(
     "URLverify"=>array(
      'label' => /** @Ignore */'Certificates left', 
      'url' => $this->generateUrl('admin_liste_verif_ready'), 
     ),   
     "URLlistToAccept"=>array(
      'label' => /** @Ignore */'List to accept', 
      'url' => $this->generateUrl('admin_liste_verif'), 
     ), 
     "URLaccepted"=>array(
      'label' => /** @Ignore */'Accepted', 
      'url' => $this->generateUrl('admin_liste_index_accepted_action'), 
     ), 
     "URLrejected"=>array(
      'label' => /** @Ignore */'Rejected', 
      'url' => $this->generateUrl('admin_liste_index_rejected_action'), 
     ),       
    ); 
} 

在我的代碼@Ignore中的很多地方是完全正常工作,但不是在這種情況下。

你知道爲什麼嗎?

感謝您

BOUFFE

+0

簽出此「打開請求」(https://github.com/schmittjoh/JMSTranslationBundle/pull/194) – ferdynator

回答

2

我一直認爲你應該鍵之前添加此。 JMSTranslationBundle查找「標籤」鍵並嘗試從中提取翻譯。 (與關鍵「選擇」相同)。請嘗試以下操作:

private function getStatusSelect() 
{   
    return array(
     "URLverify" => array(
      /** @Ignore */ 
      'label' => 'Certificates left', 
      'url' => $this->generateUrl('admin_liste_verif_ready'), 
     ), 
     // ... 
    ); 
}