You are here

function lingotek_add_language_for_file_entities in Lingotek Translation 7.7

Adds the "language" column to the file_managed table if needed

1 call to lingotek_add_language_for_file_entities()
lingotek_admin_prefs_form_submit in ./lingotek.admin.inc

File

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

Code

function lingotek_add_language_for_file_entities() {
  if (!db_field_exists('file_managed', 'language')) {
    $schema['file_managed']['fields']['language'] = array(
      'type' => 'char',
      'length' => 8,
      'not null' => TRUE,
      'default' => language_default()->language,
      'description' => 'Language used for third party translation',
    );
    db_add_field('file_managed', 'language', $schema['file_managed']['fields']['language']);
    LingotekLog::warning('Language column has been added to the @module_name by Lingotek.', array(
      '@module_name' => 'File Entity',
    ));
  }
}