Expose a way to generate aliases for _All_ languages.

You can read the details of the issue here:
  http://drupal.org/node/321848

This version of the patch allows the user to select from three different options: Default language handling (each alias will be enabled for the language of its node), aliases for nodes without language-specific patterns will be enabled for all languages, or aliases for all nodes (including those with language-specific patterns) will be enabled for all languages. 

This version of the patch created by Jack Aponte (jackaponte) <jack@palantetech.com>, based tremendously on the work of Antonio Ospite <ospite@studenti.unina.it>.

Index: pathauto/pathauto.admin.inc
===================================================================
--- pathauto.admin.inc	2009-10-27 11:44:29.000000000 -0400
+++ pathauto.admin.inc.new	2009-10-27 11:48:22.000000000 -0400
@@ -143,6 +143,16 @@ function pathauto_admin_settings() {
     '#title' => t('Strings to Remove'), '#default_value' => variable_get('pathauto_ignore_words', implode(',', $ignore_words)),
     '#description' => t('Words to strip out of the URL alias, separated by commas. Do not place punctuation in here and do not use WYSIWYG editors on this field.'),
   );
+  
+  if (module_exists('locale')) {
+  	$form['general']['pathauto_node_enable_alias_for_all_languages'] = array(
+      '#type' => 'radios',
+      '#title' => t('Language handling for aliases of localized nodes'),
+      '#default_value' => variable_get('pathauto_node_enable_alias_for_all_languages', FALSE),
+      '#description' => t('Enable language neutral behaviour in alias creation for localized nodes. By enabling this setting, aliases for nodes <em>without language specific patterns</em> will be enabled for <strong>all languages</strong>.'),
+      '#options' => array('default_handling' => t('Default language handling. Each alias will be enabled for the language of its node.'), 'no_lang_pattern_all_langs' => t('Aliases for nodes <em>without language-specific patterns</em> will be enabled for <strong>all languages</strong>.'), 'all_aliases_all_langs' => t('Aliases for <em>all nodes</em>, including those with language-specific patterns, will be enabled for <strong>all languages</strong>.')),
+    );
+  }
 
   $form['punctuation'] = array(
     '#type' => 'fieldset',

Index: pathauto/pathauto.inc
===================================================================
--- pathauto.inc.orig	2009-10-27 15:59:05.000000000 -0400
+++ pathauto.inc	2009-10-27 16:04:52.000000000 -0400
@@ -327,7 +327,14 @@ function pathauto_create_alias($module, 
 
   // If $pid is NULL, a new alias is created - otherwise, the existing
   // alias for the designated src is replaced
+  
+  // If selected, enable all aliases for all languages while preserving language-specific patterns.
+  if (variable_get('pathauto_node_enable_alias_for_all_languages', FALSE) == 'all_aliases_all_langs') {
+		_pathauto_set_alias($src, $alias, $module, $entity_id, $pid, $verbose, $old_alias, '');
+  }
+  else {
   _pathauto_set_alias($src, $alias, $module, $entity_id, $pid, $verbose, $old_alias, $language);
+  }
 
   // Also create a related feed alias if requested, and if supported
   // by the module
@@ -341,7 +348,13 @@ function pathauto_create_alias($module, 
     }
     else {
       $update_data = _pathauto_existing_alias_data("$src/$feedappend");
+      // If selected, enable all aliases for all languages while preserving language-specific patterns.
+  	  if (variable_get('pathauto_node_enable_alias_for_all_languages', FALSE) == 'all_aliases_all_langs') {
+  		_pathauto_set_alias("$src/$feedappend", "$alias/feed", $module, $entity_id, $update_data['pid'], $verbose, $update_data['old_alias'], '');
+		}
+	  else {
       _pathauto_set_alias("$src/$feedappend", "$alias/feed", $module, $entity_id, $update_data['pid'], $verbose, $update_data['old_alias'], $language);
+      }	
     }
   }
 
Index: pathauto/pathauto.module
=================================================================== 
--- pathauto.module.orig	2009-10-27 15:59:05.000000000 -0400
+++ pathauto.module	2009-10-27 16:04:52.000000000 -0400
@@ -241,8 +241,16 @@ function pathauto_nodeapi(&$node, $op, $
           if (!isset($node->pathauto_perform_alias) || $node->pathauto_perform_alias) {
             $placeholders = pathauto_get_placeholders('node', $node);
             $src = "node/$node->nid";
-            $alias = pathauto_create_alias('node', $op, $placeholders, $src, $node->nid, $node->type, $node->language);
-          }
+
+            $_lang = $node->language;
+            // If there is not a language specific pattern then see if we have to
+            // create the alias for all languages
+            if ('' == variable_get('pathauto_node_' . $node->type . '_' . $node->language . '_pattern', '')) {
+              if (variable_get('pathauto_node_enable_alias_for_all_languages', FALSE) == 'no_lang_pattern_all_langs') {
+                $_lang = '';
+              }
+            }
+            $alias = pathauto_create_alias('node', $op, $placeholders, $src, $node->nid, $node->type, $_lang);          }
         }
         break;
       case 'delete':
@@ -354,7 +362,16 @@ function pathauto_node_operations_update
   foreach ($nodes as $nid) {
     $node = node_load($nid);
     $placeholders = pathauto_get_placeholders('node', $node);
-    pathauto_create_alias('node', 'bulkupdate', $placeholders, "node/$node->nid", $node->nid, $node->type);
+
+    $_lang = $node->language;
+    // If there is not a language specific pattern then see if we have to
+    // create the alias for all languages
+    if ('' == variable_get('pathauto_node_' . $node->type . '_' . $node->language . '_pattern', '')) {
+      if (variable_get('pathauto_node_enable_alias_for_all_languages', FALSE) == 'no_lang_pattern_all_langs') {
+        $_lang = '';
+      }
+    }
+    pathauto_create_alias('node', 'bulkupdate', $placeholders, "node/$node->nid", $node->nid, $node->type, $_lang);
   }
 }
 
Index: pathauto/pathauto_node.inc
=================================================================== 
--- pathauto_node.inc	2009-10-27 15:59:05.000000000 -0400
+++ pathauto_node.inc.new	2009-10-27 16:03:09.000000000 -0400
@@ -112,7 +112,17 @@ function node_pathauto_bulkupdate() {
       }
       $placeholders = pathauto_get_placeholders('node', $node);
       $src = "node/$node->nid";
-      if (pathauto_create_alias('node', 'bulkupdate', $placeholders, $src, $node->nid, $node->type, $node->language)) {
+      
+      $_lang = $node->language;
+      // If there is not a language specific pattern then see if we have to
+      // create the alias for all languages
+      if ('' == variable_get('pathauto_node_'. $node->type . '_' . $node->language . '_pattern', '')) {
+        if (variable_get('pathauto_node_enable_alias_for_all_languages', FALSE) == 'no_lang_pattern_all_langs') {
+          $_lang = '';
+         }
+       }
+
+      if (pathauto_create_alias('node', 'bulkupdate', $placeholders, $src, $node->nid, $node->type, $_lang)) {
         $count++;
       }
     }
