• Hi, now I am making a theme and translate it into zh-TW

    Now i’ve found a problem that translation (__()) is not working inside array, here is my PHP code:

    register_sidebar(array(
    	'name' => __('Right Sidebar', 'rflat'),
    	'id' => 'right',
    	'description' => __('This side bar will be on the right side of the page.', 'rflat'),
    	'before_widget' => '<div class="tools">',
    	'after_widget' => '</div>',
    	'before_title' => '<h3>',
    	'after_title' => '</h3>'
    ));

    and here is my .po code:

    #: functions.php:87 sidebar.php:17
    msgid "Right Sidebar"
    msgstr "右側工具欄"
    
    #: functions.php:89
    msgid "This side bar will be on the right side of the page."
    msgstr "本工具欄將顯示於頁面的右側"

    All of my other translation works great, but this one failed.

    Can anyone help me? Thanks!

    PS: here is my load_theme_textdomain code:

    /* BEGIN Theme Translation */
    function rflat_lang(){
    	load_theme_textdomain('rflat', get_template_directory() . '/lang');
    }
    add_action('after_setup_theme', 'rflat_lang');
    /* END Theme Translation */
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)

The topic ‘translation (__) not working in array?’ is closed to new replies.