You are here

function lingotek_admin_index_plural_targets in Lingotek Translation 7.6

Same name and namespace in other branches
  1. 7.7 lingotek.admin.inc \lingotek_admin_index_plural_targets()
  2. 7.4 lingotek.admin.inc \lingotek_admin_index_plural_targets()
  3. 7.5 lingotek.admin.inc \lingotek_admin_index_plural_targets()
1 string reference to 'lingotek_admin_index_plural_targets'
lingotek_admin_prepare_builtins in ./lingotek.admin.inc

File

./lingotek.admin.inc, line 1094

Code

function lingotek_admin_index_plural_targets(&$context = NULL) {
  if ($context) {
    $context['message'] = t('Indexing translation targets to preserve plurality');
  }
  $plurals = db_select('locales_target', 't')
    ->fields('t', array(
    'lid',
    'plid',
    'plural',
  ))
    ->condition('plid', 0, '!=')
    ->execute()
    ->fetchAll();
  if ($plurals) {
    $plural_map = variable_get('lingotek_config_plural_mapping', array());
    foreach ($plurals as $p) {
      $plural_map[$p->lid] = array(
        'plid' => $p->plid,
        'plural' => $p->plural,
      );
    }
    variable_set('lingotek_config_plural_mapping', $plural_map);
  }
}