ungleich cms template: add/change language menu item
This commit is contained in:
parent
46c3bb1ce4
commit
b33392defa
1 changed files with 13 additions and 0 deletions
|
@ -59,6 +59,19 @@
|
|||
if ($(".has-error").length != 0) {
|
||||
window.location = window.location.pathname + "#contact"
|
||||
}
|
||||
// set the correct page language for the language menu option
|
||||
// Assumption that we have a #page_lang `a` element in the menu
|
||||
var href = $(location).attr('href');
|
||||
var page_lang = $("#page_lang");
|
||||
if($(location).attr('href').indexOf('/en-us/') > 0) {
|
||||
href = href.replace("/en-us/", "/de/");
|
||||
page_lang.attr('href', href);
|
||||
page_lang.text('Deutsch');
|
||||
} else {
|
||||
href = href.replace("/de/", "/en-us/");
|
||||
page_lang.attr('href', href);
|
||||
page_lang.text('Englisch');
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
|
|
Loading…
Reference in a new issue