How to append class depending on selected language

Hey there, i’m setting up a multi-language blog with some extra features. One of them is a Footnotes-Container, that creates a list of all footnotes from the article-content. Since this container is created using jquery, it’s quite hard to pass a language-sensitive heading to this, because PHP inside a jquery code won’t work properly.

So here is my question:
Is it possible to pass a decent CSS-class to the html or body, so i can detect them and passing the right content to this headings? I think the answer will be quite easy, but i’m not really getting into it…

Thanks for any help.

Tobi

Why don’t you use a data attribute that passes either the language or the heading to your script?

<div class="footnotes-container" data-heading="<?php echo l::get('footnotes-heading') ?>"></div>

See using language variables.

If you want to add the language as a class, you can do it like this:

<body class="<?php echo $site->language()->code() ?>"></body>

Thanks for the fast reply. Excuse my late answer. I finally used a version where i give the body the language-class and then get the right variable depending on this class. So this worked for me for this time.

Greets Tobi