function locale_translate_filters

List locale translation filters that can be applied.

3 calls to locale_translate_filters()
locale_translate_filter_form in drupal/core/modules/locale/locale.pages.inc
Return form for locale translation filters.
locale_translate_filter_form_submit in drupal/core/modules/locale/locale.pages.inc
Process result from locale translation filter form.
locale_translate_filter_values in drupal/core/modules/locale/locale.pages.inc
Build array out of search criteria specified in request variables.

File

drupal/core/modules/locale/locale.pages.inc, line 96
Interface translation summary, editing and deletion user interfaces.

Code

function locale_translate_filters() {
  $filters = array();

  // Get all languages, except English.
  drupal_static_reset('language_list');
  $languages = language_list();
  $language_options = array();
  foreach ($languages as $langcode => $language) {
    if ($langcode != 'en' || locale_translate_english()) {
      $language_options[$langcode] = $language->name;
    }
  }

  // Pick the current interface language code for the filter.
  $default_langcode = language(LANGUAGE_TYPE_INTERFACE)->langcode;
  if (!isset($language_options[$default_langcode])) {
    $available_langcodes = array_keys($language_options);
    $default_langcode = array_shift($available_langcodes);
  }
  $filters['string'] = array(
    'title' => t('String contains'),
    'description' => t('Leave blank to show all strings. The search is case sensitive.'),
    'default' => '',
  );
  $filters['langcode'] = array(
    'title' => t('Translation language'),
    'options' => $language_options,
    'default' => $default_langcode,
  );
  $filters['translation'] = array(
    'title' => t('Search in'),
    'options' => array(
      'all' => t('Both translated and untranslated strings'),
      'translated' => t('Only translated strings'),
      'untranslated' => t('Only untranslated strings'),
    ),
    'default' => 'all',
  );
  $filters['customized'] = array(
    'title' => t('Translation type'),
    'options' => array(
      'all' => t('All'),
      LOCALE_NOT_CUSTOMIZED => t('Non-customized translation'),
      LOCALE_CUSTOMIZED => t('Customized translation'),
    ),
    'states' => array(
      'visible' => array(
        ':input[name=translation]' => array(
          'value' => 'translated',
        ),
      ),
    ),
    'default' => 'all',
  );
  return $filters;
}