Permalink
Browse files

Renaming catalog category `message.plural` to `message.pluralRule`.

  • Loading branch information...
1 parent 481e7dd commit 12569744e1037be3aa7cdf8e896b163cd64d35e7 @davidpersson davidpersson committed with gwoo Mar 15, 2010
@@ -173,10 +173,10 @@ protected static function _translated($id, $count, $locale, array $options = arr
return $page[$id];
}
- if (!isset($page['plural']) || !is_callable($page['plural'])) {
+ if (!isset($page['pluralRule']) || !is_callable($page['pluralRule'])) {
return null;
}
- $key = $page['plural']($count);
+ $key = $page['pluralRule']($count);
if (isset($page[$id][$key])) {
return $page[$id][$key];
@@ -228,8 +228,8 @@ public function testWriteReadMergeConfigurations() {
*/
public function testDataTypeSupport() {
$data = function($n) { return $n == 1 ? 0 : 1; };
- Catalog::write('message.plural', 'en', $data, array('name' => 'runtime'));
- $result = Catalog::read('message.plural', 'en');
+ Catalog::write('message.pluralRule', 'en', $data, array('name' => 'runtime'));
+ $result = Catalog::read('message.pluralRule', 'en');
$this->assertEqual($data, $result);
$data = array('fish', 'fishes');
@@ -24,7 +24,7 @@ public function setUp() {
'runtime' => array('adapter' => new Memory())
));
$data = function($n) { return $n == 1 ? 0 : 1; };
- Catalog::write('message.plural', 'root', $data, array('name' => 'runtime'));
+ Catalog::write('message.pluralRule', 'root', $data, array('name' => 'runtime'));
$this->_backups['environment'] = Environment::get('test');
Environment::set('test', array('locale' => 'en'));
@@ -136,7 +136,7 @@ public function testTranslateFail() {
$this->assertNull($result);
$data = 'not a valid pluralization function';
- Catalog::write('message.plural', 'root', $data, array('name' => 'runtime'));
+ Catalog::write('message.pluralRule', 'root', $data, array('name' => 'runtime'));
$result = Message::translate('catalog', array('locale' => 'de'));
$this->assertNull($result);
@@ -149,7 +149,7 @@ public function testTranslateScope() {
Catalog::write('message', 'de', $data, array('name' => 'runtime', 'scope' => 'test'));
$data = function($n) { return $n == 1 ? 0 : 1; };
- Catalog::write('message.plural', 'root', $data, array(
+ Catalog::write('message.pluralRule', 'root', $data, array(
'name' => 'runtime', 'scope' => 'test'
));

0 comments on commit 1256974

Please sign in to comment.