Index: misc/drupal.js =================================================================== RCS file: /cvs/drupal/drupal/misc/drupal.js,v retrieving revision 1.41.2.4 diff -u -p -r1.41.2.4 drupal.js --- misc/drupal.js 21 Jul 2009 08:59:10 -0000 1.41.2.4 +++ misc/drupal.js 20 Jun 2010 18:08:06 -0000 @@ -150,7 +150,7 @@ Drupal.formatPlural = function(count, si else { args['@count['+ index +']'] = args['@count']; delete args['@count']; - return Drupal.t(plural.replace('@count', '@count['+ index +']')); + return Drupal.t(plural.replace('@count', '@count['+ index +']'), args); } }; Index: includes/locale.inc =================================================================== RCS file: /cvs/drupal/drupal/includes/locale.inc,v retrieving revision 1.174.2.13 diff -u -p -r1.174.2.13 locale.inc --- includes/locale.inc 28 May 2010 13:07:27 -0000 1.174.2.13 +++ includes/locale.inc 20 Jun 2010 18:08:08 -0000 @@ -2159,35 +2159,12 @@ function _locale_rebuild_js($langcode = } // Construct the array for JavaScript translations. - // We sort on plural so that we have all plural forms before singular forms. - $result = db_query("SELECT s.lid, s.source, t.plid, t.plural, t.translation FROM {locales_source} s LEFT JOIN {locales_target} t ON s.lid = t.lid AND t.language = '%s' WHERE s.location LIKE '%%.js%%' AND s.textgroup = 'default' ORDER BY t.plural DESC", $language->language); + // Only add strings with a translation to the translations array. + $result = db_query("SELECT s.lid, s.source, t.translation FROM {locales_source} s INNER JOIN {locales_target} t ON s.lid = t.lid AND t.language = '%s' WHERE s.location LIKE '%%.js%%' AND s.textgroup = 'default' AND t.translation IS NOT NULL", $language->language); - $translations = $plurals = array(); + $translations = array(); while ($data = db_fetch_object($result)) { - // Only add this to the translations array when there is actually a translation. - if (!empty($data->translation)) { - if ($data->plural) { - // When the translation is a plural form, first add it to another array and - // wait for the singular (parent) translation. - if (!isset($plurals[$data->plid])) { - $plurals[$data->plid] = array($data->plural => $data->translation); - } - else { - $plurals[$data->plid] += array($data->plural => $data->translation); - } - } - elseif (isset($plurals[$data->lid])) { - // There are plural translations for this translation, so get them from - // the plurals array and add them to the final translations array. - $translations[$data->source] = array($data->plural => $data->translation) + $plurals[$data->lid]; - unset($plurals[$data->lid]); - } - else { - // There are no plural forms for this translation, so just add it to - // the translations array. - $translations[$data->source] = $data->translation; - } - } + $translations[$data->source] = $data->translation; } // Construct the JavaScript file, if there are translations. Index: modules/locale/locale.install =================================================================== RCS file: /cvs/drupal/drupal/modules/locale/locale.install,v retrieving revision 1.27.2.3 diff -u -p -r1.27.2.3 locale.install --- modules/locale/locale.install 4 Mar 2010 00:15:28 -0000 1.27.2.3 +++ modules/locale/locale.install 20 Jun 2010 18:08:08 -0000 @@ -226,6 +226,24 @@ function locale_update_6006() { */ /** + * @defgroup updates-6.x-extra Locale updates for 6.x + * @{ + */ + +/** + * Fix Drupal.formatPlural(). + */ +function locale_update_6007() { + locale_inc_callback('_locale_invalidate_js'); + return array(); +} + +/** + * @} End of "defgroup updates-6.x-extra" + * The next series of updates should start at 7000. + */ + +/** * Implementation of hook_uninstall(). */ function locale_uninstall() {