2014-02-07 1 views
0

ZF1을 사용하면 복수형이있는 경우 일 때 배열을 $this->translate()으로 전달할 수 있습니까? 단 복수형 (즉 단수)을 원한다면?ZF1의 첫 번째 복수형 변환

이렇게하면 : $this->translate('Tournament'), 문자열 대신 배열을 반환합니다.

그렇다면 다음과 같이해야합니다. $this->translate(array('Tournament', 'Tournaments', 1)) 두 번째 양식이 사용되지 않으므로 매우 바보입니다.

답변

0

내가 알 수있는 한, 그렇게 작동합니다. :-(

나는 다음과 같이 Zend_Translate_Adapter를 업데이트하는거야 :

에서 :

 // return original translation 
     if ($plural === null) { 
      $this->_routed = array(); 
      return $this->_translate[$locale][$messageId]; 
     } 

사람 :

 // return original translation 
     if ($plural === null) { 
      $this->_routed = array(); 

      $translation = $this->_translate[$locale][$messageId]; 

      if (is_array($translation)) { 
       return $translation[0]; 
      } 

      return $translation; 
     }