我知道有在Zend_Locale_Data一個LDML條目基於區域佈局方向:如何從Zend_Locale檢索佈局方向?
<layout>
<orientation characters="right-to-left"/>
</layout>
但我不知道該如何找回它。我試過這個:
Zend_Locale::getTranslationList('layout');
在返回的數組中我找不到這個信息。哪裏有問題?使用
我知道有在Zend_Locale_Data一個LDML條目基於區域佈局方向:如何從Zend_Locale檢索佈局方向?
<layout>
<orientation characters="right-to-left"/>
</layout>
但我不知道該如何找回它。我試過這個:
Zend_Locale::getTranslationList('layout');
在返回的數組中我找不到這個信息。哪裏有問題?使用
方向信息位於返回數組中的characters
和lines
條目中。如果這些條目是空的,那麼Zend_Locale沒有任何關於該區域的方向的信息,這意味着它是「正常」(字符從左到右,從上到下)。
例如,調用getTranslationList爲阿拉伯語:
Zend_Locale::getTranslationList('layout', 'ar');
返回與characters
組陣列以'right-to-left'
,和lines
空白。
在另一方面,與「mn_Mong_CN」的區域設置相同的呼叫返回與characters
設置爲'top-to-bottom'
和lines
集到'left-to-right'
陣列。
編輯
使用try Zend_Locale_Data::getList('en_US', 'layout')
你的課程的語言環境。
更新爲getList
。我並不是那麼熟悉。只是想幫助。
拋出異常。佈局沒有被定義爲此功能的關鍵。 –