我想知道是否有一种方法可以使用“默认”文本域(“WordPress”或“default”)来翻译标签。E、 g我有以下代码:
// Register Custom Taxonomy
function custom_taxonomy() {
$labels = array(
\'name\' => _x( \'Press category\', \'Taxonomy General Name\', \'my_text_domain\' ),
\'singular_name\' => _x( \'Press category\', \'Taxonomy Singular Name\', \'my_text_domain\' ),
\'menu_name\' => __( \'Pressekateorien\', \'my_text_domain\' ),
\'all_items\' => __( \'All Items\' ),
\'parent_item\' => __( \'Parent Item\' ),
\'parent_item_colon\' => __( \'Parent Item:\' ),
\'new_item_name\' => __( \'New Item Name\' ),
\'add_new_item\' => __( \'Add New Item\' ),
\'edit_item\' => __( \'Edit Item\' ),
\'update_item\' => __( \'Update Item\' ),
\'view_item\' => __( \'View Item\' ),
\'separate_items_with_commas\' => __( \'Separate items with commas\' ),
\'add_or_remove_items\' => __( \'Add or remove items\' ),
\'choose_from_most_used\' => __( \'Choose from the most used\' ),
\'popular_items\' => __( \'Popular Items\' ),
\'search_items\' => __( \'Search Items\' ),
\'not_found\' => __( \'Not Found\' ),
);
$args = array(
\'labels\' => $labels,
\'hierarchical\' => true,
\'public\' => true,
\'show_ui\' => true,
\'show_admin_column\' => true,
\'show_in_nav_menus\' => true,
\'show_tagcloud\' => false,
);
register_taxonomy( \'category_press\', array( \'press\' ), $args );
}
// Hook into the \'init\' action
add_action( \'init\', \'custom_taxonomy\', 0 );
如您所见,我只翻译了3个字符串(“名称”、“单数名称”和“菜单名称”,使用my\\u text\\u domain”,其他字符串应使用WordPress在后端使用的默认文本域进行翻译)。例如,WPML告诉我有一个WordPress文本域。我也尝试过使用它,但默认或WordPress都不起作用,例如,我尝试了:
\'all_items\' => __( \'All Items\', \'WordPress\' ), // doesn\'t work
\'parent_item\' => __( \'Parent Item\', \'default\' ), // doesn\'t work
有什么提示吗?
谢谢