From f8bc0a40fe9596b441691ceed6f2c94d24938a0d Mon Sep 17 00:00:00 2001 From: Andy Staudacher Date: Fri, 17 Apr 2009 02:19:56 +0000 Subject: Fix for ticket 203: Don't interpolate the translation string for the l10n client translation input field --- core/controllers/l10n_client.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'core') 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); -- cgit v1.2.3