function lingotek_enable_language_by_code in Lingotek Translation 7.2
Same name and namespace in other branches
- 7.7 lingotek.util.inc \lingotek_enable_language_by_code()
- 7.3 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()
1 call 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
File
- ./
lingotek.util.inc, line 810 - Utility functions.
Code
function lingotek_enable_language_by_code($drupal_language_code, $lingotek_enabled = 1, $lingotek_locale = NULL) {
$lingotek_locale = is_null($lingotek_locale) ? Lingotek::convertDrupal2Lingotek($drupal_language_code, FALSE) : $lingotek_locale;
db_update('languages')
->fields(array(
'enabled' => 1,
'lingotek_enabled' => $lingotek_enabled ? 1 : 0,
'lingotek_locale' => $lingotek_locale,
))
->condition('language', $drupal_language_code)
->execute();
return $lingotek_locale;
}