rename a language locally
This commit is contained in:
parent
8b270bb1ed
commit
8baeead4fc
|
@ -65,6 +65,13 @@ class WhatDidTheySayAdmin {
|
|||
}
|
||||
}
|
||||
break;
|
||||
case "rename":
|
||||
if (isset($options['languages'][$language_info['code']])) {
|
||||
if (!empty($language_info['name'])) {
|
||||
$options['languages'][$language_info['code']]['name'] = $language_info['name'];
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
update_option('what-did-they-say-options', $options);
|
||||
}
|
||||
|
|
|
@ -32,6 +32,11 @@ class WhatDidTheySayAdminTest extends PHPUnit_Framework_TestCase {
|
|||
array('code' => 'de', 'action' => 'default'),
|
||||
array('en' => array('name' => 'English'), 'de' => array('name' => 'German', 'default' => true)),
|
||||
),
|
||||
array(
|
||||
array('en' => array('name' => 'English'), 'de' => array('name' => 'German')),
|
||||
array('code' => 'de', 'action' => 'rename', 'name' => 'Deutsch'),
|
||||
array('en' => array('name' => 'English'), 'de' => array('name' => 'Deutsch')),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue