Jump to content

Featured Replies

Posted

Hi all,

I would like to add a link to Google translate in page footer.

To do so, I have to set

  • IN as the input page language (2 letters country code)
  • OUT as the output page language (2 letters country code)
  • URL as the URL of the page Google will translate

in the link bellow:

httрs://translate.google.com/translate?sl=IN&tl=OUT&u=URL

Using informations from this page, I tried to add this on line 3:

	{{if( isset( \IPS\Request::i()->url ) )}}
		<li><a href='https://translate.google.com/translate?sl=en&tl=ru&u={{ print \IPS\Request::i()->url(); }}'>русский</a></li>
	{{endif}}

But it doesn't work.

Can someone please help me?

Edited by Webmaster Scr

You don't need the if statement there, as it will almost never be set (it means it's looking for a "url" parameter in the current URL).

This should work:

<li><a href='https://translate.google.com/translate?sl=en&tl=ru&u={expression="request.url()"}'>русский</a></li>

 

Recently Browsing 0

  • No registered users viewing this page.