public function normalize_fields($args)
{
$args = (array) $args;
if (isset($args['translations']) && is_array($args['translations'])) {
// Reduce range by one since we're starting at 0, see GH#516.
foreach (range(0, $this->get_static('number_of_plural_translations') - 1) as $i) {
if (isset($args['translations'][$i])) {
$args["translation_{$i}"] = $args['translations'][$i];
}
}
unset($args['translations']);
}
// Reduce range by one since we're starting at 0, see GH#516.
foreach (range(0, $this->get_static('number_of_plural_translations') - 1) as $i) {
if (isset($args["translation_{$i}"])) {
$args["translation_{$i}"] = $this->fix_translation($args["translation_{$i}"]);
}
}
if (gp_array_get($args, 'warnings') == array()) {
$args['warnings'] = null;
}
return $args;
}