function lingotek_enable_language_by_code in Lingotek Translation 7.3
Same name and namespace in other branches
- 7.7 lingotek.util.inc \lingotek_enable_language_by_code()
- 7.2 lingotek.util.inc \lingotek_enable_language_by_code()
- 7.4 lingotek.util.inc \lingotek_enable_language_by_code()
- 7.5 lingotek.util.inc \lingotek_enable_language_by_code()
- 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 804 - Utility functions.
Code
function lingotek_enable_language_by_code($drupal_language_code, $lingotek_enabled = 1, $lingotek_locale = NULL) {
$field_data = array(
'enabled' => 1,
'lingotek_enabled' => $lingotek_enabled ? 1 : 0,
);
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;
}