Osclass forums

Support forums => General help => Topic started by: moinuddin on August 14, 2019, 06:33:41 pm

Title: Translation of website in different language using osclass language pack
Post by: moinuddin on August 14, 2019, 06:33:41 pm
Hi all,

I have installed the languages on my website ..but the problem is that it does not translate whole page (i was expecting something like google translator service that translates whole page)...

Any idea how to do that ..?...

Title: Re: Translation of website in different language using osclass language pack
Post by: WEBmods on August 14, 2019, 06:45:43 pm
Hello!

The language pack doesn't translate the following:


Regards.
Title: Re: Translation of website in different language using osclass language pack
Post by: moinuddin on August 14, 2019, 06:58:53 pm
Is it possible that it can call google translator to translate if a language is selected ?

For example if user selects Chinese language once then every time he opens the website in the browser it will open in Chinese as a language detected by his browser ..

Is this possible with some piece of codes ?..
 
Title: Re: Translation of website in different language using osclass language pack
Post by: WEBmods on August 14, 2019, 11:55:08 pm
Hmm, maybe something like this in functions.php:

Code: [Select]
function wm_language_js() {
    // Your Google translate code here. You can access the selected language with Params::getParam('locale');
}

function wm_language_changed() {
    if(Params::getParam('page') == 'language') {
        osc_add_hook('footer', 'wm_language_js');
    }
}
osc_add_hook('init', 'wm_language_changed');

Regards.
Title: Re: Translation of website in different language using osclass language pack
Post by: moinuddin on August 15, 2019, 08:57:59 am
Thanks webmods,

Will try it and will let you know