display warning msg+link when page is translated ?

Popular automatic website translation tool

display warning msg+link when page is translated ?

Postby fff » Sun Feb 08, 2015 1:35 am

Hi,
Your free version rocks !

I seriously consider the pro version, but I need a feature that, very suprisingly I can not find in the forum

How-to display a message on all translated page like "This page was machine translated ; in case of problem, please click HERE for original page"

I can write a small PHP script and insert that in a module, but for that I need 2 pieces of code from you
1-how to detect in php this is a translated page (in order to show the message only on these) ?
2-how to generate the link-path to the original page (=non translated page) ?

The above steps are very likely simple for you ; you probably have the #2 already for the link in the main flag ; please help
The code is likely to be different from free to pro version ; please for pro as I really consider this one.

???

Thanks,
Fabrice
fff
 
Posts: 10
Joined: Sun Feb 08, 2015 1:04 am

Re: display warning msg+link when page is translated ?

Postby Yana » Sun Feb 08, 2015 3:17 am

Dear Fabrice,

You can detect current selected language and display the message.
To detect current selected language:
for GTranslate Pro Joomla system plugin it is JSession::get('glang');
for the GTRanslate Pro General version it is $_GET['glang'] variable
Regards,

Yana Ghahramanyan - GTranslate Team

Please leave your feedback on your CMS plugin directory. It is very important for us!
Google Translate Joomla
Google Translate WordPress
Google Translate Drupal
Yana
 
Posts: 4135
Joined: Thu Jan 12, 2012 6:21 pm

Re: display warning msg+link when page is translated ?

Postby fff » Sun Feb 08, 2015 1:03 pm

thanks Yana, but what about the 2nd part of my question : code of path to original, non translated, page ?
thanks,
Fabrice
fff
 
Posts: 10
Joined: Sun Feb 08, 2015 1:04 am

Re: display warning msg+link when page is translated ?

Postby Yana » Mon Feb 09, 2015 12:48 pm

Dear Fabrice,

You should be able to get current URL using $_SERVER['REQUEST_URI']
Regards,

Yana Ghahramanyan - GTranslate Team

Please leave your feedback on your CMS plugin directory. It is very important for us!
Google Translate Joomla
Google Translate WordPress
Google Translate Drupal
Yana
 
Posts: 4135
Joined: Thu Jan 12, 2012 6:21 pm

Re: display warning msg+link when page is translated ?

Postby fff » Tue Feb 10, 2015 1:42 am

no, the question is not about current url, but about url to the original, non translated page

example: I am in the automatically translated armenian page, and I want to provide a link to the original English page

so ?
fff
 
Posts: 10
Joined: Sun Feb 08, 2015 1:04 am

Re: display warning msg+link when page is translated ?

Postby Yana » Tue Feb 10, 2015 5:22 pm

Hi,
You can get current URL using $_SERVER['REQUEST_URI'] and the current selected language code and remove the language code from this URL.
Regards,

Yana Ghahramanyan - GTranslate Team

Please leave your feedback on your CMS plugin directory. It is very important for us!
Google Translate Joomla
Google Translate WordPress
Google Translate Drupal
Yana
 
Posts: 4135
Joined: Thu Jan 12, 2012 6:21 pm


  • Related Topics
    Replies
    Views
    Last post

Who is online

Users browsing this forum: Yahoo [Bot] and 0 guests

2GLux