1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Lack of Interest Friendly URLs and translate special characters

Discussion in 'Closed Suggestions' started by Sasa, Oct 1, 2011.

  1. Sasa

    Sasa Active Member

    It would be nice if it were possible to translate characters for languages ​​that use special characters. For example, the threads title Übergrößenträger has a URL link
    Code:
    http://demo.xenforo.com/104/threads/Übergrößenträger.3/
    And I believe that herbs and more beautiful if the link was:
    Code:
    http://demo.xenforo.com/104/threads/Uebergroessentraeger.3/
    This could be solved by adding options AdminCP to translate special characters for languages ​​that have them.
     
    Dinh Thanh and Marcus like this.
  2. yavuz

    yavuz Well-Known Member

    Sasa, this is something that I have problems with the Turkish language either. It's has been marked as a a "Future fix" but if you don't mind making a template edit, a user made a modification that solves the mystery. Please visit the Non-English letters are not lowercasing in URLs message where also you'll be able to find additional info regarding this problem.

    Note that I did not test it myself, so backup first and then edit :)
     
    Sasa likes this.
  3. Sasa

    Sasa Active Member

    In file Link.php
    Find

    PHP:
                $title utf8_romanize(utf8_deaccent($title));
     
            }
    Add below


    PHP:
            $aPattern = array (
     
                
    "Dj" => "Đ|Ђ" ,
     
                
    "dj" => "đ|ђ" ,
     
                
    "Z" => "Ž|З|Ж" ,
     
                
    "z" => "ž|з|ж" ,
     
                
    "C" => "Ć|Č|Ч|Ц|Ћ" ,
     
                
    "c" => "č|ć|ч|ц|ћ" ,
     
                
    "S" => "Š|Ш|С" ,
     
                
    "s" => "š|ш|с" ,
     
                
    "Dz" => "DŽ|Џ" ,
     
                
    "dz" => "dž|џ" ,
     
                
    "B" => "Б" ,
     
                
    "b" => "б" ,
     
                
    "V" => "В" ,
     
                
    "v" => "в" ,
     
                
    "G" => "Г" ,
     
                
    "g" => "г" ,
     
                
    "Nj" => "Њ" ,
     
                
    "nj" => "њ" ,
     
                
    "Lj" => "Љ" ,
     
                
    "lj" => "љ" ,
     
                
    "D" => "Д" ,
     
                
    "d" => "д" ,
     
                
    "I" => "И" ,
     
                
    "i" => "и" ,
     
                
    "K" => "К" ,
     
                
    "k" => "к" ,
     
                
    "L" => "Л" ,
     
                
    "l" => "л" ,
     
                
    "M" => "М" ,
     
                
    "m" => "м" ,
     
                
    "N" => "Н" ,
     
                
    "n" => "н" ,
     
                
    "P" => "П" ,
     
                
    "p" => "п" ,
     
                
    "R" => "Р" ,
     
                
    "r" => "р" ,
     
                
    "T" => "Т" ,
     
                
    "t" => "т" ,
     
                
    "U" => "У" ,
     
                
    "u" => "у" ,
     
                
    "F" => "ф" ,
     
                
    "f" => "Ф" ,
     
                
    "H" => "Х" ,
     
                
    "h" => "х" ,
     
                
    "A" => "А" ,
     
                
    "a" => "а" ,
     
                
    "E" => "Е" ,
     
                
    "e" => "е" ,
     
                
    "O" => "О" ,
     
                
    "o" => "о" ,
     
                
    "H" => "Х" ,
     
                
    "h" => "х" ,
     
                
    "J" => "Ј" ,
     
                
    "j" => "ј" ,
     
            );       
     
            while(list( 
    $key $value ) = each $aPattern ))
     
            {
     
            
    $title = @ ereg_replace $value $key $title );
     
            }
    How will this affect the running of the forums and servers?
     
    Fuhrmann likes this.
  4. Dinh Thanh

    Dinh Thanh Well-Known Member

    In this way we need to modify code, it is better to have an Addon to do this or it is in Xenforo Core.
     
    dondomainer and Jarod like this.

Share This Page