Google translate

About the template and stylesheet - and changing the menu
cmb
Posts: 14225
Joined: Tue Jun 21, 2011 11:04 am
Location: Bingen, RLP, DE
Contact:

Re: Google translate

Post by cmb » Sun Aug 26, 2018 8:47 pm

frase wrote:
Sun Aug 26, 2018 5:37 pm

Code: Select all

<a href="https://translate.google.com/translate?u=<?=$sn.'?'.$su;?>" target="_blank">Google translate</a>
@Christoph
Ist das eine korrekte Möglichkeit, die vollständige Seiten-Adresse an Google zu übergeben?
Oder geht das smarter?
Wichtig ist vor allem, dass auch die Domain übergeben wird ($sn enthält nur den Pfad). Und im Zweifel sollte man den kompletten Query-String übergeben (falls z.B. ein Plugin bestimmte Parameter verwendet). Also vielleicht:

Code: Select all

<a href="https://translate.google.com/translate?u=<?=CMSIMPLE_URL.'?'.$_SERVER['QUERY_STRING'];?>" target="_blank">Google translate</a>
PS: vermutlich sollte das noch urlencode()'d werden.
Christoph M. Becker – Plugins for CMSimple_XH

roze
Posts: 270
Joined: Tue Jun 03, 2008 7:13 am
Location: NL
Contact:

Re: Google translate

Post by roze » Sun Aug 26, 2018 10:04 pm

This works so far.

Code: Select all

<a href="https://translate.google.com/translate?u=http://www.beremooiehymers.nl/?Start">Google translate</a>
I’ll look to the other suggestions after my holliday.
Rob Zeijen,

Valkenswaard (NL)

Post Reply