You are here

function locale_translation_filters in Drupal 7

List locale translation filters that can be applied.

Related topics

2 calls to locale_translation_filters()
locale_translation_filter_form in modules/locale/locale.admin.inc
Return form for locale translation filters.
locale_translation_filter_form_submit in modules/locale/locale.admin.inc
Process result from locale translation filter form.

File

modules/locale/locale.admin.inc, line 806
Administration functions for locale.module.

Code

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

  // Get all languages, except English
  drupal_static_reset('language_list');
  $languages = locale_language_list('name');
  unset($languages['en']);
  $filters['string'] = array(
    'title' => t('String contains'),
    'description' => t('Leave blank to show all strings. The search is case sensitive.'),
  );
  $filters['language'] = array(
    'title' => t('Language'),
    'options' => array_merge(array(
      'all' => t('All languages'),
      'en' => t('English (provided by Drupal)'),
    ), $languages),
  );
  $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'),
    ),
  );
  $groups = module_invoke_all('locale', 'groups');
  $filters['group'] = array(
    'title' => t('Limit search to'),
    'options' => array_merge(array(
      'all' => t('All text groups'),
    ), $groups),
  );
  return $filters;
}