Issue #1830848 by mtunay: Convert the 'translation_language_type()' variable to CMI.

8.0.x
catch 2012-11-06 13:46:54 +00:00
parent b75a02832a
commit 7f45c50c5e
4 changed files with 15 additions and 4 deletions

View File

@ -0,0 +1 @@
language_type: "language_interface"

View File

@ -15,3 +15,14 @@ function translation_update_8000() {
->condition('permission', 'translate content')
->execute();
}
/**
* Moves "translation_language_type" from variable to config.
*
* @ingroup config_upgrade
*/
function translation_update_8001() {
update_variables_to_config('translation.settings', array(
'translation_language_type' => 'language_type',
));
}

View File

@ -259,7 +259,7 @@ function translation_node_view(Node $node, $view_mode) {
// only for configurable language types and interface language is the only
// configurable language type in core, we use it as default. Contributed
// modules can change this behavior by setting the system variable below.
$type = variable_get('translation_language_type', LANGUAGE_TYPE_INTERFACE);
$type = config('translation.settings')->get('language_type');
$custom_links = language_negotiation_get_switch_links($type, "node/$node->nid");
$links = array();
@ -537,8 +537,7 @@ function translation_path_get_translations($path) {
* Replaces links with pointers to translated versions of the content.
*/
function translation_language_switch_links_alter(array &$links, $type, $path) {
$language_type = variable_get('translation_language_type', LANGUAGE_TYPE_INTERFACE);
$language_type = config('translation.settings')->get('language_type');
if ($type == $language_type && preg_match("!^node/(\d+)(/.+|)!", $path, $matches)) {
$node = node_load((int) $matches[1]);

View File

@ -32,7 +32,7 @@ function translation_node_overview(Node $node) {
$translations = array($node->langcode => $node);
}
$type = variable_get('translation_language_type', LANGUAGE_TYPE_INTERFACE);
$type = config('translation.settings')->get('language_type');
$header = array(t('Language'), t('Title'), t('Status'), t('Operations'));
foreach (language_list() as $langcode => $language) {