You are here

function lingotek_admin_prepare_taxonomies in Lingotek Translation 7.7

Same name and namespace in other branches
  1. 7.3 lingotek.admin.inc \lingotek_admin_prepare_taxonomies()
  2. 7.4 lingotek.admin.inc \lingotek_admin_prepare_taxonomies()
  3. 7.5 lingotek.admin.inc \lingotek_admin_prepare_taxonomies()
  4. 7.6 lingotek.admin.inc \lingotek_admin_prepare_taxonomies()
2 calls to lingotek_admin_prepare_taxonomies()
drush_lingotek_prepare_vocab in ./lingotek.drush.inc
Callback function for drush command lt-prepare-taxonomies
lingotek_admin_additional_translation_settings_form_submit in ./lingotek.admin.inc

File

./lingotek.admin.inc, line 1226

Code

function lingotek_admin_prepare_taxonomies() {

  // update all taxonomies to be updated to use translation mode 'Localize'
  $result = db_update('taxonomy_vocabulary')
    ->fields(array(
    'i18n_mode' => LINGOTEK_TAXONOMY_LOCALIZE_VALUE,
  ))
    ->condition('i18n_mode', LINGOTEK_TAXONOMY_MULTILINGUAL_DISABLED_VALUE)
    ->execute();
  if ($result) {
    drupal_set_message(format_plural($result, t('Set 1 taxonomy vocabulary to <i>Localize</i>.'), t('Set @num taxonomy vocabularies to <i>Localize</i>.', array(
      '@num' => (int) $result,
    ))));
  }
  else {
    drupal_set_message(t('All taxonomy vocabularies already set to <i>Localize</i>.'));
  }
  return TRUE;
}