Commit 522dd4b5 authored by Gábor Hojtsy's avatar Gábor Hojtsy

Issue #655048 by Gábor Hojtsy, gumanist, intuited, Albert Volkman: Plural...

Issue #655048 by Gábor Hojtsy, gumanist, intuited, Albert Volkman: Plural formula information was blanked when importing a poorly-formed .po file.
parent 0ef4b892
......@@ -1293,14 +1293,11 @@ function _locale_import_one_string($op, $value = NULL, $mode = NULL, $lang = NUL
// data untouched or if we don't have an existing plural formula.
$header = _locale_import_parse_header($value['msgstr']);
// Get the plural formula and update in database.
// Get and store the plural formula if available.
if (isset($header["Plural-Forms"]) && $p = _locale_import_parse_plural_forms($header["Plural-Forms"], $file->filename)) {
list($nplurals, $plural) = $p;
db_query("UPDATE {languages} SET plurals = %d, formula = '%s' WHERE language = '%s'", $nplurals, $plural, $lang);
}
else {
db_query("UPDATE {languages} SET plurals = %d, formula = '%s' WHERE language = '%s'", 0, '', $lang);
}
}
$headerdone = TRUE;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment