Skip to main content
Skip to main content

How to add multi-language support to a captive portal?

In order to allow for dynamic multi-language support, you need two pieces of 1) HTML and 2) JavaScript code. The HTML code required is below and displays a select box for switching between languages.

Next, you need to define the JavaScript switchLanguage() function, add a new

<script>
tag just before the ending
</body>
.

You can also add automatic browser language detection using the following code snippet.

Don't forget that each

<p>
or
<h1>
tag with text in it needs an "id" attribute in order to replace the textContent of the tag using
document.getElementById()
.