https://bugzilla.wikimedia.org/show_bug.cgi?id=30047

--- Comment #1 from Harald Stowasser <[email protected]> 2011-07-25 
13:47:32 UTC ---
better:


 global $wgLanguageSelectorRequestedLanguage, $wgLanguageNames,
$wgLanguageSelectorAdjustContent;
  if( isset($wgLanguageSelectorRequestedLanguage) &&
strlen($wgLanguageSelectorRequestedLanguage)>0){
    if( isset($wgLanguageSelectorAdjustContent) &&
$wgLanguageSelectorAdjustContent=== LANGUAGE_SELECTOR_ADJUST_CONTENT){
      $langstr="/".$wgLanguageSelectorRequestedLanguage;
      $searchstr="#/(". implode('|',array_keys($wgLanguageNames)) ."$)#";
      if(preg_match($searchstr,$title->mTextform)){
        $title->mTextform =preg_replace($searchstr,$langstr,
$title->mTextform);
        $title->mUrlform =preg_replace($searchstr,$langstr, $title->mUrlform);
        $title->mDbkeyform =preg_replace($searchstr,$langstr,
$title->mDbkeyform);
        $title->mUserCaseDBKey =preg_replace($searchstr,$langstr,
$title->mUserCaseDBKey);
      }else{
        if($_GET['setlang']== $wgLanguageSelectorRequestedLanguage){
          $title->mTextform.=$langstr;
          $title->mUrlform.=$langstr;
          $title->mDbkeyform.=$langstr;
          $title->mUserCaseDBKey.=$langstr;
        }
      }
    }
  }
  return true;

-- 
Configure bugmail: https://bugzilla.wikimedia.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.

_______________________________________________
Wikibugs-l mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l

Reply via email to