You are here

function lingotek_enable_language_by_code in Lingotek Translation 7.7

Same name and namespace in other branches
  1. 7.2 lingotek.util.inc \lingotek_enable_language_by_code()
  2. 7.3 lingotek.util.inc \lingotek_enable_language_by_code()
  3. 7.4 lingotek.util.inc \lingotek_enable_language_by_code()
  4. 7.5 lingotek.util.inc \lingotek_enable_language_by_code()
  5. 7.6 lingotek.util.inc \lingotek_enable_language_by_code()

Add lingotek_locale and lingotek_enable to the language table for the passed in drupal_language_code

2 calls to lingotek_enable_language_by_code()
lingotek_add_missing_locales in ./lingotek.util.inc
Fills in any missing lingotek_locale values to the languages table
lingotek_migration_1 in ./lingotek.util.inc
Migration 1

File

./lingotek.util.inc, line 1415
Utility functions.

Code

function lingotek_enable_language_by_code($drupal_language_code, $lingotek_locale = NULL) {
  $field_data = array(
    'enabled' => 1,
  );
  if (!is_null($lingotek_locale)) {
    $field_data['lingotek_locale'] = $lingotek_locale;
  }
  db_update('languages')
    ->fields($field_data)
    ->condition('language', $drupal_language_code)
    ->execute();
  return $lingotek_locale;
}