GetSimple Support Forum
i18N: Information at non-translated pages - Printable Version

+- GetSimple Support Forum (http://get-simple.info/forums)
+-- Forum: GetSimple (http://get-simple.info/forums/forumdisplay.php?fid=3)
+--- Forum: Plugins (http://get-simple.info/forums/forumdisplay.php?fid=13)
+--- Thread: i18N: Information at non-translated pages (/showthread.php?tid=4520)



i18N: Information at non-translated pages - oldRemovedUser - 2013-03-22

Hello folks!

I would like to know if it's possible to add a link or something to a page, everytime when an other language of the page has been called but hasn't been translated yet.

Let's say I have the page "about" in German and someone is visiting the Greek version of it or so. How can I display a note in this case or a link to Google Translate?

I would like to show this information text at the top / bottom of the content which is in the default language I've set (in my case German).

Thank you in advance.


Cheers


RE: i18N: Information at non-translated pages - Connie - 2013-03-23

I moved this post to the plugins-sections and completed the title of the post


RE: i18N: Information at non-translated pages - oldRemovedUser - 2013-05-22

While messing around with the plugin i18n I've found a quick and dirty way to realize that by dropping this code at i18n_base.php

Code:
// custom related stuff...
function check_if_lang_exists()
{
$lang = $_GET['lang'];

if (!ctype_alpha($lang))
    return false;
    
if (!in_array($lang,return_i18n_available_languages(return_page_slug())))
    echo '<p style="padding:5px;text-align:center;border:2px solid orange;">Sorry, we could not find the requested language.</p>';
}

add_action('content-top','check_if_lang_exists');

I hope it's useful for other people too.