summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndy Staudacher <andy.st@gmail.com>2009-04-17 02:19:56 +0000
committerAndy Staudacher <andy.st@gmail.com>2009-04-17 02:19:56 +0000
commitf8bc0a40fe9596b441691ceed6f2c94d24938a0d (patch)
tree50267051541ffda0b8f784410f2dc286e59a30f2
parentd8e91338734185d1bf67f0c84f429d33effce142 (diff)
Fix for ticket 203: Don't interpolate the translation string for the l10n client translation input field
-rw-r--r--core/controllers/l10n_client.php10
1 files changed, 8 insertions, 2 deletions
diff --git a/core/controllers/l10n_client.php b/core/controllers/l10n_client.php
index 68340ed2..80e9ef37 100644
--- a/core/controllers/l10n_client.php
+++ b/core/controllers/l10n_client.php
@@ -95,6 +95,8 @@ class L10n_Client_Controller extends Controller {
$string_list = array();
foreach ($calls as $call) {
list ($message, $options) = $call;
+ // Note: Don't interpolate placeholders for the actual translation input field.
+ // TODO: Use $options to generate a preview.
if (is_array($message)) {
// TODO: Handle plural forms.
// Translate each message. If it has a plural form, get
@@ -103,8 +105,12 @@ class L10n_Client_Controller extends Controller {
}
$source = $message;
$translation = '';
- if (I18n::instance()->has_translation($message, $options)) {
- $translation = I18n::instance()->translate($message, $options);
+ $options_for_raw_translation = array();
+ if (isset($options['count'])) {
+ $options_for_raw_translation['count'] = $options['count'];
+ }
+ if (I18n::instance()->has_translation($message, $options_for_raw_translation)) {
+ $translation = I18n::instance()->translate($message, $options_for_raw_translation);
}
$string_list[] = array('source' => $source,
'translation' => $translation);