diff options
author | Andy Staudacher <andy.st@gmail.com> | 2009-01-15 10:02:41 +0000 |
---|---|---|
committer | Andy Staudacher <andy.st@gmail.com> | 2009-01-15 10:02:41 +0000 |
commit | e4a9b19bf9997f46203fbc18c696c63703a72625 (patch) | |
tree | c33f4cb354961eeba452f428dfa68c664bc3226f /core/libraries/I18n.php | |
parent | e53916dd0622e3db61d6a05ad0fe69e8d7c7f11a (diff) |
Changing t() placeholder syntax from {{replace_me}} to %replace_me.
Diffstat (limited to 'core/libraries/I18n.php')
-rw-r--r-- | core/libraries/I18n.php | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/core/libraries/I18n.php b/core/libraries/I18n.php index 0aa6652b..04176b75 100644 --- a/core/libraries/I18n.php +++ b/core/libraries/I18n.php @@ -68,7 +68,7 @@ class I18n_Core { /** * Translates a localizable message. * @param $message String|array The message to be translated. E.g. "Hello world" - * or array("one" => "One album", "other" => "{{count}} albums") + * or array("one" => "One album", "other" => "%count albums") * @param $options array (optional) Options array for key value pairs which are used * for pluralization and interpolation. Special keys are "count" and "locale", * the latter to override the currently configured locale. @@ -118,9 +118,13 @@ class I18n_Core { private function interpolate($locale, $string, $values) { // TODO: Handle locale specific number formatting. + + // Replace x_y before replacing x. + krsort($values, SORT_STRING); + $keys = array(); foreach (array_keys($values) as $key) { - $keys[] = "{{" . $key . "}}"; + $keys[] = "%$key"; } return str_replace($keys, array_values($values), $string); } |