You are here

function i18nstrings_install in Internationalization 6

Same name and namespace in other branches
  1. 5.3 i18nstrings/i18nstrings.install \i18nstrings_install()
  2. 5 experimental/i18nstrings.install \i18nstrings_install()
  3. 5.2 experimental/i18nstrings.install \i18nstrings_install()

Implementation of hook_install().

1 call to i18nstrings_install()
i18nstrings_update_5900 in i18nstrings/i18nstrings.install
Update from 5.x version

File

i18nstrings/i18nstrings.install, line 11
Installation file for i18nstrings module.

Code

function i18nstrings_install() {

  // Create database tables.
  drupal_install_schema('i18nstrings');

  // Set module weight for it to run after core modules.
  db_query("UPDATE {system} SET weight = 10 WHERE name = 'i18nstrings' AND type = 'module'");
  $ret = array();

  // Add a field to track whether a translation needs updating.
  db_add_field($ret, 'locales_target', 'i18n_status', array(
    'type' => 'int',
    'not null' => TRUE,
    'default' => 0,
  ));

  // Add custom index to locales_source table.
  db_add_index($ret, 'locales_source', 'textgroup_location', array(
    array(
      'textgroup',
      30,
    ),
    'location',
  ));
}