简体   繁体   中英

Zend_Translate with multidimesional arrays

I'm using Zend_Translate in my application with the array adapter.

My code looks like this:

$english = array(
    'city' => 'City',
    'countryCode' => 'Country Code'
);

$translate = new Zend_Translate(
    array(
        'adapter' => 'array',
        'content' => $english,
        'locale'  => 'en'
    )
);

Is there a way to use multimensional arrays, in order to split the translation strings into categories like the below example?

 $english = array(
    'country' => array(
        'city' => 'City',
        'countryCode' => 'Country Code'
    )
 );

So I could call something like this:

$translate->setLocale('en');
echo $translate->_('country/city');

我改变了主意,现在我正在像AsTeR所说的那样使用TMX。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM