Forum Archive - PHP Includes & Joomla w/ GTranslate Pro

PHP Includes & Joomla w/ GTranslate Pro
Aug 26, 2011 10:54 am by technicaldaniel
I am currently running GTranslate on my Joomla 1.5 installation, but I also have a PHP/JS/HTML module which allows me to put PHP, etc. on my pages which is essential for my sight. I use this functionality to call external PHP files on my domain which contains the website data. This works really well however when I try and use GTranslate Pro (Redirect), none of the PHP parts translate. However when I use the 'Google Default' method, it translates perfectly. Is there a way I can make it work with the Redirect method? Any help would be much appreciated. :)
Re: PHP Includes & Joomla w/ GTranslate Pro
Aug 26, 2011 6:44 pm by Edvard
Do you use javascript to call the external data? When you check the source code of your site, do you see the included content?
Re: PHP Includes & Joomla w/ GTranslate Pro
Aug 26, 2011 11:22 pm by technicaldaniel
Yes the site does have some JavaScript load() functions in it.
Re: PHP Includes & Joomla w/ GTranslate Pro
Aug 29, 2011 11:53 am by Edvard
The Pro version doesn't translate the content loaded by javascript, because it makes the translation before any javascript is fired. However you can modify your javascript to add language code in the load URL and it will load the translated data. In this case the data need to be called from the same server where the Pro version is installed.
Re: PHP Includes & Joomla w/ GTranslate Pro
Aug 29, 2011 12:16 pm by technicaldaniel
Well the loaded code from JavaScript is on the same server, but just in a separate directory. Could you possibly give me an example on how to do that because I have no idea how to add language code in a load() call. Thanks for the help regardless.
Re: PHP Includes & Joomla w/ GTranslate Pro
Aug 30, 2011 11:16 am by Edvard
Well it depends on your code. I can just give you a hint. If you load data let's say from http://domain.com/my_data_path.php you need to change the javascript to load it from http://domain.com/XX/my_data_path.php where XX is the current language.
Re: PHP Includes & Joomla w/ GTranslate Pro
Aug 30, 2011 11:23 am by technicaldaniel
Okay I can see how that would work, however how do I set it to be set to the the language the user selected? Is there a php variable I can use?
Re: PHP Includes & Joomla w/ GTranslate Pro
Aug 30, 2011 11:46 am by Edvard
Here you can find how to do that: gtranslate/url-language-code-t320.html#:~:text=glang

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
Add-on gtranslate no longer worksFeb 2, 2019 6:01 amReplies: 1Post by: DarylDixon
Instragram and Gtranslate...!!!!Dec 19, 2018 11:18 amReplies: 1Post by: zackfernandes

Try GTranslate with a free 15 day trial