Compare commits

...
Sign in to create a new pull request.

1 commit

Author SHA1 Message Date
PCoder
b33392defa ungleich cms template: add/change language menu item 2019-03-09 08:48:13 +01:00

View file

@ -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>