Browse Source

[up] i18n 7.x-1.22

opi 7 years ago
parent
commit
38fc00724a
25 changed files with 111 additions and 59 deletions
  1. 3 3
      sites/all/modules/i18n/i18n.info
  2. 2 1
      sites/all/modules/i18n/i18n.module
  3. 3 3
      sites/all/modules/i18n/i18n_block/i18n_block.info
  4. 13 2
      sites/all/modules/i18n/i18n_block/i18n_block.module
  5. 3 3
      sites/all/modules/i18n/i18n_contact/i18n_contact.info
  6. 3 3
      sites/all/modules/i18n/i18n_field/i18n_field.info
  7. 3 3
      sites/all/modules/i18n/i18n_forum/i18n_forum.info
  8. 3 3
      sites/all/modules/i18n/i18n_menu/i18n_menu.info
  9. 3 3
      sites/all/modules/i18n/i18n_node/i18n_node.info
  10. 3 1
      sites/all/modules/i18n/i18n_node/i18n_node.module
  11. 3 3
      sites/all/modules/i18n/i18n_path/i18n_path.info
  12. 3 3
      sites/all/modules/i18n/i18n_redirect/i18n_redirect.info
  13. 3 3
      sites/all/modules/i18n/i18n_select/i18n_select.info
  14. 11 1
      sites/all/modules/i18n/i18n_string/i18n_string.inc
  15. 3 3
      sites/all/modules/i18n/i18n_string/i18n_string.info
  16. 12 0
      sites/all/modules/i18n/i18n_string/i18n_string.install
  17. 9 2
      sites/all/modules/i18n/i18n_string/i18n_string.module
  18. 3 3
      sites/all/modules/i18n/i18n_sync/i18n_sync.info
  19. 3 3
      sites/all/modules/i18n/i18n_taxonomy/i18n_taxonomy.info
  20. 5 0
      sites/all/modules/i18n/i18n_taxonomy/i18n_taxonomy.module
  21. 3 3
      sites/all/modules/i18n/i18n_translation/i18n_translation.info
  22. 3 3
      sites/all/modules/i18n/i18n_user/i18n_user.info
  23. 5 1
      sites/all/modules/i18n/i18n_user/i18n_user.module
  24. 3 3
      sites/all/modules/i18n/i18n_variable/i18n_variable.info
  25. 3 3
      sites/all/modules/i18n/tests/i18n_test.info

+ 3 - 3
sites/all/modules/i18n/i18n.info

@@ -8,9 +8,9 @@ files[] = i18n_object.inc
 files[] = i18n.test
 configure = admin/config/regional/i18n
 
-; Information added by Drupal.org packaging script on 2017-06-17
-version = "7.x-1.18"
+; Information added by Drupal.org packaging script on 2017-11-26
+version = "7.x-1.22"
 core = "7.x"
 project = "i18n"
-datestamp = "1497704047"
+datestamp = "1511689989"
 

+ 2 - 1
sites/all/modules/i18n/i18n.module

@@ -198,7 +198,8 @@ function i18n_language_field_extra() {
  */
 function i18n_language_list($field = 'name', $mode = NULL) {
   $mode = isset($mode) ? $mode : variable_get('i18n_language_list', I18N_LANGUAGE_ENABLED);
-  return locale_language_list($field, I18N_LANGUAGE_EXTENDED & $mode);
+  $all = I18N_LANGUAGE_EXTENDED & $mode;
+  return locale_language_list($field, $all);
 }
 
 /**

+ 3 - 3
sites/all/modules/i18n/i18n_block/i18n_block.info

@@ -8,9 +8,9 @@ files[] = i18n_block.inc
 files[] = i18n_block.test
 
 
-; Information added by Drupal.org packaging script on 2017-06-17
-version = "7.x-1.18"
+; Information added by Drupal.org packaging script on 2017-11-26
+version = "7.x-1.22"
 core = "7.x"
 project = "i18n"
-datestamp = "1497704047"
+datestamp = "1511689989"
 

+ 13 - 2
sites/all/modules/i18n/i18n_block/i18n_block.module

@@ -38,6 +38,17 @@ function i18n_block_menu() {
 }
 
 /**
+ * Implements hook_permission().
+ */
+function i18n_block_permission() {
+  return array(
+    'translate blocks' => array(
+      'title' => t('Translate Blocks'),
+    ),
+  );
+}
+
+/**
  * Implement hook_menu_alter().
  *
  * Reorganize block tabs so that they make sense.
@@ -59,7 +70,7 @@ function i18n_block_menu_alter(&$items) {
  */
 function i18n_block_translate_tab_access($module, $delta) {
   $block = block_load($module, $delta);
-  return user_access('translate interface') && $block && isset($block->i18n_mode) && ($block->i18n_mode == I18N_MODE_LOCALIZE);
+  return (user_access('translate interface') || user_access('translate blocks')) && $block && isset($block->i18n_mode) && ($block->i18n_mode == I18N_MODE_LOCALIZE);
 }
 
 /**
@@ -226,7 +237,7 @@ function i18n_block_form_block_admin_configure_alter(&$form, &$form_state, $form
     '#options' => i18n_language_list(),
     '#description' => t('If no language is selected, block will show regardless of language.'),
   );
-  if (user_access('translate interface')) {
+  if (user_access('translate interface') || user_access('translate blocks')) {
     $form['actions']['translate'] = array(
       '#type' => 'submit',
       '#name'   => 'save_translate',

+ 3 - 3
sites/all/modules/i18n/i18n_contact/i18n_contact.info

@@ -5,9 +5,9 @@ dependencies[] = i18n_string
 package = Multilingual - Internationalization
 core = 7.x
 
-; Information added by Drupal.org packaging script on 2017-06-17
-version = "7.x-1.18"
+; Information added by Drupal.org packaging script on 2017-11-26
+version = "7.x-1.22"
 core = "7.x"
 project = "i18n"
-datestamp = "1497704047"
+datestamp = "1511689989"
 

+ 3 - 3
sites/all/modules/i18n/i18n_field/i18n_field.info

@@ -6,9 +6,9 @@ package = Multilingual - Internationalization
 core = 7.x
 files[] = i18n_field.inc
 files[] = i18n_field.test
-; Information added by Drupal.org packaging script on 2017-06-17
-version = "7.x-1.18"
+; Information added by Drupal.org packaging script on 2017-11-26
+version = "7.x-1.22"
 core = "7.x"
 project = "i18n"
-datestamp = "1497704047"
+datestamp = "1511689989"
 

+ 3 - 3
sites/all/modules/i18n/i18n_forum/i18n_forum.info

@@ -7,9 +7,9 @@ package = Multilingual - Internationalization
 core = 7.x
 files[] = i18n_forum.test
 
-; Information added by Drupal.org packaging script on 2017-06-17
-version = "7.x-1.18"
+; Information added by Drupal.org packaging script on 2017-11-26
+version = "7.x-1.22"
 core = "7.x"
 project = "i18n"
-datestamp = "1497704047"
+datestamp = "1511689989"
 

+ 3 - 3
sites/all/modules/i18n/i18n_menu/i18n_menu.info

@@ -10,9 +10,9 @@ core = 7.x
 files[] = i18n_menu.inc
 files[] = i18n_menu.test
 
-; Information added by Drupal.org packaging script on 2017-06-17
-version = "7.x-1.18"
+; Information added by Drupal.org packaging script on 2017-11-26
+version = "7.x-1.22"
 core = "7.x"
 project = "i18n"
-datestamp = "1497704047"
+datestamp = "1511689989"
 

+ 3 - 3
sites/all/modules/i18n/i18n_node/i18n_node.info

@@ -9,9 +9,9 @@ configure = admin/config/regional/i18n/node
 files[]=i18n_node.test
 files[]=i18n_node.variable.inc
 
-; Information added by Drupal.org packaging script on 2017-06-17
-version = "7.x-1.18"
+; Information added by Drupal.org packaging script on 2017-11-26
+version = "7.x-1.22"
 core = "7.x"
 project = "i18n"
-datestamp = "1497704047"
+datestamp = "1511689989"
 

+ 3 - 1
sites/all/modules/i18n/i18n_node/i18n_node.module

@@ -273,7 +273,9 @@ function i18n_node_node_view($node) {
  * Handles links for extended languages. Sets current interface language.
  */
 function i18n_node_node_view_alter(&$build) {
-  $node = $build['#node'];
+  if (isset($build['#node'])) {
+    $node = $build['#node'];
+  }
   // Hide node translation links.
   if (variable_get('i18n_hide_translation_links', 0)) {
     if (isset($build['links']['translation'])) {

+ 3 - 3
sites/all/modules/i18n/i18n_path/i18n_path.info

@@ -6,9 +6,9 @@ core = 7.x
 
 files[] = i18n_path.inc
 files[] = i18n_path.test
-; Information added by Drupal.org packaging script on 2017-06-17
-version = "7.x-1.18"
+; Information added by Drupal.org packaging script on 2017-11-26
+version = "7.x-1.22"
 core = "7.x"
 project = "i18n"
-datestamp = "1497704047"
+datestamp = "1511689989"
 

+ 3 - 3
sites/all/modules/i18n/i18n_redirect/i18n_redirect.info

@@ -4,9 +4,9 @@ dependencies[] = i18n
 package = Multilingual - Internationalization
 core = 7.x
 
-; Information added by Drupal.org packaging script on 2017-06-17
-version = "7.x-1.18"
+; Information added by Drupal.org packaging script on 2017-11-26
+version = "7.x-1.22"
 core = "7.x"
 project = "i18n"
-datestamp = "1497704047"
+datestamp = "1511689989"
 

+ 3 - 3
sites/all/modules/i18n/i18n_select/i18n_select.info

@@ -6,9 +6,9 @@ core = 7.x
 configure = admin/config/regional/i18n/select
 files[] = i18n_select.test
 
-; Information added by Drupal.org packaging script on 2017-06-17
-version = "7.x-1.18"
+; Information added by Drupal.org packaging script on 2017-11-26
+version = "7.x-1.22"
 core = "7.x"
 project = "i18n"
-datestamp = "1497704047"
+datestamp = "1511689989"
 

+ 11 - 1
sites/all/modules/i18n/i18n_string/i18n_string.inc

@@ -703,9 +703,19 @@ class i18n_string_textgroup_default {
       // Create source string so we get an lid
       $this->save_source($string);
     }
+
+    // Convert objectid to objectkey if it's numeric.
     if (!isset($string->objectkey)) {
-      $string->objectkey = (int)$string->objectid;
+      if (is_numeric($string->objectid)) {
+        $string->objectkey = (int)$string->objectid;
+      }
     }
+
+    // Make sure objectkey is numeric.
+    if (!is_numeric($string->objectkey)) {
+      $string->objectkey = 0;
+    }
+
     if (!isset($string->format)) {
       $string->format = '';
     }

+ 3 - 3
sites/all/modules/i18n/i18n_string/i18n_string.info

@@ -10,9 +10,9 @@ files[] = i18n_string.inc
 files[] = i18n_string.test
 configure = admin/config/regional/i18n/strings
 
-; Information added by Drupal.org packaging script on 2017-06-17
-version = "7.x-1.18"
+; Information added by Drupal.org packaging script on 2017-11-26
+version = "7.x-1.22"
 core = "7.x"
 project = "i18n"
-datestamp = "1497704047"
+datestamp = "1511689989"
 

+ 12 - 0
sites/all/modules/i18n/i18n_string/i18n_string.install

@@ -94,6 +94,8 @@ function i18n_string_schema() {
       ),
       'objectindex' => array(
         'type' => 'int',
+        'size' => 'big',
+        'length' => 20,
         'not null' => TRUE,
         'default' => 0,
         'description' => 'Integer value of Object ID.',
@@ -245,6 +247,16 @@ function i18n_string_update_7002() {
   }
 }
 
+/**
+ * Change objectindex from int to bigint.
+ */
+function i18n_string_update_7003() {
+  db_change_field('i18n_string', 'objectindex', 'objectindex', array(
+    'type' => 'int',
+    'size' => 'big',
+    'length' => 20,
+  ));
+}
 
 /**
  * Notes for update script

+ 9 - 2
sites/all/modules/i18n/i18n_string/i18n_string.module

@@ -620,10 +620,17 @@ function i18n_string_translate_access($string_format, $account = NULL) {
  *   Message if the user cannot translate that string.
  */
 function i18n_string_translate_check_string($i18nstring, $account = NULL) {
-  if (!user_access('translate interface', $account) || !user_access('translate user-defined strings', $account)) {
+  // Check block translation permissions.
+  if ($i18nstring->textgroup == 'blocks') {
+    if (!user_access('translate interface', $account) && !user_access('translate blocks', $account)) {
+      return t('This is a user-defined string within a block. You are not allowed to translate blocks.');
+    }
+  }
+  elseif (!user_access('translate interface', $account) || !user_access('translate user-defined strings', $account)) {
     return t('This is a user-defined string. You are not allowed to translate these strings.');
   }
-  elseif (!empty($i18nstring->format)) {
+
+  if (!empty($i18nstring->format)) {
     if (!i18n_string_allowed_format($i18nstring->format)) {
       $format = filter_format_load($i18nstring->format);
       return t('This string uses the %name text format. Strings with this format are not allowed for translation.', array('%name' => $format->name));

+ 3 - 3
sites/all/modules/i18n/i18n_sync/i18n_sync.info

@@ -10,9 +10,9 @@ files[] = i18n_sync.install
 files[] = i18n_sync.module.inc
 files[] = i18n_sync.node.inc
 files[] = i18n_sync.test
-; Information added by Drupal.org packaging script on 2017-06-17
-version = "7.x-1.18"
+; Information added by Drupal.org packaging script on 2017-11-26
+version = "7.x-1.22"
 core = "7.x"
 project = "i18n"
-datestamp = "1497704047"
+datestamp = "1511689989"
 

+ 3 - 3
sites/all/modules/i18n/i18n_taxonomy/i18n_taxonomy.info

@@ -11,9 +11,9 @@ files[] = i18n_taxonomy.pages.inc
 files[] = i18n_taxonomy.admin.inc
 files[] = i18n_taxonomy.test
 
-; Information added by Drupal.org packaging script on 2017-06-17
-version = "7.x-1.18"
+; Information added by Drupal.org packaging script on 2017-11-26
+version = "7.x-1.22"
 core = "7.x"
 project = "i18n"
-datestamp = "1497704047"
+datestamp = "1511689989"
 

+ 5 - 0
sites/all/modules/i18n/i18n_taxonomy/i18n_taxonomy.module

@@ -1234,6 +1234,11 @@ function i18n_taxonomy_field_uuid_presave($entity_type, $entity, $field, $instan
  * Implements hook_entity_info_alter().
  */
 function i18n_taxonomy_entity_info_alter(&$entity_info) {
+  if (isset($entity_info['taxonomy_vocabulary'])) {
+    // Add altered vocabulary schema fields.
+    $entity_info['taxonomy_vocabulary']['schema_fields_sql']['base table'][] = 'i18n_mode';
+    $entity_info['taxonomy_vocabulary']['schema_fields_sql']['base table'][] = 'language';
+  }
   if (isset($entity_info['taxonomy_term'])) {
     // Core doesn't provide a label callback for taxonomy terms. By setting one
     // we can use it to return the correct localized term name.

+ 3 - 3
sites/all/modules/i18n/i18n_translation/i18n_translation.info

@@ -6,9 +6,9 @@ core = 7.x
 
 files[] = i18n_translation.inc
 
-; Information added by Drupal.org packaging script on 2017-06-17
-version = "7.x-1.18"
+; Information added by Drupal.org packaging script on 2017-11-26
+version = "7.x-1.22"
 core = "7.x"
 project = "i18n"
-datestamp = "1497704047"
+datestamp = "1511689989"
 

+ 3 - 3
sites/all/modules/i18n/i18n_user/i18n_user.info

@@ -4,9 +4,9 @@ core = 7.x
 package = Multilingual - Internationalization
 dependencies[] = i18n_variable
 
-; Information added by Drupal.org packaging script on 2017-06-17
-version = "7.x-1.18"
+; Information added by Drupal.org packaging script on 2017-11-26
+version = "7.x-1.22"
 core = "7.x"
 project = "i18n"
-datestamp = "1497704047"
+datestamp = "1511689989"
 

+ 5 - 1
sites/all/modules/i18n/i18n_user/i18n_user.module

@@ -9,7 +9,11 @@
  */
 function i18n_user_mail_alter(&$message) {
   if ($message['module'] == 'user') {
-    $language = (isset($message['language']) ? $message['language'] : language_default());
+    $user_preferred = language_default();
+    if (isset($message['params']['account'])) {
+      $user_preferred = user_preferred_language($message['params']['account']);
+    }
+    $language = (isset($message['language']) ? $message['language'] : $user_preferred);
     $variables = array('user' => $message['params']['account']);
     $key = $message['key'];
 

+ 3 - 3
sites/all/modules/i18n/i18n_variable/i18n_variable.info

@@ -10,9 +10,9 @@ configure = admin/config/regional/i18n/variable
 files[] = i18n_variable.class.inc
 files[] = i18n_variable.test
 
-; Information added by Drupal.org packaging script on 2017-06-17
-version = "7.x-1.18"
+; Information added by Drupal.org packaging script on 2017-11-26
+version = "7.x-1.22"
 core = "7.x"
 project = "i18n"
-datestamp = "1497704047"
+datestamp = "1511689989"
 

+ 3 - 3
sites/all/modules/i18n/tests/i18n_test.info

@@ -7,9 +7,9 @@ package = Testing
 core = 6.x
 hidden = TRUE
 
-; Information added by Drupal.org packaging script on 2017-06-17
-version = "7.x-1.18"
+; Information added by Drupal.org packaging script on 2017-11-26
+version = "7.x-1.22"
 core = "7.x"
 project = "i18n"
-datestamp = "1497704047"
+datestamp = "1511689989"