Forum Archive - How do I change the iframe url for each GTranslated site?

How do I change the iframe url for each GTranslated site?
Aug 22, 2016 10:35 am by ferryto.com
How do I change the iframe url for each GTranslated site? Our original site ferryto.com is copying the same iframe to all language sites - ok so far. So we need to keep the iframe on the .com site as it is. But have a different iframe string on each of the GTranslated language sites. Is that possible? Example: Original iframe for ferryto.com: http://www.aferry.co.uk/SearchFerries/? ... ode=SCFT03 Language iframe for Albania: http://www.aferry.co.uk/SearchFerries/? ... ode=SCFTAL Thanks in advance for any help.
Re: How do I change the iframe url for each GTranslated site
Aug 22, 2016 7:38 pm by Edvard
Hi, You can detect the current selected language and change the iframe src based on it. Here is the documentation: Detecting selected language If you want to code something special for individual language you can detect the current selected language and write your code based on that. You can find the current selected language code from X-GT-Lang request header. If your site is written in PHP you can find it in _SERVER['HTTP_X_GT_LANG'] variable.
Re: How do I change the iframe url for each GTranslated site
Aug 23, 2016 8:27 am by ferryto.com
Hi there, Good to know i can code something special for the individual language thanks. However the site is plain .html not written in php. Where can i find the X-GT-Lang request header on the translated site if i still should look for that? thanks again
Re: How do I change the iframe url for each GTranslated site
Aug 23, 2016 7:44 pm by Edvard
Hi, I do not think it is possible to access request headers with javascript. However if you have lang attribute for your html tag: <html lang="en"> it will be changed when the language changes, so for Spanish it will be: <html lang="es"> so you can detect the current language code from there and do the changes with javascript depending on it: jQuery('html').attr('lang') Thanks!

SIMILAR TOPICS

GTranslated Post Redirects To Google HomepageDec 31, 2018 12:36 pmReplies: 1Post by: theseoulofkorea
how to translate site right to left for arabic in WordPressDec 26, 2018 9:02 amReplies: 1Post by: Hammond753
Would you share your site URL?Dec 3, 2018 4:57 pmReplies: 1Post by: BevVincent
Change language automaticallyNov 26, 2018 9:29 pmReplies: 3Post by: Antilb
Change the color of the Language Switcher can i do that?Sep 18, 2018 1:58 pmReplies: 3Post by: rohitlopes

Try GTranslate with a free 15 day trial