Anniversary Sale · up to 80% off all librariesEnds Nov 9Shop now
SOFTTDocs

Language

Show the NetWizard captive portal in the visitor's language, or set a default language from your firmware.

The captive portal is translated into 12 languages. It shows the language of the visitor's browser when it is supported, and the visitor can switch languages with the language picker next to the close button. You can set the default language from your sketch with setLanguage().

NetWizard captive portal cycling through its 12 languages
NetWizard captive portal in Hindi with the language picker highlighted

Supported languages

CodeLanguage
enEnglish
esSpanish
frFrench
deGerman
ptPortuguese
itItalian
ruRussian
zhChinese (Simplified)
jaJapanese
koKorean
arArabic
hiHindi

In Arabic, the portal switches to a right-to-left layout. Network names, IP addresses and MAC addresses keep their left-to-right order.

Method

setLanguage()

void setLanguage(const char* code);
void setLanguage(String& code);

Prop

Type

Sets the language the portal opens in. Call it before autoConnect() or before the portal is started.

void setup() {
  // ...
  NW.setLanguage("hi");
  NW.autoConnect("NetWizard Demo", "");
  // ...
}

How the portal chooses a language

The portal uses the first of the following that applies:

  1. The language the visitor picked earlier. The choice is stored in the visitor's browser and kept across visits.
  2. The default language set with setLanguage().
  3. The language of the visitor's browser, when it is one of the supported languages. Regional variants such as pt-BR match their base language.
  4. English.

An unsupported code passed to setLanguage() is ignored, and the portal continues with the next rule.

Notes

  • Only the portal's own text is translated. Labels you define in your sketch, such as parameter names and placeholders, and, in NetWizard Pro, statistics, links and the custom title, are shown as you write them.
  • All translations are part of the portal, so changing the language does not require a network connection.

On this page