Skip to content
Snippets Groups Projects
Commit 522dd4b5 authored by Gábor Hojtsy's avatar Gábor Hojtsy
Browse files

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
No related branches found
No related tags found
No related merge requests found
...@@ -1293,14 +1293,11 @@ function _locale_import_one_string($op, $value = NULL, $mode = NULL, $lang = NUL ...@@ -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. // data untouched or if we don't have an existing plural formula.
$header = _locale_import_parse_header($value['msgstr']); $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)) { if (isset($header["Plural-Forms"]) && $p = _locale_import_parse_plural_forms($header["Plural-Forms"], $file->filename)) {
list($nplurals, $plural) = $p; list($nplurals, $plural) = $p;
db_query("UPDATE {languages} SET plurals = %d, formula = '%s' WHERE language = '%s'", $nplurals, $plural, $lang); 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; $headerdone = TRUE;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment