diff options
author | Angie Byron <webchick@24967.no-reply.drupal.org> | 2010-11-14 19:53:21 +0000 |
---|---|---|
committer | Angie Byron <webchick@24967.no-reply.drupal.org> | 2010-11-14 19:53:21 +0000 |
commit | a16b1d92c404d7af52e2ccd3277cb8b9bd81dc59 (patch) | |
tree | 46a6e98b418c1a303da56ae5501469d4ef5baf1c | |
parent | 3e610b85472fa06c825bc87121fac7ed44adc7d6 (diff) | |
download | brdo-a16b1d92c404d7af52e2ccd3277cb8b9bd81dc59.tar.gz brdo-a16b1d92c404d7af52e2ccd3277cb8b9bd81dc59.tar.bz2 |
#860154 by Zoltán Balogh, zserno, Gábor Hojtsy: Fixed Locale module does not import the plural forms from compact files.
-rw-r--r-- | includes/locale.inc | 4 | ||||
-rw-r--r-- | modules/locale/locale.test | 8 |
2 files changed, 8 insertions, 4 deletions
diff --git a/includes/locale.inc b/includes/locale.inc index 1019ba432..75e534395 100644 --- a/includes/locale.inc +++ b/includes/locale.inc @@ -609,7 +609,7 @@ function _locale_import_read_po($op, $file, $mode = NULL, $lang = NULL, $group = $context = "MSGID_PLURAL"; } elseif (!strncmp("msgid", $line, 5)) { - if ($context == "MSGSTR") { // End current entry, start a new one + if (($context == "MSGSTR") || ($context == "MSGSTR_ARR")) { // End current entry, start a new one _locale_import_one_string($op, $current, $mode, $lang, $file, $group); $current = array(); } @@ -627,7 +627,7 @@ function _locale_import_read_po($op, $file, $mode = NULL, $lang = NULL, $group = $context = "MSGID"; } elseif (!strncmp("msgctxt", $line, 7)) { - if ($context == "MSGSTR") { // End current entry, start a new one + if (($context == "MSGSTR") || ($context == "MSGSTR_ARR")) { // End current entry, start a new one _locale_import_one_string($op, $current, $mode, $lang, $file, $group); $current = array(); } diff --git a/modules/locale/locale.test b/modules/locale/locale.test index 6bc2fb757..321be44d7 100644 --- a/modules/locale/locale.test +++ b/modules/locale/locale.test @@ -612,7 +612,7 @@ class LocaleImportFunctionalTest extends DrupalWebTestCase { $this->assertRaw(t('The language %language has been created.', array('%language' => 'French')), t('The language has been automatically created.')); // The import should have created 7 strings. - $this->assertRaw(t('The translation was successfully imported. There are %number newly created translated strings, %update strings were updated and %delete strings were removed.', array('%number' => 7, '%update' => 0, '%delete' => 0)), t('The translation file was successfully imported.')); + $this->assertRaw(t('The translation was successfully imported. There are %number newly created translated strings, %update strings were updated and %delete strings were removed.', array('%number' => 9, '%update' => 0, '%delete' => 0)), t('The translation file was successfully imported.')); // This import should have saved plural forms to have 2 variants. $this->assert(db_query("SELECT plurals FROM {languages} WHERE language = 'fr'")->fetchField() == 2, t('Plural number initialized.')); @@ -815,6 +815,11 @@ msgstr "" "Content-Transfer-Encoding: 8bit\\n" "Plural-Forms: nplurals=2; plural=(n > 1);\\n" +msgid "One sheep" +msgid_plural "@count sheep" +msgstr[0] "un mouton" +msgstr[1] "@count moutons" + msgid "Monday" msgstr "lundi" @@ -2206,4 +2211,3 @@ class LocaleDateFormatsFunctionalTest extends DrupalWebTestCase { $this->assertText($french_date, t('French date format appears')); } } - |