Difference between revisions of "How to translate options in additional fields and text added with customizations"

From aMember Pro Documentation
Jump to: navigation, search
(Created page with "Create /amember/application/configs/site.php with this code: <source> //set up array of translataions $translations_ru = array( 'one' => 'Один', 'two' => 'Два' ...")
 
Line 11: Line 11:
 
//get global translate object
 
//get global translate object
 
$tr = Zend_Registry::get('Zend_Translate');
 
$tr = Zend_Registry::get('Zend_Translate');
$locale = $tr->getLocale(); //save current locale
+
$locale = $tr->getLocale(); //save current active locale
  
 
//add your new translations
 
//add your new translations

Revision as of 02:29, 19 November 2012

Create /amember/application/configs/site.php with this code:

//set up array of translataions
$translations_ru = array(
    'one' => 'Один',
    'two' => 'Два'
);
 
//get global translate object
$tr = Zend_Registry::get('Zend_Translate');
$locale = $tr->getLocale(); //save current active locale
 
//add your new translations
$tr->addTranslation(array(
    'adapter' => 'array',
    'content' => $translations_ru,
    'locale' => 'ru_RU',
));
 
//restore locale to previous state
$tr->setLocale($locale);