Login    
    Register FAQ  •  Search    
It is currently Mon Nov 23, 2009 8:40 pm

All times are UTC + 5:30 hours


Forum rules


Please click here to view the forum rules



Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: How to remove translated links from certina sub directories
PostPosted: Sun Aug 31, 2008 6:20 am 
Offline

Joined: Mon Aug 25, 2008 3:45 am
Posts: 13
This works for http://www.someurl.com/subdir/../../langcode/

Code:
function tgTranslatorPostFilterHook($data, $language, $engine, $url, $translationError = false) {
   if($translationError) {
      // 302 temporary redirect to the original untranslated page for any ‘TRANSLATION ERROR’ @header(”HTTP/1.1 302 Moved Temporarily”);
      @header("Location: " . $url);
      @header("Status: 302 Moved Temporarily");
      exit();
   }
   $subs = 'dir1|dir2|dir3';
   $domain = 'someurl';
   $langs = 'de|pt|pt_BR|ko|es|es_MX|fr|it|ja|zh|zh_TW|ar|nl|el|ru|no|en|bg|hr|cs|da|fi|hu|is|tl|pl|ro|sr|sl|cy|tr|la|sv';
   $expression = '%(http://www\.'.$domain.'\.com/(?:'.$subs.')(?:/[^/]+)*)/('.$langs.')/%';
   return preg_replace($expression,'\1',$data);
}


 Profile  
 Post subject: Re: How to remove translated links from certina sub directories
PostPosted: Sat Feb 28, 2009 12:48 pm 
Offline
Site Admin

Joined: Mon Feb 11, 2008 5:02 am
Posts: 29
Thanks for sharing. -- Angsuman


 Profile  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC + 5:30 hours


Who is online

Users browsing this forum: Yahoo [Bot] and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
cron


Copyright© 2000-2008 Taragana | Products | Services | Blog | Support