xvids Posted June 12, 2020 Share Posted June 12, 2020 Hi, How to Enable Multiple Languages in KVS theme with cookies and language selector Thanks Quote Link to comment Share on other sites More sharing options...
Tech Support Posted June 15, 2020 Share Posted June 15, 2020 We do not have this configurable in default theme at the moment. Please create support ticket for this. Quote Link to comment Share on other sites More sharing options...
xvids Posted February 19, 2021 Author Share Posted February 19, 2021 Hi, I have enabled languages in theme. its now render html: <div class="dropdown-content"> <ul> <li class="list_item" data-value=""> <a> <img data-icon="true" src="https://www.kvs-demo.com/static/images/flags/us.png" alt="GB" width="28" height="20"> <span>English</span> </a> </li> </ul> I don't want to expose URL parameter, when click on it. how I can do that via Jquery Please help! $('.dropdown-content li').click(function() { $.cookie(kt_lang, value, {path: '/'}); window.location.reload(); if (typeof(Storage) !== 'undefined') { sessionStorage.clear(); } }); Thanks. Quote Link to comment Share on other sites More sharing options...
Tech Support Posted February 20, 2021 Share Posted February 20, 2021 What is your Smarty template code to display list of languages? Quote Link to comment Share on other sites More sharing options...
xvids Posted February 21, 2021 Author Share Posted February 21, 2021 <div class="languages"> {{if $config.locale==''}} <img src="{{$config.statics_url}}/static/images/flags/us.png" alt="GB" width="28" height="20"> <span>English</span><div class="arowup"></div> {{/if}} {{if $config.locale=='zh'}} <img src="{{$config.statics_url}}/static/images/flags/zh.png" alt="ZH" width="28" height="20"> <span>中文</span><div class="arowup"></div> {{/if}} {{if $config.locale=='ru'}} <img src="{{$config.statics_url}}/static/images/flags/ru.png" alt="RU" width="27" height="20"> <span>Русский</span><div class="arowup"></div> {{/if}} {{if $config.locale=='tr'}} <img src="{{$config.statics_url}}/static/images/flags/tr.png" alt="TR" width="27" height="20"> <span>Türkçe</span><div class="arowup"></div> {{/if}} {{if $config.locale=='de'}} <img src="{{$config.statics_url}}/static/images/flags/de.png" alt="DE" width="27" height="20"> <span>Deutsch</span><div class="arowup"></div> {{/if}} {{if $config.locale=='ja'}} <img src="{{$config.statics_url}}/static/images/flags/ja.png" alt="DE" width="27" height="20"> <span>日本語</span><div class="arowup"></div> {{/if}} {{if $config.locale=='pt'}} <img src="{{$config.statics_url}}/static/images/flags/pt.png" alt="DE" width="27" height="20"> <span>Português</span><div class="arowup"></div> {{/if}} {{if $config.locale=='es'}} <img src="{{$config.statics_url}}/static/images/flags/es.png" alt="DE" width="27" height="20"> <span>Español</span><div class="arowup"></div> {{/if}} {{if $config.locale=='it'}} <img src="{{$config.statics_url}}/static/images/flags/it.png" alt="DE" width="27" height="20"> <span>Italiano</span><div class="arowup"></div> {{/if}} {{if $config.locale=='fr'}} <img src="{{$config.statics_url}}/static/images/flags/fr.png" alt="DE" width="27" height="20"> <span>Français</span><div class="arowup"></div> {{/if}} </div> <div class="dropdown-content"> <ul> <li class="list_item" data-value="" {{if $config.locale==''}}data-selected="true"{{/if}}> <a href="{{$page_canonical|default:$config.project_url}}?kt_lang=en"> <img data-icon="true" src="{{$config.statics_url}}/static/images/flags/us.png" alt="GB" width="28" height="20"> <span>English</span> </a> </li> <li class="list_item" data-value="de" {{if $config.locale=='de'}}data-selected="true"{{/if}}> <a href="{{$page_canonical|default:$config.project_url}}?kt_lang=de"> <img data-icon="true" src="{{$config.statics_url}}/static/images/flags/de.png" alt="DE" width="26" height="20"> <span>Deutsch</span> </a> </li> <li class="list_item" data-value="fr" {{if $config.locale=='fr'}}data-selected="true"{{/if}}> <a href="{{$page_canonical|default:$config.project_url}}?kt_lang=fr"> <img data-icon="true" src="{{$config.statics_url}}/static/images/flags/fr.png" alt="FR" width="26" height="20"> <span>Français</span> </a> </li> <li class="list_item" data-value="it" {{if $config.locale=='it'}}data-selected="true"{{/if}}> <a href="{{$page_canonical|default:$config.project_url}}?kt_lang=it"> <img data-icon="true" src="{{$config.statics_url}}/static/images/flags/it.png" alt="IT" width="27" height="20"> <span>Italiano</span> </a> </li> <li class="list_item" data-value="es" {{if $config.locale=='es'}}data-selected="true"{{/if}}> <a href="{{$page_canonical|default:$config.project_url}}?kt_lang=es"> <img data-icon="true" src="{{$config.statics_url}}/static/images/flags/es.png" alt="ES" width="26" height="20"> <span>Español</span> </a> </li> <li class="list_item" data-value="pt" {{if $config.locale=='pt'}}data-selected="true"{{/if}}> <a href="{{$page_canonical|default:$config.project_url}}?kt_lang=pt"> <img data-icon="true" src="{{$config.statics_url}}/static/images/flags/pt.png" alt="PT" width="26" height="20"> <span>Português</span> </a> </li> <li class="list_item" data-value="ru" {{if $config.locale=='ru'}}data-selected="true"{{/if}}> <a href="{{$page_canonical|default:$config.project_url}}?kt_lang=ru"> <img data-icon="true" src="{{$config.statics_url}}/static/images/flags/ru.png" alt="RU" width="27" height="20"> <span>Русский</span> </a> </li> <li class="list_item" data-value="tr" {{if $config.locale=='tr'}}data-selected="true"{{/if}}> <a href="{{$page_canonical|default:$config.project_url}}?kt_lang=tr"> <img data-icon="true" src="{{$config.statics_url}}/static/images/flags/tr.png" alt="TR" width="27" height="20"> <span>Türkçe</span> </a> </li> <li class="list_item" data-value="zh" {{if $config.locale=='zh'}}data-selected="true"{{/if}}> <a href="{{$page_canonical|default:$config.project_url}}?kt_lang=zh"> <img data-icon="true" src="{{$config.statics_url}}/static/images/flags/zh.png" alt="ZH" width="28" height="20"> <span>中文</span> </a> </li> <li class="list_item" data-value="ja" {{if $config.locale=='ja'}}data-selected="true"{{/if}}> <a href="{{$page_canonical|default:$config.project_url}}?kt_lang=ja"> <img data-icon="true" src="{{$config.statics_url}}/static/images/flags/ja.png" alt="JA" width="27" height="20"> <span>日本語</span> </a> </li> </ul> </div> Quote Link to comment Share on other sites More sharing options...
Tech Support Posted February 22, 2021 Share Posted February 22, 2021 Please try this code: $('.dropdown-content li').click(function() { $.cookie('kt_lang', $(this).attr('data-value'), {path: '/'}); window.location.reload(); if (typeof(Storage) !== 'undefined') { sessionStorage.clear(); } }); Quote Link to comment Share on other sites More sharing options...
Tanjiro Posted January 6, 2023 Share Posted January 6, 2023 On 2/21/2021 at 3:33 PM, xvids said: <div class="languages"> {{if $config.locale==''}} <img src="{{$config.statics_url}}/static/images/flags/us.png" alt="GB" width="28" height="20"> <span>English</span><div class="arowup"></div> {{/if}} {{if $config.locale=='zh'}} <img src="{{$config.statics_url}}/static/images/flags/zh.png" alt="ZH" width="28" height="20"> <span>中文</span><div class="arowup"></div> {{/if}} {{if $config.locale=='ru'}} <img src="{{$config.statics_url}}/static/images/flags/ru.png" alt="RU" width="27" height="20"> <span>Русский</span><div class="arowup"></div> {{/if}} {{if $config.locale=='tr'}} <img src="{{$config.statics_url}}/static/images/flags/tr.png" alt="TR" width="27" height="20"> <span>Türkçe</span><div class="arowup"></div> {{/if}} {{if $config.locale=='de'}} <img src="{{$config.statics_url}}/static/images/flags/de.png" alt="DE" width="27" height="20"> <span>Deutsch</span><div class="arowup"></div> {{/if}} {{if $config.locale=='ja'}} <img src="{{$config.statics_url}}/static/images/flags/ja.png" alt="DE" width="27" height="20"> <span>日本語</span><div class="arowup"></div> {{/if}} {{if $config.locale=='pt'}} <img src="{{$config.statics_url}}/static/images/flags/pt.png" alt="DE" width="27" height="20"> <span>Português</span><div class="arowup"></div> {{/if}} {{if $config.locale=='es'}} <img src="{{$config.statics_url}}/static/images/flags/es.png" alt="DE" width="27" height="20"> <span>Español</span><div class="arowup"></div> {{/if}} {{if $config.locale=='it'}} <img src="{{$config.statics_url}}/static/images/flags/it.png" alt="DE" width="27" height="20"> <span>Italiano</span><div class="arowup"></div> {{/if}} {{if $config.locale=='fr'}} <img src="{{$config.statics_url}}/static/images/flags/fr.png" alt="DE" width="27" height="20"> <span>Français</span><div class="arowup"></div> {{/if}} </div> <div class="dropdown-content"> <ul> <li class="list_item" data-value="" {{if $config.locale==''}}data-selected="true"{{/if}}> <a href="{{$page_canonical|default:$config.project_url}}?kt_lang=en"> <img data-icon="true" src="{{$config.statics_url}}/static/images/flags/us.png" alt="GB" width="28" height="20"> <span>English</span> </a> </li> <li class="list_item" data-value="de" {{if $config.locale=='de'}}data-selected="true"{{/if}}> <a href="{{$page_canonical|default:$config.project_url}}?kt_lang=de"> <img data-icon="true" src="{{$config.statics_url}}/static/images/flags/de.png" alt="DE" width="26" height="20"> <span>Deutsch</span> </a> </li> <li class="list_item" data-value="fr" {{if $config.locale=='fr'}}data-selected="true"{{/if}}> <a href="{{$page_canonical|default:$config.project_url}}?kt_lang=fr"> <img data-icon="true" src="{{$config.statics_url}}/static/images/flags/fr.png" alt="FR" width="26" height="20"> <span>Français</span> </a> </li> <li class="list_item" data-value="it" {{if $config.locale=='it'}}data-selected="true"{{/if}}> <a href="{{$page_canonical|default:$config.project_url}}?kt_lang=it"> <img data-icon="true" src="{{$config.statics_url}}/static/images/flags/it.png" alt="IT" width="27" height="20"> <span>Italiano</span> </a> </li> <li class="list_item" data-value="es" {{if $config.locale=='es'}}data-selected="true"{{/if}}> <a href="{{$page_canonical|default:$config.project_url}}?kt_lang=es"> <img data-icon="true" src="{{$config.statics_url}}/static/images/flags/es.png" alt="ES" width="26" height="20"> <span>Español</span> </a> </li> <li class="list_item" data-value="pt" {{if $config.locale=='pt'}}data-selected="true"{{/if}}> <a href="{{$page_canonical|default:$config.project_url}}?kt_lang=pt"> <img data-icon="true" src="{{$config.statics_url}}/static/images/flags/pt.png" alt="PT" width="26" height="20"> <span>Português</span> </a> </li> <li class="list_item" data-value="ru" {{if $config.locale=='ru'}}data-selected="true"{{/if}}> <a href="{{$page_canonical|default:$config.project_url}}?kt_lang=ru"> <img data-icon="true" src="{{$config.statics_url}}/static/images/flags/ru.png" alt="RU" width="27" height="20"> <span>Русский</span> </a> </li> <li class="list_item" data-value="tr" {{if $config.locale=='tr'}}data-selected="true"{{/if}}> <a href="{{$page_canonical|default:$config.project_url}}?kt_lang=tr"> <img data-icon="true" src="{{$config.statics_url}}/static/images/flags/tr.png" alt="TR" width="27" height="20"> <span>Türkçe</span> </a> </li> <li class="list_item" data-value="zh" {{if $config.locale=='zh'}}data-selected="true"{{/if}}> <a href="{{$page_canonical|default:$config.project_url}}?kt_lang=zh"> <img data-icon="true" src="{{$config.statics_url}}/static/images/flags/zh.png" alt="ZH" width="28" height="20"> <span>中文</span> </a> </li> <li class="list_item" data-value="ja" {{if $config.locale=='ja'}}data-selected="true"{{/if}}> <a href="{{$page_canonical|default:$config.project_url}}?kt_lang=ja"> <img data-icon="true" src="{{$config.statics_url}}/static/images/flags/ja.png" alt="JA" width="27" height="20"> <span>日本語</span> </a> </li> </ul> </div> Excuse me, where is this file path or you created by yourself ? On 2/22/2021 at 12:13 PM, Tech Support said: Please try this code: $('.dropdown-content li').click(function() { $.cookie('kt_lang', $(this).attr('data-value'), {path: '/'}); window.location.reload(); if (typeof(Storage) !== 'undefined') { sessionStorage.clear(); } }); Excuse me, where do you put this into ? Which file ? Quote Link to comment Share on other sites More sharing options...
Tech Support Posted January 7, 2023 Share Posted January 7, 2023 Please better contact KVS support, this information could be outdated. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.