Language code conflicts with page urls

Popular automatic website translation tool

Language code conflicts with page urls

Postby sadashiv » Thu Oct 09, 2014 7:28 pm


I have a site made in drupal and I am using organic groups module of drupal so mostly the urls were 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

Posts: 75
Joined: Thu Oct 09, 2014 2:02 pm

Re: Language code conflicts with page urls

Postby Yana » Fri Oct 10, 2014 1:00 am

"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]

Yana Ghahramanyan - GTranslate Team

Please leave your feedback on your CMS plugin directory. It is very important for us!
Google Translate Joomla
Google Translate WordPress
Google Translate Drupal
Posts: 4547
Joined: Thu Jan 12, 2012 6:21 pm

  • Related Topics
    Last post

Who is online

Users browsing this forum: No registered users and 0 guests