Commit 88b40cc6 authored by dawehner's avatar dawehner Committed by tim.plunkett

Issue #1605332 by dawehner, tim.plunkett: Adapt language integration to d8.

parent 472311d5
...@@ -289,7 +289,7 @@ function get_results_key() { ...@@ -289,7 +289,7 @@ function get_results_key() {
'build_info' => $build_info, 'build_info' => $build_info,
'roles' => array_keys($user->roles), 'roles' => array_keys($user->roles),
'super-user' => $user->uid == 1, // special caching for super user. 'super-user' => $user->uid == 1, // special caching for super user.
'language' => language(LANGUAGE_TYPE_INTERFACE)->langcode, 'langcode' => language(LANGUAGE_TYPE_INTERFACE)->langcode,
'base_url' => $GLOBALS['base_url'], 'base_url' => $GLOBALS['base_url'],
); );
foreach (array('exposed_info', 'page', 'sort', 'order', 'items_per_page', 'offset') as $key) { foreach (array('exposed_info', 'page', 'sort', 'order', 'items_per_page', 'offset') as $key) {
...@@ -312,7 +312,7 @@ function get_output_key() { ...@@ -312,7 +312,7 @@ function get_output_key() {
'roles' => array_keys($user->roles), 'roles' => array_keys($user->roles),
'super-user' => $user->uid == 1, // special caching for super user. 'super-user' => $user->uid == 1, // special caching for super user.
'theme' => $GLOBALS['theme'], 'theme' => $GLOBALS['theme'],
'language' => language(LANGUAGE_TYPE_INTERFACE)->langcode, 'langcode' => language(LANGUAGE_TYPE_INTERFACE)->langcode,
'base_url' => $GLOBALS['base_url'], 'base_url' => $GLOBALS['base_url'],
); );
......
...@@ -134,6 +134,15 @@ function init(&$view, &$display, $options = NULL) { ...@@ -134,6 +134,15 @@ function init(&$view, &$display, $options = NULL) {
$this->unpack_options($this->options, $options); $this->unpack_options($this->options, $options);
} }
// Convert the field_language and field_language_add_to_query settings.
$field_language = $this->get_option('field_language');
$field_language_add_to_query = $this->get_option('field_language_add_to_query');
if (isset($field_langcode)) {
$this->set_option('field_langcode', $field_language);
$this->set_option('field_langcode_add_to_query', $field_language_add_to_query);
$changed = TRUE;
}
// Mark the view as changed so the user has a chance to save it. // Mark the view as changed so the user has a chance to save it.
if ($changed) { if ($changed) {
$this->view->changed = TRUE; $this->view->changed = TRUE;
...@@ -487,11 +496,12 @@ function option_definition() { ...@@ -487,11 +496,12 @@ function option_definition() {
'default' => FALSE, 'default' => FALSE,
'bool' => TRUE, 'bool' => TRUE,
), ),
'field_language' => array( 'field_langcode' => array(
'default' => '***CURRENT_LANGUAGE***', 'default' => '***CURRENT_LANGUAGE***',
), ),
'field_language_add_to_query' => array( 'field_langcode_add_to_query' => array(
'default' => 1, 'default' => TRUE,
'bool' => TRUE,
), ),
// These types are all plugins that can have individual settings // These types are all plugins that can have individual settings
...@@ -1213,11 +1223,10 @@ function options_summary(&$categories, &$options) { ...@@ -1213,11 +1223,10 @@ function options_summary(&$categories, &$options) {
if (module_exists('language')) { if (module_exists('language')) {
$languages = array_merge($languages, language_list()); $languages = array_merge($languages, language_list());
} }
$field_language = array(); $options['field_langcode'] = array(
$options['field_language'] = array(
'category' => 'other', 'category' => 'other',
'title' => t('Field Language'), 'title' => t('Field Language'),
'value' => $languages[$this->get_option('field_language')], 'value' => $languages[$this->get_option('field_langcode')],
'desc' => t('All fields which support translations will be displayed in the selected language.'), 'desc' => t('All fields which support translations will be displayed in the selected language.'),
); );
...@@ -1607,17 +1616,17 @@ function options_form(&$form, &$form_state) { ...@@ -1607,17 +1616,17 @@ function options_form(&$form, &$form_state) {
); );
$languages = array_merge($languages, views_language_list()); $languages = array_merge($languages, views_language_list());
$form['field_language'] = array( $form['field_langcode'] = array(
'#type' => 'select', '#type' => 'select',
'#title' => t('Field Language'), '#title' => t('Field Language'),
'#description' => t('All fields which support translations will be displayed in the selected language.'), '#description' => t('All fields which support translations will be displayed in the selected language.'),
'#options' => $languages, '#options' => $languages,
'#default_value' => $this->get_option('field_language'), '#default_value' => $this->get_option('field_langcode'),
); );
$form['field_language_add_to_query'] = array( $form['field_langcode_add_to_query'] = array(
'#type' => 'checkbox', '#type' => 'checkbox',
'#title' => t('When needed, add the field language condition to the query'), '#title' => t('When needed, add the field language condition to the query'),
'#default_value' => $this->get_option('field_language_add_to_query'), '#default_value' => $this->get_option('field_langcode_add_to_query'),
); );
} }
else { else {
...@@ -2281,8 +2290,8 @@ function options_submit(&$form, &$form_state) { ...@@ -2281,8 +2290,8 @@ function options_submit(&$form, &$form_state) {
$this->set_option($section, $form_state['values'][$section]); $this->set_option($section, $form_state['values'][$section]);
break; break;
case 'field_language': case 'field_language':
$this->set_option('field_language', $form_state['values']['field_language']); $this->set_option('field_langcode', $form_state['values']['field_langcode']);
$this->set_option('field_language_add_to_query', $form_state['values']['field_language_add_to_query']); $this->set_option('field_langcode_add_to_query', $form_state['values']['field_langcode_add_to_query']);
break; break;
case 'use_ajax': case 'use_ajax':
case 'hide_attachment_summary': case 'hide_attachment_summary':
......
...@@ -223,26 +223,26 @@ function query($use_groupby = FALSE) { ...@@ -223,26 +223,26 @@ function query($use_groupby = FALSE) {
$this->ensure_my_table(); $this->ensure_my_table();
$this->add_additional_fields($fields); $this->add_additional_fields($fields);
// Filter by language, if field translation is enabled. // Filter by langcode, if field translation is enabled.
$field = $this->field_info; $field = $this->field_info;
if (field_is_translatable($entity_type, $field) && !empty($this->view->display_handler->options['field_language_add_to_query'])) { if (field_is_translatable($entity_type, $field) && !empty($this->view->display_handler->options['field_langcode_add_to_query'])) {
$column = $this->table_alias . '.language'; $column = $this->table_alias . '.langcode';
// By the same reason as field_language the field might be LANGUAGE_NOT_SPECIFIED in reality so allow it as well. // By the same reason as field_language the field might be LANGUAGE_NOT_SPECIFIED in reality so allow it as well.
// @see this::field_language() // @see this::field_langcode()
$default_language = language_default()->langcode; $default_langcode = language_default()->langcode;
$language = str_replace(array('***CURRENT_LANGUAGE***', '***DEFAULT_LANGUAGE***'), $langcode = str_replace(array('***CURRENT_LANGUAGE***', '***DEFAULT_LANGUAGE***'),
array(drupal_container()->get(LANGUAGE_TYPE_CONTENT)->langcode, $default_language), array(drupal_container()->get(LANGUAGE_TYPE_CONTENT)->langcode, $default_langcode),
$this->view->display_handler->options['field_language']); $this->view->display_handler->options['field_langcode']);
$placeholder = $this->placeholder(); $placeholder = $this->placeholder();
$language_fallback_candidates = array($language); $langcode_fallback_candidates = array($langcode);
if (variable_get('locale_field_language_fallback', TRUE)) { if (variable_get('locale_field_language_fallback', TRUE)) {
require_once DRUPAL_ROOT . '/includes/language.inc'; require_once DRUPAL_ROOT . '/includes/language.inc';
$language_fallback_candidates = array_merge($language_fallback_candidates, language_fallback_get_candidates()); $langcode_fallback_candidates = array_merge($langcode_fallback_candidates, language_fallback_get_candidates());
} }
else { else {
$language_fallback_candidates[] = LANGUAGE_NOT_SPECIFIED; $langcode_fallback_candidates[] = LANGUAGE_NOT_SPECIFIED;
} }
$this->query->add_where_expression(0, "$column IN($placeholder) OR $column IS NULL", array($placeholder => $language_fallback_candidates)); $this->query->add_where_expression(0, "$column IN($placeholder) OR $column IS NULL", array($placeholder => $langcode_fallback_candidates));
} }
} }
...@@ -719,7 +719,7 @@ function get_value($values, $field = NULL) { ...@@ -719,7 +719,7 @@ function get_value($values, $field = NULL) {
$entity = clone $values->_field_data[$this->field_alias]['entity']; $entity = clone $values->_field_data[$this->field_alias]['entity'];
$entity_type = $values->_field_data[$this->field_alias]['entity_type']; $entity_type = $values->_field_data[$this->field_alias]['entity_type'];
$langcode = $this->field_language($entity_type, $entity); $langcode = $this->field_langcode($entity_type, $entity);
// If we are grouping, copy our group fields into the cloned entity. // If we are grouping, copy our group fields into the cloned entity.
// It's possible this will cause some weirdness, but there's only // It's possible this will cause some weirdness, but there's only
// so much we can hope to do. // so much we can hope to do.
...@@ -840,7 +840,7 @@ function set_items($values, $row_id) { ...@@ -840,7 +840,7 @@ function set_items($values, $row_id) {
return array(); return array();
} }
$langcode = $this->field_language($entity_type, $entity); $langcode = $this->field_langcode($entity_type, $entity);
$render_array = field_view_field($entity_type, $entity, $this->definition['field_name'], $display, $langcode); $render_array = field_view_field($entity_type, $entity, $this->definition['field_name'], $display, $langcode);
$items = array(); $items = array();
...@@ -906,20 +906,20 @@ function add_self_tokens(&$tokens, $item) { ...@@ -906,20 +906,20 @@ function add_self_tokens(&$tokens, $item) {
* Return the language code of the language the field should be displayed in, * Return the language code of the language the field should be displayed in,
* according to the settings. * according to the settings.
*/ */
function field_language($entity_type, $entity) { function field_langcode($entity_type, $entity) {
if (field_is_translatable($entity_type, $this->field_info)) { if (field_is_translatable($entity_type, $this->field_info)) {
$default_language = language_default()->langcode; $default_langcode = language_default()->langcode;
$language = str_replace(array('***CURRENT_LANGUAGE***', '***DEFAULT_LANGUAGE***'), $langcode = str_replace(array('***CURRENT_LANGUAGE***', '***DEFAULT_LANGUAGE***'),
array(drupal_container()->get(LANGUAGE_TYPE_CONTENT)->langcode, $default_language), array(drupal_container()->get(LANGUAGE_TYPE_CONTENT)->langcode, $default_langcode),
$this->view->display_handler->options['field_language']); $this->view->display_handler->options['field_language']);
// Give the Field Language API a chance to fallback to a different language // Give the Field Language API a chance to fallback to a different language
// (or LANGUAGE_NOT_SPECIFIED), in case the field has no data for the selected language. // (or LANGUAGE_NOT_SPECIFIED), in case the field has no data for the selected language.
// field_view_field() does this as well, but since the returned language code // field_view_field() does this as well, but since the returned language code
// is used before calling it, the fallback needs to happen explicitly. // is used before calling it, the fallback needs to happen explicitly.
$language = field_language($entity_type, $entity, $this->field_info['field_name'], $language); $langcode = field_language($entity_type, $entity, $this->field_info['field_name'], $langcode);
return $language; return $langcode;
} }
else { else {
return LANGUAGE_NOT_SPECIFIED; return LANGUAGE_NOT_SPECIFIED;
......
...@@ -2,10 +2,10 @@ ...@@ -2,10 +2,10 @@
/** /**
* @file * @file
* Definition of Views\locale\Plugin\views\argument\Language. * Definition of Views\language\Plugin\views\argument\Language.
*/ */
namespace Views\locale\Plugin\views\argument; namespace Views\language\Plugin\views\argument;
use Drupal\views\Plugin\views\argument\ArgumentPluginBase; use Drupal\views\Plugin\views\argument\ArgumentPluginBase;
use Drupal\Core\Annotation\Plugin; use Drupal\Core\Annotation\Plugin;
...@@ -16,22 +16,18 @@ ...@@ -16,22 +16,18 @@
* @ingroup views_argument_handlers * @ingroup views_argument_handlers
* *
* @Plugin( * @Plugin(
* id = "locale_language", * id = "language",
* module = "locale" * module = "language"
* ) * )
*/ */
class Language extends ArgumentPluginBase { class Language extends ArgumentPluginBase {
function construct() {
parent::construct('language');
}
/** /**
* Override the behavior of summary_name(). Get the user friendly version * Override the behavior of summary_name(). Get the user friendly version
* of the language. * of the language.
*/ */
function summary_name($data) { function summary_name($data) {
return $this->locale_language($data->{$this->name_alias}); return $this->language($data->{$this->name_alias});
} }
/** /**
...@@ -39,10 +35,10 @@ function summary_name($data) { ...@@ -39,10 +35,10 @@ function summary_name($data) {
* of the language. * of the language.
*/ */
function title() { function title() {
return $this->locale_language($this->argument); return $this->language($this->argument);
} }
function locale_language($langcode) { function language($langcode) {
$languages = views_language_list(); $languages = views_language_list();
return isset($languages[$langcode]) ? $languages[$langcode] : t('Unknown language'); return isset($languages[$langcode]) ? $languages[$langcode] : t('Unknown language');
} }
......
...@@ -2,10 +2,10 @@ ...@@ -2,10 +2,10 @@
/** /**
* @file * @file
* Definition of Views\locale\Plugin\views\field\Language. * Definition of Views\language\Plugin\views\field\Language.
*/ */
namespace Views\locale\Plugin\views\field; namespace Views\language\Plugin\views\field;
use Drupal\views\Plugin\views\field\FieldPluginBase; use Drupal\views\Plugin\views\field\FieldPluginBase;
use Drupal\Core\Annotation\Plugin; use Drupal\Core\Annotation\Plugin;
...@@ -16,8 +16,8 @@ ...@@ -16,8 +16,8 @@
* @ingroup views_field_handlers * @ingroup views_field_handlers
* *
* @Plugin( * @Plugin(
* id = "locale_language", * id = "language",
* module = "locale" * module = "language"
* ) * )
*/ */
class Language extends FieldPluginBase { class Language extends FieldPluginBase {
...@@ -40,9 +40,11 @@ function options_form(&$form, &$form_state) { ...@@ -40,9 +40,11 @@ function options_form(&$form, &$form_state) {
} }
function render($values) { function render($values) {
$languages = locale_language_list(empty($this->options['native_language']) ? 'name' : 'native'); // @todo: Drupal Core dropped native language until config translation is
// ready, see http://drupal.org/node/1616594.
$value = $this->get_value($values); $value = $this->get_value($values);
return isset($languages[$value]) ? $languages[$value] : ''; $language = language_load($value);
return $language ? $language->name : '';
} }
} }
...@@ -2,10 +2,10 @@ ...@@ -2,10 +2,10 @@
/** /**
* @file * @file
* Definition of Views\locale\Plugin\views\field\NodeLanguage. * Definition of Views\node\Plugin\views\field\Language.
*/ */
namespace Views\locale\Plugin\views\field; namespace Views\node\Plugin\views\field;
use Views\node\Plugin\views\field\Node; use Views\node\Plugin\views\field\Node;
use Drupal\Core\Annotation\Plugin; use Drupal\Core\Annotation\Plugin;
...@@ -17,10 +17,10 @@ ...@@ -17,10 +17,10 @@
* *
* @Plugin( * @Plugin(
* id = "node_language", * id = "node_language",
* module = "locale" * module = "node"
* ) * )
*/ */
class NodeLanguage extends Node { class Language extends Node {
function option_definition() { function option_definition() {
$options = parent::option_definition(); $options = parent::option_definition();
...@@ -40,9 +40,11 @@ function options_form(&$form, &$form_state) { ...@@ -40,9 +40,11 @@ function options_form(&$form, &$form_state) {
} }
function render($values) { function render($values) {
$languages = views_language_list(empty($this->options['native_language']) ? 'name' : 'native'); // @todo: Drupal Core dropped native language until config translation is
// ready, see http://drupal.org/node/1616594.
$value = $this->get_value($values); $value = $this->get_value($values);
$value = isset($languages[$value]) ? $languages[$value] : ''; $language = language_load($value);
$value = $language ? $language->name : '';
return $this->render_link($value, $values); return $this->render_link($value, $values);
} }
......
...@@ -2,13 +2,13 @@ ...@@ -2,13 +2,13 @@
/** /**
* @file * @file
* Definition of Views\locale\Plugin\views\filter\Language. * Definition of Views\language\Plugin\views\filter\Language.
*/ */
namespace Views\locale\Plugin\views\filter; namespace Views\language\Plugin\views\filter;
use Drupal\Core\Annotation\Plugin;
use Drupal\views\Plugin\views\filter\InOperator; use Drupal\views\Plugin\views\filter\InOperator;
use Drupal\Core\Annotation\Plugin;
/** /**
* Filter by language. * Filter by language.
...@@ -16,8 +16,8 @@ ...@@ -16,8 +16,8 @@
* @ingroup views_filter_handlers * @ingroup views_filter_handlers
* *
* @Plugin( * @Plugin(
* id = "locale_language", * id = "language",
* module = "locale" * module = "language"
* ) * )
*/ */
class Language extends InOperator { class Language extends InOperator {
......
<?php
/**
* @file
* Definition of Views\locale\Plugin\views\filter\NodeLanguage.
*/
namespace Views\locale\Plugin\views\filter;
use Drupal\Core\Annotation\Plugin;
use Drupal\views\Plugin\views\filter\InOperator;
/**
* Filter by language.
*
* @ingroup views_filter_handlers
*
* @Plugin(
* id = "node_language",
* module = "locale"
* )
*/
class NodeLanguage extends InOperator {
function get_value_options() {
if (!isset($this->value_options)) {
$this->value_title = t('Language');
$languages = array(
'***CURRENT_LANGUAGE***' => t("Current user's language"),
'***DEFAULT_LANGUAGE***' => t("Default site language"),
LANGUAGE_NOT_SPECIFIED => t('No language')
);
$languages = array_merge($languages, views_language_list());
$this->value_options = $languages;
}
}
}
<?php
/**
* @file
* Definition of Views\node\Plugin\views\argument\Language.
*/
namespace Views\node\Plugin\views\argument;
use Drupal\views\Plugin\views\argument\ArgumentPluginBase;
use Drupal\Core\Annotation\Plugin;
/**
* Argument handler to accept a language.
*
* @Plugin(
* id = "node_language",
* module = "node"
* )
*/
class Language extends ArgumentPluginBase {
function construct() {
parent::construct('language');
}
/**
* Override the behavior of summary_name(). Get the user friendly version
* of the language.
*/
function summary_name($data) {
return $this->node_language($data->{$this->name_alias});
}
/**
* Override the behavior of title(). Get the user friendly version of the
* node type.
*/
function title() {
return $this->node_language($this->argument);
}
function node_language($langcode) {
$languages = views_language_list();
return isset($languages[$langcode]) ? $languages[$langcode] : t('Unknown language');
}
}
...@@ -30,7 +30,7 @@ function init(&$view, &$options) { ...@@ -30,7 +30,7 @@ function init(&$view, &$options) {
if (!empty($this->options['link_to_node'])) { if (!empty($this->options['link_to_node'])) {
$this->additional_fields['nid'] = array('table' => 'node', 'field' => 'nid'); $this->additional_fields['nid'] = array('table' => 'node', 'field' => 'nid');
if (module_exists('translation')) { if (module_exists('translation')) {
$this->additional_fields['language'] = array('table' => 'node', 'field' => 'language'); $this->additional_fields['langcode'] = array('table' => 'node', 'field' => 'langcode');
} }
} }
} }
...@@ -65,11 +65,11 @@ function render_link($data, $values) { ...@@ -65,11 +65,11 @@ function render_link($data, $values) {
if ($data !== NULL && $data !== '') { if ($data !== NULL && $data !== '') {
$this->options['alter']['make_link'] = TRUE; $this->options['alter']['make_link'] = TRUE;
$this->options['alter']['path'] = "node/" . $this->get_value($values, 'nid'); $this->options['alter']['path'] = "node/" . $this->get_value($values, 'nid');
if (isset($this->aliases['language'])) { if (isset($this->aliases['langcode'])) {
$languages = language_list(); $languages = language_list();
$language = $this->get_value($values, 'language'); $langcode = $this->get_value($values, 'langcode');
if (isset($languages[$language])) { if (isset($languages[$langcode])) {
$this->options['alter']['language'] = $languages[$language]; $this->options['alter']['language'] = $languages[$langcode];
} }
else { else {
unset($this->options['alter']['language']); unset($this->options['alter']['language']);
......
...@@ -28,7 +28,7 @@ function init(&$view, &$options) { ...@@ -28,7 +28,7 @@ function init(&$view, &$options) {
$this->additional_fields['vid'] = 'vid'; $this->additional_fields['vid'] = 'vid';
$this->additional_fields['nid'] = 'nid'; $this->additional_fields['nid'] = 'nid';
if (module_exists('translation')) { if (module_exists('translation')) {
$this->additional_fields['language'] = array('table' => 'node', 'field' => 'language'); $this->additional_fields['langcode'] = array('table' => 'node', 'field' => 'langcode');
} }
} }
} }
...@@ -63,10 +63,10 @@ function render_link($data, $values) { ...@@ -63,10 +63,10 @@ function render_link($data, $values) {
$vid = $this->get_value($values, 'vid'); $vid = $this->get_value($values, 'vid');
$this->options['alter']['path'] = "node/" . $nid . '/revisions/' . $vid . '/view'; $this->options['alter']['path'] = "node/" . $nid . '/revisions/' . $vid . '/view';
if (module_exists('translation')) { if (module_exists('translation')) {
$language = $this->get_value($values, 'language'); $langcode = $this->get_value($values, 'langcode');
$languages = language_list(); $languages = language_list();
if (isset($languages[$language])) { if (isset($languages[$langcode])) {
$this->options['alter']['language'] = $languages[$language]; $this->options['alter']['langcode'] = $languages[$langcode];
} }
} }
} }
......
...@@ -26,7 +26,7 @@ function render_link($data, $values) { ...@@ -26,7 +26,7 @@ function render_link($data, $values) {
// ensure user has access to edit this node. // ensure user has access to edit this node.
$node = $this->get_value($values); $node = $this->get_value($values);
$node->status = 1; // unpublished nodes ignore access control $node->status = 1; // unpublished nodes ignore access control
if (empty($node->language) || !translation_supported_type($node->type) || !node_access('view', $node) || !user_access('translate content')) { if (empty($node->langcode) || !translation_supported_type($node->type) || !node_access('view', $node) || !user_access('translate content')) {
return; return;
} }
......
...@@ -27,7 +27,7 @@ function construct() { ...@@ -27,7 +27,7 @@ function construct() {
$this->additional_fields['nid'] = 'nid'; $this->additional_fields['nid'] = 'nid';
$this->additional_fields['tnid'] = 'tnid'; $this->additional_fields['tnid'] = 'tnid';
$this->additional_fields['title'] = 'title'; $this->additional_fields['title'] = 'title';
$this->additional_fields['language'] = 'language'; $this->additional_fields['langcode'] = 'langcode';
} }
function query() { function query() {
...@@ -45,7 +45,7 @@ function render_link($data, $values) { ...@@ -45,7 +45,7 @@ function render_link($data, $values) {
$tnid = $this->get_value($values, 'tnid'); $tnid = $this->get_value($values, 'tnid');
// Only load translations if the node isn't in the current language. // Only load translations if the node isn't in the current language.
if ($this->get_value($values, 'language') != $language_interface->langcode) { if ($this->get_value($values, 'langcode') != $language_interface->langcode) {
$translations = translation_node_get_translations($tnid); $translations = translation_node_get_translations($tnid);
if (isset($translations[$language_interface->langcode])) { if (isset($translations[$language_interface->langcode])) {
$values->{$this->aliases['nid']} = $translations[$language_interface->langcode]->nid; $values->{$this->aliases['nid']} = $translations[$language_interface->langcode]->nid;
......
...@@ -41,7 +41,7 @@ function options_form(&$form, &$form_state) { ...@@ -41,7 +41,7 @@ function options_form(&$form, &$form_state) {
'current' => t('Current language'), 'current' => t('Current language'),
'default' => t('Default language'), 'default' => t('Default language'),
); );
$options = array_merge($options, locale_language_list()); $options = array_merge($options, views_language_list());
$form['language'] = array( $form['language'] = array(
'#type' => 'select', '#type' => 'select',
'#options' => $options, '#options' => $options,
...@@ -75,20 +75,20 @@ function query() { ...@@ -75,20 +75,20 @@ function query() {
switch ($this->options['language']) { switch ($this->options['language']) {
case 'current': case 'current':
$def['extra'][] = array( $def['extra'][] = array(
'field' => 'language', 'field' => 'langcode',
'value' => '***CURRENT_LANGUAGE***', 'value' => '***CURRENT_LANGUAGE***',
); );
break;