GetSimple Support Forum

Full Version: i18N: Information at non-translated pages
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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
I moved this post to the plugins-sections and completed the title of the post
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.