Forum Archive - Invalid Token error after install JoomFish with GTranslate

Invalid Token error after install JoomFish with GTranslate
Nov 5, 2011 11:24 am by sky
My site was running GTranslate Pro with no problem before. today, I installed latest ver of Joomfish, then my jomsocial login module always show "Invalid token" error when trying to login. I have done a lot of testing to find out why, and finally found that this is caused by the Gtranslate code in the .htaccess below. when I remove them, everything is ok. why's that? what's wrong? I am running 3 languages: Traditional Chinese (default), Simplified Chinese (auto translated by Gtranslate pro), and English (manually translated with Joomfish) RewriteEngine On 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] RewriteRule ^([a-z]{2}|zh-CN|zh-TW)/(.*)$ /gtranslate/translate.php?lang=$1&url=$2 [L,QSA] RewriteRule ^([a-z]{2}|zh-CN|zh-TW)$ /gtranslate/translate.php?lang=$1 [L,QSA] RewriteCond %{HTTP_HOST} !^www\.mysite\.com [NC] RewriteCond %{HTTP_HOST} !^$ RewriteRule ^/(.*) http://www.mysite.com/$1 [L,R] ErrorDocument 404 /
Re: Invalid Token error after install JoomFish with GTransla
Nov 6, 2011 5:05 pm by Edvard
If you disable JoomFish plugins it works as expected or you still see the invalid token error?
Re: Invalid Token error after install JoomFish with GTransla
Nov 7, 2011 2:05 am by sky
my site will be down and I will get the below error if I disabled "System - Jfrouter" plugin. Internal Server Error The server encountered an internal error or misconfiguration and was unable to complete your request. Please contact the server administrator, [email protected] and inform them of the time the error occurred, and anything you might have done that may have caused the error. More information about this error may be available in the server error log. Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.
Re: Invalid Token error after install JoomFish with GTransla
Nov 7, 2011 9:42 am by Edvard
That is not normal. After you disable it the system should continue to work as expected. Can you try to use a different browser after disabling it? Or clear cookies for your domain name after you disable it.
Re: Invalid Token error after install JoomFish with GTransla
Nov 7, 2011 10:53 am by sky
Yes, confirm that disable "System - Jfrouter" plugin will cause the error. I just upgrade to latest ver of GTranslate pro, then the invalid token error no longer shows. However, after installing the latest ver, Joomfish language (English) no longer works. If I remove these lines from .htaccess, English will be working again: # 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] RewriteRule ^([a-z]{2}|zh-CN|zh-TW)/(.*)$ /gtranslate/translate.php?lang=$1&url=$2 [L,QSA] RewriteRule ^([a-z]{2}|zh-CN|zh-TW)$ /gtranslate/translate.php?lang=$1 [L,QSA] RewriteCond %{HTTP_HOST} !^www\.mysite\.com [NC] RewriteCond %{HTTP_HOST} !^$ RewriteRule ^/(.*) http://www.mysite/$1 [L,R] ErrorDocument 404 / Here is my joomfish plugin setting: http://screencast.com/t/T1bZSThqH8GS I see your mention the below in another post, but I don't know how exactly to do it. Can you give me example? If you want to use both in parallel you need to install GTranslate Pro for general websites which is included in the product package. Then in .htaccess file you need to add only those languages which should be handled by GTranslate. Your webmaster should be able to make appropriate changes in the .htaccess file.
Re: Invalid Token error after install JoomFish with GTransla
Nov 8, 2011 11:39 am by Edvard
The settings are OK, you will need to change cn to zh-CN. Then you need to use this rewrite rules instead: # 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_URI} !^/en RewriteCond %{REQUEST_URI} !^/zh-CN RewriteRule ^([a-z]{2}|zh-CN|zh-TW)/(.*)$ /gtranslate/translate.php?lang=$1&url=$2 [L,QSA] RewriteCond %{REQUEST_URI} !^/en RewriteCond %{REQUEST_URI} !^/zh-CN RewriteRule ^([a-z]{2}|zh-CN|zh-TW)$ /gtranslate/translate.php?lang=$1 [L,QSA]
Re: Invalid Token error after install JoomFish with GTransla
Nov 9, 2011 2:44 am by sky
My default language is: zh-TW, zh-CN is translated via GTranslate, and en is via joomfish. Should it be like this? # 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_URI} !^/en RewriteCond %{REQUEST_URI} !^/zh-TW RewriteRule ^([a-z]{2}|zh-CN|zh-TW)/(.*)$ /gtranslate/translate.php?lang=$1&url=$2 [L,QSA] RewriteCond %{REQUEST_URI} !^/en RewriteCond %{REQUEST_URI} !^/zh-TW RewriteRule ^([a-z]{2}|zh-CN|zh-TW)$ /gtranslate/translate.php?lang=$1 [L,QSA] Can you explain what the red lines mean? If I want to add one more joomfish translated language fr, I need to add one more line? RewriteCond %{REQUEST_URI} !^/fr on the other hand, some pages only partially translated by GTranslate pro, why is that?
Re: Invalid Token error after install JoomFish with GTransla
Nov 9, 2011 2:18 pm by Edvard
The red lines exclude the languages from being handled by GTranslate. Yes, it is correct, if you add that line you will exclude also French from GTranslate. If you see a partially translated page try to add ?force_translation=1 in the end of the URL and it will forcefully translate the full page. If you have a lot of partially translated pages. You can replace lang=$1 with lang=$1&force_translation=1 in the .htaccess rewrite rules.
Re: Invalid Token error after install JoomFish with GTransla
Nov 10, 2011 5:24 am by sky
ok, now all translations are working, except one issue: my default language is zh-TW, but I am not adding zh-TW in my default language sef url: www.mysite.com/page1/ but when I tried to switch language from any languages to the default language zh-TW by clicking the GTranslate flags, the default language url will have the zh-TW added, which will show page not found error: www.mysite.com/ zh-TW/page1/ How to set GTranslate not adding the zh-TW in url when switching languages?
Re: Invalid Token error after install JoomFish with GTransla
Nov 10, 2011 12:58 pm by Edvard
If you have set the default language in gtranslate/config.php file to zh-TW then you can remove this line: RewriteCond %{REQUEST_URI} !^/zh-TW which will fix the issue.

SIMILAR TOPICS

Gtranslate MultisiteFeb 12, 2019 7:27 amReplies: 1Post by: infact_dat
Gtranslate: Error with numberFeb 20, 2019 1:20 amReplies: 1Post by: infact_dat
GTranslate 3.7.4, Joomla 3.9.3 - doGTranslate is not definedFeb 22, 2019 12:34 pmReplies: 1Post by: oase
Error message and URL problemsFeb 6, 2019 11:16 amReplies: 1Post by: Kidbooo
Add-on gtranslate no longer worksFeb 2, 2019 6:01 amReplies: 1Post by: DarylDixon

Try GTranslate with a free 15 day trial