rename a language locally

This commit is contained in:
John Bintz 2009-08-14 07:09:37 -04:00
parent 8b270bb1ed
commit 8baeead4fc
2 changed files with 12 additions and 0 deletions

View File

@ -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);
}

View File

@ -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')),
),
);
}