Bug: URL Latin set
Hi, I'm using the software in Turkish. Turkish characters , but the URL remains valid.
Example:
www.site.com/index.php?categorie5/foto-raf (ğ)
Must be:
www.site.com/index.php?categorie5/fotograf (g)
For the above example it has categories. If there are problems on the tags as follows.
Example:
http://www.site.com/index.php?tag/geli-im-ca (gelişim-çağı)
Must be:
http://www.site.com/index.php?tag/gelisim-cagi
How can I fix these issues? Is there a plug-in?
Thanks.
Example:
www.site.com/index.php?categorie5/foto-raf (ğ)
Must be:
www.site.com/index.php?categorie5/fotograf (g)
For the above example it has categories. If there are problems on the tags as follows.
Example:
http://www.site.com/index.php?tag/geli-im-ca (gelişim-çağı)
Must be:
http://www.site.com/index.php?tag/gelisim-cagi
How can I fix these issues? Is there a plug-in?
Thanks.
0
Connectez-vous ou Inscrivez-vous pour répondre.
Réponses
It might help the developer I think.
exemple: é will give e, à will give a
for non recognized caracters by the function title2url, accented caracters are replaced by -
this is how plxUtils::title2url works
Consultant PluXml
Ancien responsable et développeur de PluXml (2010 à 2018)
OK. I also can help improve Turkish. I even started translating the language file . Characters are as follows .
$tr = ('ş','Ş','ı','I','İ','ğ','Ğ','ü','Ü','ö','Ö','Ç','ç','(',')','/',':',',');
$eng = ('s','s','i','i','i','g','g','u','u','o','o','c','c','','','-','-','');
Peki, nasıl benim soruya cevap alabilirim? Nasıl URL düzeltme eklerim?
Thanks.
I found the function line. How do I change? I know PHP at an intermediate level. Thanks.
class.plx.utils.php
[== PHP ==] public static function title2filename($str) { $str = strtolower(plxUtils::removeAccents($str,PLX_CHARSET)); $str = str_replace('|','',$str); $str = preg_replace('/\.{2,}/', '.', $str); $str = preg_replace('/[^[:alnum:]|.|_]+/',' ',$str); return strtr(ltrim(trim($str),'.'), ' ', '-'); }mais la fonction htmlentities ne fonctionne pas de la même façon avec toutes les lettres alors j'ai proposé la correction là :
https://github.com/pluxml/PluXml/pull/175
Let's see if it works for you
public static function removeAccents($str,$charset='utf-8') { $str = htmlentities($str, ENT_NOQUOTES, $charset); $a = array('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', 'ŷ', 'Ÿ', 'Ź', 'ź', 'Ż', 'ż', 'Ž', 'ž', 'ſ', 'ƒ', 'Ơ', 'ơ', 'Ư', 'ư', 'Ǎ', 'ǎ', 'Ǐ', 'ǐ', 'Ǒ', 'ǒ', 'Ǔ', 'ǔ', 'Ǖ', 'ǖ', 'Ǘ', 'ǘ', 'Ǚ', 'ǚ', 'Ǜ', 'ǜ', 'Ǻ', 'ǻ', 'Ǽ', 'ǽ', 'Ǿ', 'ǿ'); $b = array('A', 'A', 'A', 'A', 'A', 'A', 'AE', 'C', 'E', 'E', 'E', 'E', 'I', 'I', 'I', 'I', 'D', 'N', 'O', 'O', 'O', 'O', 'O', 'O', 'U', 'U', 'U', 'U', 'Y', 's', 'a', 'a', 'a', 'a', 'a', 'a', 'ae', 'c', 'e', 'e', 'e', 'e', 'i', 'i', 'i', 'i', 'n', 'o', 'o', 'o', 'o', 'o', 'o', 'u', 'u', 'u', 'u', 'y', 'y', 'A', 'a', 'A', 'a', 'A', 'a', 'C', 'c', 'C', 'c', 'C', 'c', 'C', 'c', 'D', 'd', 'D', 'd', 'E', 'e', 'E', 'e', 'E', 'e', 'E', 'e', 'E', 'e', 'G', 'g', 'G', 'g', 'G', 'g', 'G', 'g', 'H', 'h', 'H', 'h', 'I', 'i', 'I', 'i', 'I', 'i', 'I', 'i', 'I', 'i', 'IJ', 'ij', 'J', 'j', 'K', 'k', 'L', 'l', 'L', 'l', 'L', 'l', 'L', 'l', 'l', 'l', 'N', 'n', 'N', 'n', 'N', 'n', 'n', 'O', 'o', 'O', 'o', 'O', 'o', 'OE', 'oe', 'R', 'r', 'R', 'r', 'R', 'r', 'S', 's', 'S', 's', 'S', 's', 'S', 's', 'T', 't', 'T', 't', 'T', 't', 'U', 'u', 'U', 'u', 'U', 'u', 'U', 'u', 'U', 'u', 'U', 'u', 'W', 'w', 'Y', 'y', 'Y', 'Z', 'z', 'Z', 'z', 'Z', 'z', 's', 'f', 'O', 'o', 'U', 'u', 'A', 'a', 'I', 'i', 'O', 'o', 'U', 'u', 'U', 'u', 'U', 'u', 'U', 'u', 'U', 'u', 'A', 'a', 'AE', 'ae', 'O', 'o'); $str = str_replace($a, $b, $str); $str = preg_replace('#\&([A-za-z])(?:acute|cedil|circ|grave|ring|tilde|uml|uro)\;#', '\1', $str); $str = preg_replace('#\&([A-za-z]{2})(?:lig)\;#', '\1', $str); # pour les ligatures e.g. 'œ' $str = preg_replace('#\&[^;]+\;#', '', $str); # supprime les autres caractères return $str; }Consultant PluXml
Ancien responsable et développeur de PluXml (2010 à 2018)