You are here

function l10n_update_get_d8_plural_strings in Localization update 7.2

Gets D8 plural style strings.

Parameters

int $start: Offset of records to load.

int $length: Maximum number of records to load.

Return value

array|bool An array of data from source and translation strings of which the source string contains a Drupal 8 style plural delimiter. Returns false if not found.

2 calls to l10n_update_get_d8_plural_strings()
l10n_update_d8_plural_conversion in ./l10n_update.install
Converts D8 style translations strings into D7 format.
l10n_update_update_7207 in ./l10n_update.install
Migrate D8 style plurals to D7 style.

File

./l10n_update.install, line 379
Install file for l10n remote updates.

Code

function l10n_update_get_d8_plural_strings($start = 0, $length = 0) {
  $translation_strings = FALSE;
  $query = db_select('locales_source', 'ls');
  $query
    ->fields('ls', array(
    'lid',
    'location',
    'textgroup',
    'source',
    'context',
    'version',
  ));
  $query
    ->fields('lt', array(
    'translation',
    'language',
    'plid',
    'plural',
    'l10n_status',
  ));
  $query
    ->innerJoin('locales_target', 'lt', 'ls.lid = lt.lid');
  $query
    ->condition('source', '%' . db_like(L10N_UPDATE_PLURAL_DELIMITER) . '%', 'LIKE');
  if ($length) {
    $query
      ->range($start, $length);
  }
  $results = $query
    ->execute();
  if ($results
    ->rowCount()) {
    foreach ($results as $result) {
      $translation_strings[] = $result;
    }
  }
  return $translation_strings;
}