Changeset 519 for trunk/WordPress/plugin/transposh/core/utils.php
- Timestamp:
- 08/26/2010 01:57:15 AM (21 months ago)
- File:
-
- 1 edited
-
trunk/WordPress/plugin/transposh/core/utils.php (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/WordPress/plugin/transposh/core/utils.php
r512 r519 110 110 111 111 // remove the language from the url permalink (if in start of path, and is a defined language) 112 $gluebackhome = false; 112 113 $home_path = rtrim(parse_url($home_url, PHP_URL_PATH), "/"); 113 114 logger("home: $home_path " . $parsedurl['path'], 5); … … 134 135 //$params =""; 135 136 if ($is_edit) { 136 $params[ edit] = EDIT_PARAM . '=1';137 $params['edit'] = EDIT_PARAM . '=1'; 137 138 } 138 139 … … 252 253 */ 253 254 public static function translate_url($href, $home_url, $target_language, $fetch_translation_func) { 255 $url=''; 256 $querypart=''; 254 257 // todo - check query part... sanitize 255 258 if (strpos($href, '?') !== false) { … … 261 264 foreach ($parts as $part) { 262 265 if (!$part) continue; 263 list($ translated_text, $old_source) = call_user_func_array($fetch_translation_func, array($part, $target_language));266 list($source, $translated_text) = call_user_func_array($fetch_translation_func, array($part, $target_language)); 264 267 if ($translated_text) 265 268 $url .= '/' . str_replace(' ', '-', $translated_text); 266 269 else { 267 270 // now the same attempt with '-' replaced to ' ' 268 list($ translated_text, $old_source) = call_user_func_array($fetch_translation_func, array(str_replace('-', ' ', $part), $target_language));271 list($source, $translated_text) = call_user_func_array($fetch_translation_func, array(str_replace('-', ' ', $part), $target_language)); 269 272 //logger ($part. ' '.str_replace('-', ' ', $part).' '.$translated_text); 270 273 if ($translated_text) … … 289 292 $url = urldecode($href); 290 293 $url = (($pos = strpos($url, '?')) ? substr($url, 0, $pos) : $url); 294 $url2 =''; 291 295 $parts = explode('/', $url); 292 296 foreach ($parts as $part) {
Note: See TracChangeset
for help on using the changeset viewer.
