$view) { foreach ($view->display as $display_id => $display) { if (isset($display->display_options['metatags'][LANGUAGE_NONE])) { $needs_update[$view_id][$display->display_plugin][] = $display_id; } } } if (count($needs_update) > 0) { $t = get_t(); foreach ($needs_update as $view_id => $plugins) { foreach ($plugins as $plugin => $displays) { if (count($displays) > 1) { // If there are multiple displays using the same plugin type, we can't // update the context automatically, since the old name is ambiguous. drupal_set_message($t("The metatag translations for the displays %displays of the view %view can't be converted automatically. You need to resubmit the metatag options for those view displays and remove the old translations manually.", array( '%displays' => implode(', ', $displays), '%view' => $view_id, ))); } else { $old = 'metatag:metatag_views:' . $view_id . '_' . $plugin . ':*'; $new = 'metatag:metatag_views:' . $view_id . METATAG_VIEWS_CONTEXT_SEPARATOR . $displays[0] . ':*'; i18n_string_update_context($old, $new); } } } } }