Koha Test Wiki MediaWiki Postgres

One of a series of test instances for migrating the Koha Wiki MediaWiki database.

For the current Koha Wiki, visit https://wiki.koha-community.org .

Switching languages for HTML system preferences

From Koha Test Wiki MediaWiki Postgres

Jump to: navigation, search
Home > Documentation
Home > Documentation
Tips & Tricks > Tips & Tricks/Customising Notices and Slips > Tips & Tricks > System Preferences

A number of Koha system preferences can take HTML content, like e.g. OpacMainUserBlock. But what can you do if you need your content in different languages? Here is a trick (the examples assume you want to be able to switch between German (de-DE) and English (en)):

Put this in your OpacUserJS system preference:

if ($('html').attr('lang')=='de-DE') {
  $(".de-DE").show();
  $(".en").hide();
} else {
  $(".de-DE").hide();
  $(".en").show();
}

Then you can put content like this in the system preferences that take HTML and where you want different languages to appear, based on the choice of the user:

<div class="en">
...
</div>
<div class = "de-DE">
...
</div>

(Based on an email from Katrin Fischer to the main Koha list.)

Personal tools