summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--core/libraries/I18n.php5
-rw-r--r--core/tests/I18n_Test.php8
2 files changed, 6 insertions, 7 deletions
diff --git a/core/libraries/I18n.php b/core/libraries/I18n.php
index a2d412f8..edf6a6ac 100644
--- a/core/libraries/I18n.php
+++ b/core/libraries/I18n.php
@@ -168,9 +168,8 @@ class I18n_Core {
}
public static function get_message_key($message) {
- // If message is an array (plural forms), use the first form as message id.
- $key = is_array($message) ? array_shift($message) : $message;
- return md5($key, true);
+ $as_string = is_array($message) ? implode('|', $message) : $message;
+ return md5($as_string, true);
}
private function interpolate($locale, $string, $values) {
diff --git a/core/tests/I18n_Test.php b/core/tests/I18n_Test.php
index 4a353538..75170a1d 100644
--- a/core/tests/I18n_Test.php
+++ b/core/tests/I18n_Test.php
@@ -64,15 +64,15 @@ class I18n_Test extends Unit_Test_Case {
public function translate_plural_other_test() {
$result = $this->i18n->translate(array('one' => 'One item has been added',
- 'other' => '%count items have been added.'),
- array('count' => 5));
+ 'other' => '%count elements have been added'),
+ array('count' => 5));
$this->assert_equal('5 Elemente wurden hinzugefuegt.', $result);
}
public function translate_plural_one_test() {
$result = $this->i18n->translate(array('one' => 'One item has been added',
- 'other' => '%count items have been added.'),
- array('count' => 1));
+ 'other' => '%count elements have been added'),
+ array('count' => 1));
$this->assert_equal('Ein Element wurde hinzugefuegt.', $result);
}