Index: pathauto.inc =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/pathauto/pathauto.inc,v retrieving revision 1.46 diff -u -p -r1.46 pathauto.inc --- pathauto.inc 24 Jun 2008 11:20:36 -0000 1.46 +++ pathauto.inc 24 Jun 2008 14:14:09 -0000 @@ -126,10 +126,12 @@ function _pathauto_existing_alias_data($ * A string to clean. * @param $clean_slash * Whether to clean slashes from the given string. + * @param $language + * Language to use when transliteration is enabled. * @return * The cleaned string. */ -function pathauto_cleanstring($string, $clean_slash = TRUE) { +function pathauto_cleanstring($string, $clean_slash = TRUE, $language = NULL) { // Default words to ignore $ignore_words = array( 'a', 'an', 'as', 'at', 'before', 'but', 'by', 'for', 'from', 'is', 'in', @@ -158,7 +160,7 @@ function pathauto_cleanstring($string, $ // Optionally transliterate (by running through the Transliteration module) if (variable_get('pathauto_transliterate', FALSE)) { if (module_exists('transliteration')) { - $output = transliteration_get($output); + $output = transliteration_get($output, '', $language); } else { drupal_set_message(t('Pathauto could not transliterate the path, as the Transliteration module has been disabled.'), 'error'); @@ -424,7 +426,9 @@ function pathauto_get_placeholders($type if (function_exists('token_get_values')) { $full = token_get_values($type, $object, TRUE); $tokens = token_prepare_tokens($full->tokens); - $values = pathauto_clean_token_values($full); + // Get language from object used in transliteration. + $language = isset($object->language) ? $object->language : NULL; + $values = pathauto_clean_token_values($full, $language); return array('tokens' => $tokens, 'values' => $values); } // TODO at some point try removing this and see if install profiles have problems again. @@ -437,17 +441,19 @@ function pathauto_get_placeholders($type * * @param $full * An array of token values that need to be "cleaned" for use in the URL. + * @param $language + * Language to use when transliteration is enabled. * @return * An array of the cleaned tokens. */ -function pathauto_clean_token_values($full) { +function pathauto_clean_token_values($full, $language = NULL) { foreach ($full->values as $key => $value) { // If it's a "path" or "url friendly" token don't remove the "/" character if (drupal_substr($full->tokens[$key], -4, 4) === 'path' || drupal_substr($full->tokens[$key], -8, 8) === 'path-raw' || drupal_substr($full->tokens[$key], -5, 5) === 'alias') { - $full->values[$key] = pathauto_cleanstring($value, FALSE); + $full->values[$key] = pathauto_cleanstring($value, FALSE, $language); } else { - $full->values[$key] = pathauto_cleanstring($value); + $full->values[$key] = pathauto_cleanstring($value, TRUE, $language); } } return $full->values;