? .token.module.swp
? token_segment_cache.patch
Index: token.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/token/token.module,v
retrieving revision 1.7.4.30
diff -u -r1.7.4.30 token.module
--- token.module	9 Jul 2010 17:27:48 -0000	1.7.4.30
+++ token.module	16 Jul 2010 19:09:07 -0000
@@ -68,7 +68,7 @@
  *   A keyed array containing the substitution tokens and the substitution
  *   values for the passed-in type and object.
  */
-function token_token_values($type, $object = NULL) {
+function token_token_values($type, $object = NULL, $language) {
   global $user;
   global $base_url;
   $values = array();
@@ -169,8 +169,8 @@
  * @return The modified version of $original, with all substitutions
  *   made.
  */
-function token_replace($original, $type = 'global', $object = NULL, $leading = TOKEN_PREFIX, $trailing = TOKEN_SUFFIX, $options = array(), $flush = FALSE) {
-  $full = token_get_values($type, $object, $flush, $options);
+function token_replace($original, $type = 'global', $object = NULL, $leading = TOKEN_PREFIX, $trailing = TOKEN_SUFFIX, $language = null, $flush = FALSE) {
+  $full = token_get_values($type, $object, $flush, $language);
   return _token_replace_tokens($original, $full->tokens, $full->values, $leading, $trailing);
 }
 
@@ -204,11 +204,11 @@
  * @return The modified version of $original, with all substitutions
  *   made.
  */
-function token_replace_multiple($original, $types = array('global' => NULL), $leading = TOKEN_PREFIX, $trailing = TOKEN_SUFFIX, $options = array(), $flush = FALSE) {
+function token_replace_multiple($original, $types = array('global' => NULL), $leading = TOKEN_PREFIX, $trailing = TOKEN_SUFFIX, $language = null, $flush = FALSE) {
   $full = new stdClass();
   $full->tokens = $full->values = array();
   foreach ($types as $type => $object) {
-    $temp = token_get_values($type, $object, $flush, $options);
+    $temp = token_get_values($type, $object, $flush, $language);
     $full->tokens = array_merge($full->tokens, $temp->tokens);
     $full->values = array_merge($full->values, $temp->values);
   }
@@ -240,14 +240,21 @@
  *   of tokens in a single execution cycle. Flushing it will
  *   keep them from burning through memory.
  *   The default is FALSE.
+ * @param language 
+ *   A language object to be used when generating locale-sensitive tokens.
  * @return
  *   A keyed array containing the substitution tokens and the substitution
  *   values for the passed-in type and object.
  */
-function token_get_values($type = 'global', $object = NULL, $flush = FALSE, $options = array()) {
+function token_get_values($type = 'global', $object = NULL, $flush = FALSE, $language = null) {
   static $tokens;
   static $running;
 
+  // Use the global language if no language was speficially requested.
+  if ($language == null) {
+    global $language;
+  }
+
   // Flush the static token cache. Useful for processes that need to slog through
   // huge numbers of tokens in a single execution cycle. Flushing it will keep
   // them from burning through memory.
@@ -277,22 +284,23 @@
 
   token_include();
 
+  $lc = $language->language;
   $id = _token_get_id($type, $object);
-  if ($id && isset($tokens[$type][$id])) {
-    $tmp_tokens = $tokens[$type][$id];
+  if ($id && isset($tokens[$lc][$type][$id])) {
+    $tmp_tokens = $tokens[$lc][$type][$id];
   }
   else {
-    $tmp_tokens = module_invoke_all('token_values', $type, $object, $options);
-    $tokens[$type][$id] = $tmp_tokens;
+    $tmp_tokens = module_invoke_all('token_values', $type, $object, $language);
+    $tokens[$lc][$type][$id] = $tmp_tokens;
   }
 
   // Special-case global tokens, as we always want to be able to process
   // those substitutions.
-  if (!isset($tokens['global']['default'])) {
-    $tokens['global']['default'] = module_invoke_all('token_values', 'global');
+  if (!isset($tokens[$lc]['global']['default'])) {
+    $tokens[$lc]['global']['default'] = module_invoke_all('token_values', 'global', null, $language);
   }
 
-  $all = _token_array_merge($tokens['global']['default'], $tokens[$type][$id]);
+  $all = _token_array_merge($tokens[$lc]['global']['default'], $tokens[$lc][$type][$id]);
 
   $result = new stdClass();
   $result->tokens = array_keys($all);
Index: token_comment.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/token/Attic/token_comment.inc,v
retrieving revision 1.3.4.11
diff -u -r1.3.4.11 token_comment.inc
--- token_comment.inc	8 Jul 2010 00:41:19 -0000	1.3.4.11
+++ token_comment.inc	16 Jul 2010 19:09:07 -0000
@@ -16,7 +16,7 @@
 /**
  * Implementation of hook_token_values().
  */
-function comment_token_values($type, $object = NULL, $options = array()) {
+function comment_token_values($type, $object = NULL, $language) {
   $values = array();
   switch ($type) {
     case 'comment':
Index: token_node.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/token/Attic/token_node.inc,v
retrieving revision 1.5.4.27
diff -u -r1.5.4.27 token_node.inc
--- token_node.inc	5 Jul 2010 19:49:49 -0000	1.5.4.27
+++ token_node.inc	16 Jul 2010 19:09:07 -0000
@@ -17,7 +17,7 @@
 /**
  * Implementation of hook_token_values().
  */
-function node_token_values($type, $object = NULL, $options = array()) {
+function node_token_values($type, $object = NULL, $language) {
   $values = array();
   switch ($type) {
     case 'node':
@@ -268,7 +268,7 @@
 /**
  * Implementation of hook_token_values() for book nodes
  */
-function book_token_values($type, $object = NULL, $options = array()) {
+function book_token_values($type, $object = NULL, $language) {
   if ($type == 'node') {
     $node = $object;
 
Index: token_taxonomy.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/token/Attic/token_taxonomy.inc,v
retrieving revision 1.3.4.5
diff -u -r1.3.4.5 token_taxonomy.inc
--- token_taxonomy.inc	5 Jun 2010 16:45:58 -0000	1.3.4.5
+++ token_taxonomy.inc	16 Jul 2010 19:09:07 -0000
@@ -17,7 +17,7 @@
 /**
  * Implementation of hook_token_values().
  */
-function taxonomy_token_values($type, $object = NULL, $options = array()) {
+function taxonomy_token_values($type, $object = NULL, $language) {
   $values = array();
   switch ($type) {
     case 'taxonomy':
Index: token_user.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/token/Attic/token_user.inc,v
retrieving revision 1.3.4.9
diff -u -r1.3.4.9 token_user.inc
--- token_user.inc	5 Jul 2010 19:49:50 -0000	1.3.4.9
+++ token_user.inc	16 Jul 2010 19:09:07 -0000
@@ -17,7 +17,7 @@
 /**
  * Implementation of hook_token_values().
  */
-function user_token_values($type, $object = NULL, $options = array()) {
+function user_token_values($type, $object = NULL, $language) {
   $values = array();
   switch ($type) {
     case 'user':
