4 * Conditional definition of conf_url_rewrite
8 function conf_url_rewrite($path, $mode = 'incoming') {
9 if(variable_get('i18n_keep','')=='url'){
10 return i18n_url_rewrite($path,$mode);
16 function i18n_url_rewrite($path, $mode = 'incoming') {
17 global $i18n_langpath;
18 if ($mode == 'incoming') { // URL coming from a client
19 if($i18n_langpath=i18n_get_lang_prefix($path)){
20 // Remove language from path and try to find alias for new path
21 $path=substr($path,3);
22 return drupal_get_normal_path($path);
28 else { // URL going out to a client
30 return "$i18n_langpath/$path";
37 // Get language from path, but only if it is in the $languages array
38 function i18n_get_lang_prefix($path){
40 $split=split("/",$path);
42 if($languages[$maybelang]){