我在尝试显示分类名称的正确翻译时遇到问题,特别是在post manager页面中。在应该显示翻译成西班牙语的分类法名称的地方,它会以纯英语显示默认名称。
为了说明我的问题,这里有一个example.
同样的事情也发生在popular_items
元素,但其余部分似乎工作正常,即使在菜单中显示分类名称时也是如此。
这是我的代码,您可以看看它是如何完成的:
function create_entry_level_taxonomy() {
$labels = array(
\'name\' => _x( \'Levels\', \'dpelt\' ),
\'singular_name\' => _x( \'Level\', \'dpelt\' ),
\'search_items\' => __( \'Search Level\', \'dpelt\' ),
\'popular_items\' => __( \'Popular Levels\' ),
\'all_items\' => __( \'All Levels\', \'dpelt\' ),
\'parent_item\' => __( \'Parent Level\', \'dpelt\' ),
\'parent_item_colon\' => __( \'Parent Level:\', \'dpelt\' ),
\'edit_item\' => __( \'Edit Level\', \'dpelt\' ),
\'update_item\' => __( \'Update Level\', \'dpelt\' ),
\'add_new_item\' => __( \'Add New Level\', \'dpelt\' ),
\'new_item_name\' => __( \'New Level Name\', \'dpelt\' ),
\'not_found\' => __( \'No levels found.\' ),
\'menu_name\' => __( \'Levels\', \'dpelt\' ),
);
register_taxonomy(\'entry_level\', array(\'post\'), array(
\'hierarchical\' => true,
\'labels\' => $labels,
\'show_ui\' => true,
\'show_admin_column\' => true,
\'query_var\' => true,
\'rewrite\' => array( \'slug\' => \'entry_level\' ),
)
);
}
提前谢谢,伙计们:)