Projet

Général

Profil

Révision 9faa5de0

Ajouté par Assos Assos il y a presque 3 ans

  • ID 9faa5de0ee5c940f7ee0fa98ecd32c0b997b9d0e
  • Parent bad4e148

Weekly update of contrib modules

Voir les différences:

drupal7/sites/all/modules/i18n/i18n.info
8 8
files[] = i18n.test
9 9
configure = admin/config/regional/i18n
10 10

  
11
; Information added by Drupal.org packaging script on 2020-06-17
12
version = "7.x-1.27"
11
; Information added by Drupal.org packaging script on 2021-04-26
12
version = "7.x-1.31"
13 13
core = "7.x"
14 14
project = "i18n"
15
datestamp = "1592373390"
15
datestamp = "1619398284"
drupal7/sites/all/modules/i18n/i18n.module
233 233
/**
234 234
 * Implements hook_help().
235 235
 */
236
function i18n_help($path = 'admin/help#i18n', $arg) {
236
function i18n_help($path, $arg) {
237 237
  switch ($path) {
238 238
    case 'admin/help#i18n' :
239 239
      $output = '<p>' . t('This module improves support for multilingual content in Drupal sites:') . '</p>';
drupal7/sites/all/modules/i18n/i18n_block/i18n_block.info
8 8
files[] = i18n_block.test
9 9

  
10 10

  
11
; Information added by Drupal.org packaging script on 2020-06-17
12
version = "7.x-1.27"
11
; Information added by Drupal.org packaging script on 2021-04-26
12
version = "7.x-1.31"
13 13
core = "7.x"
14 14
project = "i18n"
15
datestamp = "1592373390"
15
datestamp = "1619398284"
drupal7/sites/all/modules/i18n/i18n_block/i18n_block.module
111 111
}
112 112

  
113 113
/**
114
 * Implements hook_block_view().
114
 * Implements hook_block_view_alter().
115 115
 */
116 116
function i18n_block_block_view_alter(&$data, $block) {
117 117
  if (!empty($block->i18n_mode)) {
drupal7/sites/all/modules/i18n/i18n_contact/i18n_contact.info
5 5
package = Multilingual - Internationalization
6 6
core = 7.x
7 7

  
8
; Information added by Drupal.org packaging script on 2020-06-17
9
version = "7.x-1.27"
8
; Information added by Drupal.org packaging script on 2021-04-26
9
version = "7.x-1.31"
10 10
core = "7.x"
11 11
project = "i18n"
12
datestamp = "1592373390"
12
datestamp = "1619398284"
drupal7/sites/all/modules/i18n/i18n_field/i18n_field.info
6 6
core = 7.x
7 7
files[] = i18n_field.inc
8 8
files[] = i18n_field.test
9
; Information added by Drupal.org packaging script on 2020-06-17
10
version = "7.x-1.27"
9
; Information added by Drupal.org packaging script on 2021-04-26
10
version = "7.x-1.31"
11 11
core = "7.x"
12 12
project = "i18n"
13
datestamp = "1592373390"
13
datestamp = "1619398284"
drupal7/sites/all/modules/i18n/i18n_field/i18n_field.module
176 176
  global $language;
177 177

  
178 178
  // Don't translate if the widget is being shown on the field edit form.
179
  if ($form_state['build_info']['form_id'] == 'field_ui_field_edit_form') {
179
  if (isset($form_state['build_info']['form_id']) && $form_state['build_info']['form_id'] == 'field_ui_field_edit_form') {
180 180
    return;
181 181
  }
182 182

  
......
398 398
 *   (number or text), values of the array are the display labels.
399 399
 */
400 400
function i18n_field_translate_allowed_values($field, $langcode = NULL) {
401
  if (!empty($field['settings']['allowed_values'])) {
402
    return i18n_string_translate(array('field', $field['field_name'], '#allowed_values'), $field['settings']['allowed_values'], array('langcode' => $langcode, 'sanitize' => FALSE));
403
  }
404
  else {
401
  $allowed_values = list_allowed_values($field);
402
  if (!$allowed_values) {
405 403
    return array();
406 404
  }
405
  // Do not attempt to translate options from a callback.
406
  $function = $field['settings']['allowed_values_function'];
407
  if (!empty($function) && function_exists($function)) {
408
    return $allowed_values;
409
  }
410
  return i18n_string_translate(array('field', $field['field_name'], '#allowed_values'), $allowed_values, array('langcode' => $langcode, 'sanitize' => FALSE));
407 411
}
408 412

  
409 413
/**
drupal7/sites/all/modules/i18n/i18n_forum/i18n_forum.info
7 7
core = 7.x
8 8
files[] = i18n_forum.test
9 9

  
10
; Information added by Drupal.org packaging script on 2020-06-17
11
version = "7.x-1.27"
10
; Information added by Drupal.org packaging script on 2021-04-26
11
version = "7.x-1.31"
12 12
core = "7.x"
13 13
project = "i18n"
14
datestamp = "1592373390"
14
datestamp = "1619398284"
drupal7/sites/all/modules/i18n/i18n_menu/i18n_menu.info
10 10
files[] = i18n_menu.inc
11 11
files[] = i18n_menu.test
12 12

  
13
; Information added by Drupal.org packaging script on 2020-06-17
14
version = "7.x-1.27"
13
; Information added by Drupal.org packaging script on 2021-04-26
14
version = "7.x-1.31"
15 15
core = "7.x"
16 16
project = "i18n"
17
datestamp = "1592373390"
17
datestamp = "1619398284"
drupal7/sites/all/modules/i18n/i18n_node/i18n_node.info
9 9
files[]=i18n_node.test
10 10
files[]=i18n_node.variable.inc
11 11

  
12
; Information added by Drupal.org packaging script on 2020-06-17
13
version = "7.x-1.27"
12
; Information added by Drupal.org packaging script on 2021-04-26
13
version = "7.x-1.31"
14 14
core = "7.x"
15 15
project = "i18n"
16
datestamp = "1592373390"
16
datestamp = "1619398284"
drupal7/sites/all/modules/i18n/i18n_node/i18n_node.module
260 260
function i18n_node_node_view($node, $view_mode, $langcode) {
261 261
  if (i18n_node_type_enabled($node)) {
262 262
    $extra_fields_display_settings = field_extra_fields_get_display('node', $node->type, $view_mode);
263
    if ($extra_fields_display_settings['language']['visible']) {
263
    if (isset($extra_fields_display_settings['language']['visible']) && $extra_fields_display_settings['language']['visible']) {
264 264
      $node->content['language'] = array(
265 265
        '#type' => 'item',
266 266
        '#title' => t('Language'),
drupal7/sites/all/modules/i18n/i18n_node/i18n_node.pages.inc
260 260
 *
261 261
 * We also handle autocomplete values (title [nid:x]) and validate the form
262 262
 */
263
function i18n_node_autocomplete2nid($name, $field = NULL, $type, $language) {
263
function i18n_node_autocomplete2nid($name, $field, $type, $language) {
264 264
  if (!empty($name)) {
265 265
    preg_match('/^(?:\s*|(.*) )?\[\s*nid\s*:\s*(\d+)\s*\]$/', $name, $matches);
266 266
    if (!empty($matches)) {
drupal7/sites/all/modules/i18n/i18n_path/i18n_path.info
6 6

  
7 7
files[] = i18n_path.inc
8 8
files[] = i18n_path.test
9
; Information added by Drupal.org packaging script on 2020-06-17
10
version = "7.x-1.27"
9
; Information added by Drupal.org packaging script on 2021-04-26
10
version = "7.x-1.31"
11 11
core = "7.x"
12 12
project = "i18n"
13
datestamp = "1592373390"
13
datestamp = "1619398284"
drupal7/sites/all/modules/i18n/i18n_redirect/i18n_redirect.info
4 4
package = Multilingual - Internationalization
5 5
core = 7.x
6 6

  
7
; Information added by Drupal.org packaging script on 2020-06-17
8
version = "7.x-1.27"
7
; Information added by Drupal.org packaging script on 2021-04-26
8
version = "7.x-1.31"
9 9
core = "7.x"
10 10
project = "i18n"
11
datestamp = "1592373390"
11
datestamp = "1619398284"
drupal7/sites/all/modules/i18n/i18n_select/i18n_select.info
6 6
configure = admin/config/regional/i18n/select
7 7
files[] = i18n_select.test
8 8

  
9
; Information added by Drupal.org packaging script on 2020-06-17
10
version = "7.x-1.27"
9
; Information added by Drupal.org packaging script on 2021-04-26
10
version = "7.x-1.31"
11 11
core = "7.x"
12 12
project = "i18n"
13
datestamp = "1592373390"
13
datestamp = "1619398284"
drupal7/sites/all/modules/i18n/i18n_string/i18n_string.info
10 10
files[] = i18n_string.test
11 11
configure = admin/config/regional/i18n/strings
12 12

  
13
; Information added by Drupal.org packaging script on 2020-06-17
14
version = "7.x-1.27"
13
; Information added by Drupal.org packaging script on 2021-04-26
14
version = "7.x-1.31"
15 15
core = "7.x"
16 16
project = "i18n"
17
datestamp = "1592373390"
17
datestamp = "1619398284"
drupal7/sites/all/modules/i18n/i18n_string/i18n_string.module
153 153
    'file' => 'i18n_string.pages.inc',
154 154
    'file path' => drupal_get_path('module', 'i18n_string'),
155 155
  );
156
  $items['admin/config/regional/translate/translate'] = array(
157
    'title' => 'Translate',
158
    'weight' => 10,
159
    'type' => MENU_LOCAL_TASK,
160
    'page callback' => 'i18n_string_locale_translate_seek_screen',
161
    'access arguments' => array('translate interface'),
162
    'file' => 'i18n_string.pages.inc',
163
    'file path' => drupal_get_path('module', 'i18n_string'),
164
  );
156 165
}
157 166

  
158 167
/**
drupal7/sites/all/modules/i18n/i18n_string/i18n_string.pages.inc
459 459
  }
460 460
  return $output;
461 461
}
462

  
463
/**
464
 * String search & translate screen.
465
 *
466
 * Almost exactly the same as the core locale module's implementation, but
467
 * taking i18n_string_source_language into account for the languages column.
468
 */
469
function i18n_string_locale_translate_seek_screen() {
470
  // Add CSS.
471
  drupal_add_css(drupal_get_path('module', 'locale') . '/locale.css');
472

  
473
  $elements = drupal_get_form('locale_translation_filter_form');
474
  $output = drupal_render($elements);
475
  $output .= _i18n_string_locale_translate_seek();
476
  return $output;
477
}
478

  
479
/**
480
 * Perform a string search and display results in a table
481
 */
482
function _i18n_string_locale_translate_seek() {
483
  $output = '';
484

  
485
  // We have at least one criterion to match
486
  if (!($query = _locale_translate_seek_query())) {
487
    $query = array(
488
      'translation' => 'all',
489
      'group' => 'all',
490
      'language' => 'all',
491
      'string' => '',
492
    );
493
  }
494

  
495
  $sql_query = db_select('locales_source', 's');
496

  
497
  $limit_language = NULL;
498
  if ($query['language'] != 'en' && $query['language'] != 'all') {
499
    $sql_query->leftJoin('locales_target', 't', "t.lid = s.lid AND t.language = :langcode", array(':langcode' => $query['language']));
500
    $limit_language = $query['language'];
501
  }
502
  else {
503
    $sql_query->leftJoin('locales_target', 't', 't.lid = s.lid');
504
  }
505

  
506
  $sql_query->fields('s', array('source', 'location', 'context', 'lid', 'textgroup'));
507
  $sql_query->fields('t', array('translation', 'language'));
508

  
509
  // Compute LIKE section.
510
  switch ($query['translation']) {
511
    case 'translated':
512
      $sql_query->condition('t.translation', '%' . db_like($query['string']) . '%', 'LIKE');
513
      $sql_query->orderBy('t.translation', 'DESC');
514
      break;
515
    case 'untranslated':
516
      $sql_query->condition(db_and()
517
        ->condition('s.source', '%' . db_like($query['string']) . '%', 'LIKE')
518
        ->isNull('t.translation')
519
      );
520
      $sql_query->orderBy('s.source');
521
      break;
522
    case 'all' :
523
    default:
524
      $condition = db_or()
525
        ->condition('s.source', '%' . db_like($query['string']) . '%', 'LIKE');
526
      if ($query['language'] != 'en') {
527
        // Only search in translations if the language is not forced to English.
528
        $condition->condition('t.translation', '%' . db_like($query['string']) . '%', 'LIKE');
529
      }
530
      $sql_query->condition($condition);
531
      break;
532
  }
533

  
534
  // Add a condition on the text group.
535
  if (!empty($query['group']) && $query['group'] != 'all') {
536
    $sql_query->condition('s.textgroup', $query['group']);
537
  }
538

  
539
  $sql_query = $sql_query->extend('PagerDefault')->limit(50);
540
  $locales = $sql_query->execute();
541

  
542
  $groups = module_invoke_all('locale', 'groups');
543
  $header = array(t('Text group'), t('String'), t('Context'), ($limit_language) ? t('Language') : t('Languages'), array('data' => t('Operations'), 'colspan' => '2'));
544

  
545
  $strings = array();
546
  foreach ($locales as $locale) {
547
    if (!isset($strings[$locale->lid])) {
548
      $strings[$locale->lid] = array(
549
        'group' => $locale->textgroup,
550
        'languages' => array(),
551
        'location' => $locale->location,
552
        'source' => $locale->source,
553
        'context' => $locale->context,
554
      );
555
    }
556
    if (isset($locale->language)) {
557
      $strings[$locale->lid]['languages'][$locale->language] = $locale->translation;
558
    }
559
  }
560

  
561
  $rows = array();
562
  foreach ($strings as $lid => $string) {
563
    $rows[] = array(
564
      $groups[$string['group']],
565
      array('data' => check_plain(truncate_utf8($string['source'], 150, FALSE, TRUE)) . '<br /><small>' . $string['location'] . '</small>'),
566
      $string['context'],
567
      array('data' => _i18n_string_locale_translate_language_list($string, $limit_language), 'align' => 'center'),
568
      array('data' => l(t('edit'), "admin/config/regional/translate/edit/$lid", array('query' => drupal_get_destination())), 'class' => array('nowrap')),
569
      array('data' => l(t('delete'), "admin/config/regional/translate/delete/$lid", array('query' => drupal_get_destination())), 'class' => array('nowrap')),
570
    );
571
  }
572

  
573
  $output .= theme('table', array('header' => $header, 'rows' => $rows, 'empty' => t('No strings available.')));
574
  $output .= theme('pager');
575

  
576
  return $output;
577
}
578

  
579
/**
580
 * List languages in search result table.
581
 */
582
function _i18n_string_locale_translate_language_list($string, $limit_language) {
583
  // Add CSS.
584
  drupal_add_css(drupal_get_path('module', 'locale') . '/locale.css');
585

  
586
  // Include both translated and not yet translated target languages in the
587
  // list. The source language is English for built-in strings and the default
588
  // language for other strings.
589
  $languages = language_list();
590
  $default = language_default();
591
  $omit = $string['group'] == 'default' ? 'en' : variable_get('i18n_string_source_language', $default->language);
592
  unset($languages[$omit]);
593
  $output = '';
594
  foreach ($languages as $langcode => $language) {
595
    if (!$limit_language || $limit_language == $langcode) {
596
      $output .= (!empty($string['languages'][$langcode])) ? $langcode . ' ' : "<em class=\"locale-untranslated\">$langcode</em> ";
597
    }
598
  }
599

  
600
  return $output;
601
}
drupal7/sites/all/modules/i18n/i18n_sync/i18n_sync.info
10 10
files[] = i18n_sync.module.inc
11 11
files[] = i18n_sync.node.inc
12 12
files[] = i18n_sync.test
13
; Information added by Drupal.org packaging script on 2020-06-17
14
version = "7.x-1.27"
13
; Information added by Drupal.org packaging script on 2021-04-26
14
version = "7.x-1.31"
15 15
core = "7.x"
16 16
project = "i18n"
17
datestamp = "1592373390"
17
datestamp = "1619398284"
drupal7/sites/all/modules/i18n/i18n_taxonomy/i18n_taxonomy.info
11 11
files[] = i18n_taxonomy.admin.inc
12 12
files[] = i18n_taxonomy.test
13 13

  
14
; Information added by Drupal.org packaging script on 2020-06-17
15
version = "7.x-1.27"
14
; Information added by Drupal.org packaging script on 2021-04-26
15
version = "7.x-1.31"
16 16
core = "7.x"
17 17
project = "i18n"
18
datestamp = "1592373390"
18
datestamp = "1619398284"
drupal7/sites/all/modules/i18n/i18n_taxonomy/i18n_taxonomy.module
383 383
    if ($vocabulary = taxonomy_vocabulary_machine_name_load($tree['vocabulary'])) {
384 384
      if (i18n_taxonomy_vocabulary_mode($vocabulary->vid) == I18N_MODE_TRANSLATE) {
385 385
        $parent = i18n_taxonomy_translation_term_tid($tree['parent'], NULL, $tree['parent']);
386
        $language = i18n_language_context();
387
        $terms = i18n_taxonomy_get_tree($vocabulary->vid, $language->language, $parent);
386
        $context_language = i18n_language_context();
387
        $terms = i18n_taxonomy_get_tree($vocabulary->vid, $context_language->language, $parent);
388 388
      }
389 389
      else {
390 390
        $terms = taxonomy_get_tree($vocabulary->vid, $tree['parent']);
drupal7/sites/all/modules/i18n/i18n_translation/README.txt
12 12

  
13 13
It also provides some basic storage for translation sets and a generator of new translation set id.
14 14
However, each module is responsible for storing which objects belong to which translation set for which
15
it needs to verride some methods of the base i18n_translation_set class.
15
it needs to override some methods of the base i18n_translation_set class.
16 16

  
17 17
- load_translations()
18 18
- save_translations()
drupal7/sites/all/modules/i18n/i18n_translation/i18n_translation.info
6 6

  
7 7
files[] = i18n_translation.inc
8 8

  
9
; Information added by Drupal.org packaging script on 2020-06-17
10
version = "7.x-1.27"
9
; Information added by Drupal.org packaging script on 2021-04-26
10
version = "7.x-1.31"
11 11
core = "7.x"
12 12
project = "i18n"
13
datestamp = "1592373390"
13
datestamp = "1619398284"
drupal7/sites/all/modules/i18n/i18n_user/i18n_user.info
4 4
package = Multilingual - Internationalization
5 5
dependencies[] = i18n_variable
6 6

  
7
; Information added by Drupal.org packaging script on 2020-06-17
8
version = "7.x-1.27"
7
; Information added by Drupal.org packaging script on 2021-04-26
8
version = "7.x-1.31"
9 9
core = "7.x"
10 10
project = "i18n"
11
datestamp = "1592373390"
11
datestamp = "1619398284"
drupal7/sites/all/modules/i18n/i18n_variable/i18n_variable.info
10 10
files[] = i18n_variable.class.inc
11 11
files[] = i18n_variable.test
12 12

  
13
; Information added by Drupal.org packaging script on 2020-06-17
14
version = "7.x-1.27"
13
; Information added by Drupal.org packaging script on 2021-04-26
14
version = "7.x-1.31"
15 15
core = "7.x"
16 16
project = "i18n"
17
datestamp = "1592373390"
17
datestamp = "1619398284"
drupal7/sites/all/modules/i18n/tests/i18n_test.info
7 7
core = 6.x
8 8
hidden = TRUE
9 9

  
10
; Information added by Drupal.org packaging script on 2020-06-17
11
version = "7.x-1.27"
10
; Information added by Drupal.org packaging script on 2021-04-26
11
version = "7.x-1.31"
12 12
core = "7.x"
13 13
project = "i18n"
14
datestamp = "1592373390"
14
datestamp = "1619398284"

Formats disponibles : Unified diff