Forum Archive - Language code conflicts with page urls

Language code conflicts with page urls
Oct 9, 2014 3:28 pm by sadashiv
Hi, I have a site made in drupal and I am using organic groups module of drupal so mostly the urls were http://mydomain.com/og/ After enabling gtranslate these pages showed page not found. I checked error logs for this issue and found that its try to get/put in og folder in cache directory of gtranslate and as their is no language abbreviation of "og" it's showing error. For a temporary fix I changed the urls of these pages. Would like to request that can gtranslate identify explicitly whether we are referring to available(if possible only enabled) language code and then determine to translate the page. As this can become a problem for modules having a menu item of two characters Thanks, Sadashiv.
Re: Language code conflicts with page urls
Oct 9, 2014 9:00 pm by Yana
Hi, "og" is being recognized as a language code and it tries to translate to it, however there is no language assigned to "og" code, so you see the errors. You will need to specify in your .htaccess file the list of languages you want to be enabled instead of all 2 letter characters. Here are the rules # gtranslate config RewriteRule ^([a-z]{2}|zh-CN|zh-TW)/([a-z]{2}|zh-CN|zh-TW)/(.*)$ /$1/$3 [R=301,L] RewriteRule ^([a-z]{2}|zh-CN|zh-TW)/([a-z]{2}|zh-CN|zh-TW)$ /$1/ [R=301,L] RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(en|af|ar|az|be|bg|ca|cs|cy|da|de|el|es|et|eu|fa|fi|fr|ga|gl|hi|hr|ht|hu|hy|id|is|it|iw|ja|ka|ko|lt|lv|mk|ms|mt|nl|no|pl|pt|ro|ru|sk|sl|sq|sr|sv|sw|th|tl|tr|uk|ur|vi|yi|zh-CN|zh-TW)/(.*)$ /gtranslate/translate.php?lang=$1&url=$2 [L,QSA] RewriteRule ^(en|af|ar|az|be|bg|ca|cs|cy|da|de|el|es|et|eu|fa|fi|fr|ga|gl|hi|hr|ht|hu|hy|id|is|it|iw|ja|ka|ko|lt|lv|mk|ms|mt|nl|no|pl|pt|ro|ru|sk|sl|sq|sr|sv|sw|th|tl|tr|uk|ur|vi|yi|zh-CN|zh-TW)$ /gtranslate/translate.php?lang=$1 [L,QSA]

SIMILAR TOPICS

GT doesn't work...error 404 pageJan 28, 2019 5:36 pmReplies: 1Post by: vincenzodinuzzo
Large numbers of crawl errors with double language codeJan 24, 2019 1:43 amReplies: 1Post by: natastna2
Translate website to any specific language, on page loadJan 19, 2019 6:49 amReplies: 1Post by: Leaon7756
Best way to translate a page in WordPress?Jan 7, 2019 11:10 amReplies: 3Post by: Tonnystark
Graphic translation for every language is missingDec 19, 2018 7:54 amReplies: 1Post by: Daryl Dixon

Try GTranslate with a free 15 day trial