Plugin install: Make plugin groups translatable.

props ocean90 for initial patch.
fixes #29092.
Built from https://develop.svn.wordpress.org/trunk@29477


git-svn-id: http://core.svn.wordpress.org/trunk@29255 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Sergey Biryukov 2014-08-13 02:31:18 +00:00
parent a18c1f29a2
commit aed71de2d6

View File

@ -322,6 +322,12 @@ class WP_Plugin_Install_List_Table extends WP_List_Table {
'ul' => array(), 'ol' => array(), 'li' => array(), 'p' => array(), 'br' => array()
);
$plugins_group_titles = array(
'Performance' => _x( 'Performance', 'Plugin installer group title' ),
'Social' => _x( 'Social', 'Plugin installer group title' ),
'Tools' => _x( 'Tools', 'Plugin installer group title' ),
);
list( $columns, $hidden ) = $this->get_column_info();
$style = array();
@ -339,7 +345,10 @@ class WP_Plugin_Install_List_Table extends WP_List_Table {
// Display the group heading if there is one
if ( isset( $plugin['group'] ) && $plugin['group'] != $group ) {
if ( isset( $this->groups[ $plugin['group'] ] ) ) {
$group_name = translate( $this->groups[ $plugin['group'] ] ); // Does this need context?
$group_name = $this->groups[ $plugin['group'] ];
if ( isset( $plugins_group_titles[ $group_name ] ) ) {
$group_name = $plugins_group_titles[ $group_name ];
}
} else {
$group_name = $plugin['group'];
}