Add support for localization of strings.

Added new file with localized strings in Czech language.
Also it is possible to easily add other languages as well.
See docs in AutoConnectLabels.h for details.
pull/178/head
David Maixner 4 years ago
parent c70275d5f4
commit 9b1c38df93
  1. 175
      src/AutoConnectLabels.h
  2. 260
      src/AutoConnectLabels_cz.h
  3. 84
      src/AutoConnectPage.cpp
  4. 6
      src/AutoConnectPage.h

@ -14,6 +14,16 @@
* The upper row of each of the following definition items is the
* default value. The lower row is an alternative label string as
* a sample and can be changed you wish.
*
* To define new language, just create new AutoConnectLabels_lang.h
* file with your translation and then you can use it, by adding
* directive to building process.
* E.g. for PlatformIO you can add to your environment in
* platformio.ini this build_flag:
* ```
* build_flags =
* '-D_AUTOCONNECTLABELSLANG_="AutoConnectLabels_cz.h"'
* ```
*
* Notes:
* You can find some tokens for the PageBuilder if you parse
@ -67,6 +77,171 @@
//#define AUTOCONNECT_BUTTONLABEL_RESET "Reboot"
#endif // !AUTOCONNECT_BUTTONLABEL_RESET
// Page title: Page not found
#ifndef AUTOCONNECT_PAGETITLE_NOTFOUND
#define AUTOCONNECT_PAGETITLE_NOTFOUND "Page not found"
#endif // !AUTOCONNECT_PAGETITLE_NOTFOUND
// Page title: AutoConnect resetting
#ifndef AUTOCONNECT_PAGETITLE_RESETTING
#define AUTOCONNECT_PAGETITLE_RESETTING "AutoConnect resetting"
#endif // !AUTOCONNECT_PAGETITLE_RESETTING
// Page title: AutoConnect statistics
#ifndef AUTOCONNECT_PAGETITLE_STATISTICS
#define AUTOCONNECT_PAGETITLE_STATISTICS "AutoConnect statistics"
#endif // !AUTOCONNECT_PAGETITLE_STATISTICS
// Page statistics row: Established connection
#ifndef AUTOCONNECT_PAGESTATS_ESTABLISHEDCONNECTION
#define AUTOCONNECT_PAGESTATS_ESTABLISHEDCONNECTION "Established connection"
#endif // !AUTOCONNECT_PAGESTATS_ESTABLISHEDCONNECTION
// Page statistics row: Mode
#ifndef AUTOCONNECT_PAGESTATS_MODE
#define AUTOCONNECT_PAGESTATS_MODE "Mode"
#endif // !AUTOCONNECT_PAGESTATS_MODE
// Page statistics row: IP
#ifndef AUTOCONNECT_PAGESTATS_IP
#define AUTOCONNECT_PAGESTATS_IP "IP"
#endif // !AUTOCONNECT_PAGESTATS_IP
// Page statistics row: GW
#ifndef AUTOCONNECT_PAGESTATS_GATEWAY
#define AUTOCONNECT_PAGESTATS_GATEWAY "GW"
#endif // !AUTOCONNECT_PAGESTATS_GATEWAY
// Page statistics row: Subnet mask
#ifndef AUTOCONNECT_PAGESTATS_SUBNETMASK
#define AUTOCONNECT_PAGESTATS_SUBNETMASK "Subnet mask"
#endif // !AUTOCONNECT_PAGESTATS_SUBNETMASK
// Page statistics row: SoftAP IP
#ifndef AUTOCONNECT_PAGESTATS_SOFTAPIP
#define AUTOCONNECT_PAGESTATS_SOFTAPIP "SoftAP IP"
#endif // !AUTOCONNECT_PAGESTATS_SOFTAPIP
// Page statistics row: AP MAC
#ifndef AUTOCONNECT_PAGESTATS_APMAC
#define AUTOCONNECT_PAGESTATS_APMAC "AP MAC"
#endif // !AUTOCONNECT_PAGESTATS_APMAC
// Page statistics row: STA MAC
#ifndef AUTOCONNECT_PAGESTATS_STAMAC
#define AUTOCONNECT_PAGESTATS_STAMAC "STA MAC"
#endif // !AUTOCONNECT_PAGESTATS_STAMAC
// Page statistics row: Channel
#ifndef AUTOCONNECT_PAGESTATS_CHANNEL
#define AUTOCONNECT_PAGESTATS_CHANNEL "Channel"
#endif // !AUTOCONNECT_PAGESTATS_CHANNEL
// Page statistics row: dBm
#ifndef AUTOCONNECT_PAGESTATS_DBM
#define AUTOCONNECT_PAGESTATS_DBM "dBm"
#endif // !AUTOCONNECT_PAGESTATS_DBM
// Page statistics row: Chip ID
#ifndef AUTOCONNECT_PAGESTATS_CHIPID
#define AUTOCONNECT_PAGESTATS_CHIPID "Chip ID"
#endif // !AUTOCONNECT_PAGESTATS_CHIPID
// Page statistics row: CPU Freq.
#ifndef AUTOCONNECT_PAGESTATS_CPUFREQ
#define AUTOCONNECT_PAGESTATS_CPUFREQ "CPU Freq."
#endif // !AUTOCONNECT_PAGESTATS_CPUFREQ
// Page statistics row: Flash size
#ifndef AUTOCONNECT_PAGESTATS_FLASHSIZE
#define AUTOCONNECT_PAGESTATS_FLASHSIZE "Flash size"
#endif // !AUTOCONNECT_PAGESTATS_FLASHSIZE
// Page statistics row: Free memory
#ifndef AUTOCONNECT_PAGESTATS_FREEMEM
#define AUTOCONNECT_PAGESTATS_FREEMEM "Free memory"
#endif // !AUTOCONNECT_PAGESTATS_FREEMEM
// Page title: AutoConnect config
#ifndef AUTOCONNECT_PAGETITLE_CONFIG
#define AUTOCONNECT_PAGETITLE_CONFIG "AutoConnect config"
#endif // !AUTOCONNECT_PAGETITLE_CONFIG
// Page config text: Total:
#ifndef AUTOCONNECT_PAGECONFIG_TOTAL
#define AUTOCONNECT_PAGECONFIG_TOTAL "Total:"
#endif // !AUTOCONNECT_PAGECONFIG_TOTAL
// Page config text: Hidden:
#ifndef AUTOCONNECT_PAGECONFIG_HIDDEN
#define AUTOCONNECT_PAGECONFIG_HIDDEN "Hidden:"
#endif // !AUTOCONNECT_PAGECONFIG_HIDDEN
// Page config text: SSID
#ifndef AUTOCONNECT_PAGECONFIG_SSID
#define AUTOCONNECT_PAGECONFIG_SSID "SSID"
#endif // !AUTOCONNECT_PAGECONFIG_SSID
// Page config text: Passphrase
#ifndef AUTOCONNECT_PAGECONFIG_PASSPHRASE
#define AUTOCONNECT_PAGECONFIG_PASSPHRASE "Passphrase"
#endif // !AUTOCONNECT_PAGECONFIG_PASSPHRASE
// Page config text: Enable DHCP
#ifndef AUTOCONNECT_PAGECONFIG_ENABLEDHCP
#define AUTOCONNECT_PAGECONFIG_ENABLEDHCP "Enable DHCP"
#endif // !AUTOCONNECT_PAGECONFIG_ENABLEDHCP
// Page config text: Apply
#ifndef AUTOCONNECT_PAGECONFIG_APPLY
#define AUTOCONNECT_PAGECONFIG_APPLY "Apply"
#endif // !AUTOCONNECT_PAGECONFIG_APPLY
// Page title: AutoConnect credentials
#ifndef AUTOCONNECT_PAGETITLE_CREDENTIALS
#define AUTOCONNECT_PAGETITLE_CREDENTIALS "AutoConnect credentials"
#endif // !AUTOCONNECT_PAGETITLE_CREDENTIALS
// Page title: AutoConnect connecting
#ifndef AUTOCONNECT_PAGETITLE_CONNECTING
#define AUTOCONNECT_PAGETITLE_CONNECTING "AutoConnect connecting"
#endif // !AUTOCONNECT_PAGETITLE_CONNECTING
// Page title: AutoConnect connection failed
#ifndef AUTOCONNECT_PAGETITLE_CONNECTIONFAILED
#define AUTOCONNECT_PAGETITLE_CONNECTIONFAILED "AutoConnect connection failed"
#endif // !AUTOCONNECT_PAGETITLE_CONNECTIONFAILED
// Page connection failed: Connection Failed
#ifndef AUTOCONNECT_PAGECONNECTIONFAILED_CONNECTIONFAILED
#define AUTOCONNECT_PAGECONNECTIONFAILED_CONNECTIONFAILED "Connection Failed"
#endif // !AUTOCONNECT_PAGECONNECTIONFAILED_CONNECTIONFAILED
// Page title: AutoConnect disconnected
#ifndef AUTOCONNECT_PAGETITLE_DISCONNECTED
#define AUTOCONNECT_PAGETITLE_DISCONNECTED "AutoConnect disconnected"
#endif // !AUTOCONNECT_PAGETITLE_DISCONNECTED
// Text: No saved credentials.
#ifndef AUTOCONNECT_TEXT_NOSAVEDCREDENTIALS
#define AUTOCONNECT_TEXT_NOSAVEDCREDENTIALS "No saved credentials."
#endif // !AUTOCONNECT_TEXT_NOSAVEDCREDENTIALS
// Menu Text: Connecting
#ifndef AUTOCONNECT_MENUTEXT_CONNECTING
#define AUTOCONNECT_MENUTEXT_CONNECTING "Connecting"
#endif // !AUTOCONNECT_MENUTEXT_CONNECTING
// Menu Text: Disconnect
#ifndef AUTOCONNECT_MENUTEXT_DISCONNECT
#define AUTOCONNECT_MENUTEXT_DISCONNECT "Disconnect"
#endif // !AUTOCONNECT_MENUTEXT_DISCONNECT
// Menu Text: Failed
#ifndef AUTOCONNECT_MENUTEXT_FAILED
#define AUTOCONNECT_MENUTEXT_FAILED "Failed"
#endif // !AUTOCONNECT_MENUTEXT_FAILED
// Menu colors
// The following three color code items determine the color scheme of
// the menu. In addition to hexadecimal color values, you can specify

@ -0,0 +1,260 @@
/**
* AutoConnect proper menu label constant definition.
* Czech language.
* @file AutoConnectLabels_cz.h
* @author dmaixner@gmail.com
* @version 1.0.0
* @date 2020-02-01
* @copyright MIT license.
*/
#ifndef _AUTOCONNECTLABELS_H_
#define _AUTOCONNECTLABELS_H_
/**
* This file serves as and alternative translation of
* AutoConnectLabels.h.
* To use it, you should add directive to building process.
* E.g. for PlatformIO you can add to your environment in
* platformio.ini this build_flag:
* ```
* build_flags =
* '-D_AUTOCONNECTLABELSLANG_="AutoConnectLabels_cz.h"'
* ```
*
* Notes:
* You can find some tokens for the PageBuilder if you parse
* AutoConnectPage.cpp. Some of the tokens are valid at the time
* the AutoConnect menu will generate. For example, the token
* `{{CUR_SSID}}` returns the SSID of the currently participating
* AP by AutoConnect::_token_CURRENT_SSID function.
* You can use these tokens to display dynamic menus showing the
* current situation, but you need to know the internal structure
* of AutoConnect in order to display the appropriate menu.
*/
// Menu item: Configure new AP
#ifndef AUTOCONNECT_MENULABEL_CONFIGNEW
#define AUTOCONNECT_MENULABEL_CONFIGNEW "Nastavení nové WiFi"
#endif // !AUTOCONNECT_MENULABEL_CONFIGNEW
// Menu item: Open SSIDs
#ifndef AUTOCONNECT_MENULABEL_OPENSSIDS
#define AUTOCONNECT_MENULABEL_OPENSSIDS "Uložené WiFi"
#endif // !AUTOCONNECT_MENULABEL_OPENSSIDS
// Menu item: Disconnect
#ifndef AUTOCONNECT_MENULABEL_DISCONNECT
#define AUTOCONNECT_MENULABEL_DISCONNECT "Odpojit"
#endif // !AUTOCONNECT_MENULABEL_DISCONNECT
// Menu item: Reset...
#ifndef AUTOCONNECT_MENULABEL_RESET
#define AUTOCONNECT_MENULABEL_RESET "Restart zařízení"
#endif // !AUTOCONNECT_MENULABEL_RESET
// Menu item: HOME
#ifndef AUTOCONNECT_MENULABEL_HOME
#define AUTOCONNECT_MENULABEL_HOME "Informace o zařízení"
#endif // !AUTOCONNECT_MENULABEL_HOME
// Menu item: Update
#ifndef AUTOCONNECT_MENULABEL_UPDATE
#define AUTOCONNECT_MENULABEL_UPDATE "Přehrát firmware"
#endif // !AUTOCONNECT_MENULABEL_UPDATE
// Button label: RESET
#ifndef AUTOCONNECT_BUTTONLABEL_RESET
#define AUTOCONNECT_BUTTONLABEL_RESET "Reset"
#endif // !AUTOCONNECT_BUTTONLABEL_RESET
// Page title: Page not found
#ifndef AUTOCONNECT_PAGETITLE_NOTFOUND
#define AUTOCONNECT_PAGETITLE_NOTFOUND "Stránka nenalezena"
#endif // !AUTOCONNECT_PAGETITLE_NOTFOUND
// Page title: AutoConnect resetting
#ifndef AUTOCONNECT_PAGETITLE_RESETTING
#define AUTOCONNECT_PAGETITLE_RESETTING "Restartuji"
#endif // !AUTOCONNECT_PAGETITLE_RESETTING
// Page title: AutoConnect statistics
#ifndef AUTOCONNECT_PAGETITLE_STATISTICS
#define AUTOCONNECT_PAGETITLE_STATISTICS "Statistika"
#endif // !AUTOCONNECT_PAGETITLE_STATISTICS
// Page statistics row: Established connection
#ifndef AUTOCONNECT_PAGESTATS_ESTABLISHEDCONNECTION
#define AUTOCONNECT_PAGESTATS_ESTABLISHEDCONNECTION "Navázané spojení"
#endif // !AUTOCONNECT_PAGESTATS_ESTABLISHEDCONNECTION
// Page statistics row: Mode
#ifndef AUTOCONNECT_PAGESTATS_MODE
#define AUTOCONNECT_PAGESTATS_MODE "Mód"
#endif // !AUTOCONNECT_PAGESTATS_MODE
// Page statistics row: IP
#ifndef AUTOCONNECT_PAGESTATS_IP
#define AUTOCONNECT_PAGESTATS_IP "IP adresa"
#endif // !AUTOCONNECT_PAGESTATS_IP
// Page statistics row: GW
#ifndef AUTOCONNECT_PAGESTATS_GATEWAY
#define AUTOCONNECT_PAGESTATS_GATEWAY "Brána"
#endif // !AUTOCONNECT_PAGESTATS_GATEWAY
// Page statistics row: Subnet mask
#ifndef AUTOCONNECT_PAGESTATS_SUBNETMASK
#define AUTOCONNECT_PAGESTATS_SUBNETMASK "Maska podsítě"
#endif // !AUTOCONNECT_PAGESTATS_SUBNETMASK
// Page statistics row: SoftAP IP
#ifndef AUTOCONNECT_PAGESTATS_SOFTAPIP
#define AUTOCONNECT_PAGESTATS_SOFTAPIP "AP IP adresa"
#endif // !AUTOCONNECT_PAGESTATS_SOFTAPIP
// Page statistics row: AP MAC
#ifndef AUTOCONNECT_PAGESTATS_APMAC
#define AUTOCONNECT_PAGESTATS_APMAC "AP MAC"
#endif // !AUTOCONNECT_PAGESTATS_APMAC
// Page statistics row: STA MAC
#ifndef AUTOCONNECT_PAGESTATS_STAMAC
#define AUTOCONNECT_PAGESTATS_STAMAC "STA MAC"
#endif // !AUTOCONNECT_PAGESTATS_STAMAC
// Page statistics row: Channel
#ifndef AUTOCONNECT_PAGESTATS_CHANNEL
#define AUTOCONNECT_PAGESTATS_CHANNEL "Kanál"
#endif // !AUTOCONNECT_PAGESTATS_CHANNEL
// Page statistics row: dBm
#ifndef AUTOCONNECT_PAGESTATS_DBM
#define AUTOCONNECT_PAGESTATS_DBM "dBm"
#endif // !AUTOCONNECT_PAGESTATS_DBM
// Page statistics row: Chip ID
#ifndef AUTOCONNECT_PAGESTATS_CHIPID
#define AUTOCONNECT_PAGESTATS_CHIPID "ID čipu"
#endif // !AUTOCONNECT_PAGESTATS_CHIPID
// Page statistics row: CPU Freq.
#ifndef AUTOCONNECT_PAGESTATS_CPUFREQ
#define AUTOCONNECT_PAGESTATS_CPUFREQ "Frekvence CPU"
#endif // !AUTOCONNECT_PAGESTATS_CPUFREQ
// Page statistics row: Flash size
#ifndef AUTOCONNECT_PAGESTATS_FLASHSIZE
#define AUTOCONNECT_PAGESTATS_FLASHSIZE "Velikost paměti"
#endif // !AUTOCONNECT_PAGESTATS_FLASHSIZE
// Page statistics row: Free memory
#ifndef AUTOCONNECT_PAGESTATS_FREEMEM
#define AUTOCONNECT_PAGESTATS_FREEMEM "Volné paměti"
#endif // !AUTOCONNECT_PAGESTATS_FREEMEM
// Page title: AutoConnect config
#ifndef AUTOCONNECT_PAGETITLE_CONFIG
#define AUTOCONNECT_PAGETITLE_CONFIG "Konfigurace"
#endif // !AUTOCONNECT_PAGETITLE_CONFIG
// Page config text: Total:
#ifndef AUTOCONNECT_PAGECONFIG_TOTAL
#define AUTOCONNECT_PAGECONFIG_TOTAL "Celkem: "
#endif // !AUTOCONNECT_PAGECONFIG_TOTAL
// Page config text: Hidden:
#ifndef AUTOCONNECT_PAGECONFIG_HIDDEN
#define AUTOCONNECT_PAGECONFIG_HIDDEN "Skryté: "
#endif // !AUTOCONNECT_PAGECONFIG_HIDDEN
// Page config text: SSID
#ifndef AUTOCONNECT_PAGECONFIG_SSID
#define AUTOCONNECT_PAGECONFIG_SSID "SSID"
#endif // !AUTOCONNECT_PAGECONFIG_SSID
// Page config text: Passphrase
#ifndef AUTOCONNECT_PAGECONFIG_PASSPHRASE
#define AUTOCONNECT_PAGECONFIG_PASSPHRASE "Heslo"
#endif // !AUTOCONNECT_PAGECONFIG_PASSPHRASE
// Page config text: Enable DHCP
#ifndef AUTOCONNECT_PAGECONFIG_ENABLEDHCP
#define AUTOCONNECT_PAGECONFIG_ENABLEDHCP "Zapnout DHCP"
#endif // !AUTOCONNECT_PAGECONFIG_ENABLEDHCP
// Page config text: Apply
#ifndef AUTOCONNECT_PAGECONFIG_APPLY
#define AUTOCONNECT_PAGECONFIG_APPLY "Uložit"
#endif // !AUTOCONNECT_PAGECONFIG_APPLY
// Page title: AutoConnect credentials
#ifndef AUTOCONNECT_PAGETITLE_CREDENTIALS
#define AUTOCONNECT_PAGETITLE_CREDENTIALS "Pověření"
#endif // !AUTOCONNECT_PAGETITLE_CREDENTIALS
// Page title: AutoConnect connecting
#ifndef AUTOCONNECT_PAGETITLE_CONNECTING
#define AUTOCONNECT_PAGETITLE_CONNECTING "Připojuji"
#endif // !AUTOCONNECT_PAGETITLE_CONNECTING
// Page title: AutoConnect connection failed
#ifndef AUTOCONNECT_PAGETITLE_CONNECTIONFAILED
#define AUTOCONNECT_PAGETITLE_CONNECTIONFAILED "Připojení selhalo"
#endif // !AUTOCONNECT_PAGETITLE_CONNECTIONFAILED
// Page connection failed: Connection Failed
#ifndef AUTOCONNECT_PAGECONNECTIONFAILED_CONNECTIONFAILED
#define AUTOCONNECT_PAGECONNECTIONFAILED_CONNECTIONFAILED "Připojení selhalo"
#endif // !AUTOCONNECT_PAGECONNECTIONFAILED_CONNECTIONFAILED
// Page title: AutoConnect disconnected
#ifndef AUTOCONNECT_PAGETITLE_DISCONNECTED
#define AUTOCONNECT_PAGETITLE_DISCONNECTED "Odpojeno"
#endif // !AUTOCONNECT_PAGETITLE_DISCONNECTED
// Text: No saved credentials.
#ifndef AUTOCONNECT_TEXT_NOSAVEDCREDENTIALS
#define AUTOCONNECT_TEXT_NOSAVEDCREDENTIALS "Žádné uložené WiFi sítě."
#endif // !AUTOCONNECT_TEXT_NOSAVEDCREDENTIALS
// Menu Text: Connecting
#ifndef AUTOCONNECT_MENUTEXT_CONNECTING
#define AUTOCONNECT_MENUTEXT_CONNECTING "Připojuji"
#endif // !AUTOCONNECT_MENUTEXT_CONNECTING
// Menu Text: Disconnect
#ifndef AUTOCONNECT_MENUTEXT_DISCONNECT
#define AUTOCONNECT_MENUTEXT_DISCONNECT "Odpojit"
#endif // !AUTOCONNECT_MENUTEXT_DISCONNECT
// Menu Text: Failed
#ifndef AUTOCONNECT_MENUTEXT_FAILED
#define AUTOCONNECT_MENUTEXT_FAILED "Připojení selhalo"
#endif // !AUTOCONNECT_MENUTEXT_FAILED
// Menu colors
// The following three color code items determine the color scheme of
// the menu. In addition to hexadecimal color values, you can specify
// 140 standard color names that apply to CSS.
// To be no sense of discomfort, select the same series of values for
// the background and the active item.
// Menu text foreground color
#ifndef AUTOCONNECT_MENUCOLOR_TEXT
#define AUTOCONNECT_MENUCOLOR_TEXT "#fff"
//#define AUTOCONNECT_MENUCOLOR_TEXT "#fffacd"
#endif // !AUTOCONNECT_MENUCOLOR_TEXT
// Menu background color
#ifndef AUTOCONNECT_MENUCOLOR_BACKGROUND
#define AUTOCONNECT_MENUCOLOR_BACKGROUND "#263238"
// #define AUTOCONNECT_MENUCOLOR_BACKGROUND "#696969"
#endif // !AUTOCONNECT_MENUCOLOR_BACKGROUND
// Background color with active menu items and mouse hover
#ifndef AUTOCONNECT_MENUCOLOR_ACTIVE
#define AUTOCONNECT_MENUCOLOR_ACTIVE "#37474f"
// #define AUTOCONNECT_MENUCOLOR_ACTIVE "#808080"
#endif
#endif

@ -550,7 +550,7 @@ const char AutoConnect::_ELM_MENU_POST[] PROGMEM = {
/**< The 404 page content. */
const char AutoConnect::_PAGE_404[] PROGMEM = {
"{{HEAD}}"
"<title>Page not found</title>"
"<title>" AUTOCONNECT_PAGETITLE_NOTFOUND "</title>"
"</head>"
"<body>"
"404 Not found"
@ -562,7 +562,7 @@ const char AutoConnect::_PAGE_404[] PROGMEM = {
const char AutoConnect::_PAGE_RESETTING[] PROGMEM = {
"{{HEAD}}"
"<meta http-equiv=\"refresh\" content=\"{{UPTIME}};url={{BOOTURI}}\">"
"<title>AutoConnect resetting</title>"
"<title>" AUTOCONNECT_PAGETITLE_RESETTING "</title>"
"</head>"
"<body>"
"<h2>{{RESET}}</h2>"
@ -573,7 +573,7 @@ const char AutoConnect::_PAGE_RESETTING[] PROGMEM = {
/**< AutoConnect portal page. */
const char AutoConnect::_PAGE_STAT[] PROGMEM = {
"{{HEAD}}"
"<title>AutoConnect statistics</title>"
"<title>" AUTOCONNECT_PAGETITLE_STATISTICS "</title>"
"<style type=\"text/css\">"
"{{CSS_BASE}}"
"{{CSS_TABLE}}"
@ -589,59 +589,59 @@ const char AutoConnect::_PAGE_STAT[] PROGMEM = {
"<table class=\"info\" style=\"border:none;\">"
"<tbody>"
"<tr>"
"<td>Established connection</td>"
"<td>" AUTOCONNECT_PAGESTATS_ESTABLISHEDCONNECTION "</td>"
"<td>{{ESTAB_SSID}}</td>"
"</tr>"
"<tr>"
"<td>Mode</td>"
"<td>" AUTOCONNECT_PAGESTATS_MODE "</td>"
"<td>{{WIFI_MODE}}({{WIFI_STATUS}})</td>"
"</tr>"
"<tr>"
"<td>IP</td>"
"<td>" AUTOCONNECT_PAGESTATS_IP "</td>"
"<td>{{LOCAL_IP}}</td>"
"</tr>"
"<tr>"
"<td>GW</td>"
"<td>" AUTOCONNECT_PAGESTATS_GATEWAY "</td>"
"<td>{{GATEWAY}}</td>"
"</tr>"
"<tr>"
"<td>Subnet mask</td>"
"<td>" AUTOCONNECT_PAGESTATS_SUBNETMASK "</td>"
"<td>{{NETMASK}}</td>"
"</tr>"
"<tr>"
"<td>SoftAP IP</td>"
"<td>" AUTOCONNECT_PAGESTATS_SOFTAPIP "</td>"
"<td>{{SOFTAP_IP}}</td>"
"</tr>"
"<tr>"
"<td>AP MAC</td>"
"<td>" AUTOCONNECT_PAGESTATS_APMAC "</td>"
"<td>{{AP_MAC}}</td>"
"</tr>"
"<tr>"
"<td>STA MAC</td>"
"<td>" AUTOCONNECT_PAGESTATS_STAMAC "</td>"
"<td>{{STA_MAC}}</td>"
"</tr>"
"<tr>"
"<td>Channel</td>"
"<td>" AUTOCONNECT_PAGESTATS_CHANNEL "</td>"
"<td>{{CHANNEL}}</td>"
"</tr>"
"<tr>"
"<td>dBm</td>"
"<td>" AUTOCONNECT_PAGESTATS_DBM "</td>"
"<td>{{DBM}}</td>"
"</tr>"
"<tr>"
"<td>Chip ID</td>"
"<td>" AUTOCONNECT_PAGESTATS_CHIPID "</td>"
"<td>{{CHIP_ID}}</td>"
"</tr>"
"<tr>"
"<td>CPU Freq.</td>"
"<td>" AUTOCONNECT_PAGESTATS_CPUFREQ "</td>"
"<td>{{CPU_FREQ}}MHz</td>"
"</tr>"
"<tr>"
"<td>Flash size</td>"
"<td>" AUTOCONNECT_PAGESTATS_FLASHSIZE "</td>"
"<td>{{FLASH_SIZE}}</td>"
"</tr>"
"<tr>"
"<td>Free memory</td>"
"<td>" AUTOCONNECT_PAGESTATS_FREEMEM "</td>"
"<td>{{FREE_HEAP}}</td>"
"</tr>"
"</tbody>"
@ -655,7 +655,7 @@ const char AutoConnect::_PAGE_STAT[] PROGMEM = {
/**< A page that specifies the new configuration. */
const char AutoConnect::_PAGE_CONFIGNEW[] PROGMEM = {
"{{HEAD}}"
"<title>AutoConnect config</title>"
"<title>" AUTOCONNECT_PAGETITLE_CONFIG "</title>"
"<style type=\"text/css\">"
"{{CSS_BASE}}"
"{{CSS_ICON_LOCK}}"
@ -674,22 +674,22 @@ const char AutoConnect::_PAGE_CONFIGNEW[] PROGMEM = {
"<form action=\"" AUTOCONNECT_URI_CONNECT "\" method=\"post\">"
"<button style=\"width:0;height:0;padding:0;border:0;margin:0\" aria-hidden=\"true\" tabindex=\"-1\" type=\"submit\" name=\"apply\" value=\"apply\"></button>"
"{{LIST_SSID}}"
"<div style=\"margin:16px 0 8px 0;border-bottom:solid 1px #263238;\">Total:{{SSID_COUNT}} Hidden:{{HIDDEN_COUNT}}</div>"
"<div style=\"margin:16px 0 8px 0;border-bottom:solid 1px #263238;\">" AUTOCONNECT_PAGECONFIG_TOTAL "{{SSID_COUNT}} " AUTOCONNECT_PAGECONFIG_HIDDEN "{{HIDDEN_COUNT}}</div>"
"<ul class=\"noorder\">"
"<li>"
"<label for=\"ssid\">SSID</label>"
"<input id=\"ssid\" type=\"text\" name=\"" AUTOCONNECT_PARAMID_SSID "\" placeholder=\"SSID\">"
"<label for=\"ssid\">" AUTOCONNECT_PAGECONFIG_SSID "</label>"
"<input id=\"ssid\" type=\"text\" name=\"" AUTOCONNECT_PARAMID_SSID "\" placeholder=\"" AUTOCONNECT_PAGECONFIG_SSID "\">"
"</li>"
"<li>"
"<label for=\"passphrase\">Passphrase</label>"
"<input id=\"passphrase\" type=\"password\" name=\"" AUTOCONNECT_PARAMID_PASS "\" placeholder=\"Passphrase\">"
"<label for=\"passphrase\">" AUTOCONNECT_PAGECONFIG_PASSPHRASE "</label>"
"<input id=\"passphrase\" type=\"password\" name=\"" AUTOCONNECT_PARAMID_PASS "\" placeholder=\"" AUTOCONNECT_PAGECONFIG_PASSPHRASE "\">"
"</li>"
"<li>"
"<label for=\"dhcp\">Enable DHCP</label>"
"<label for=\"dhcp\">" AUTOCONNECT_PAGECONFIG_ENABLEDHCP "</label>"
"<input id=\"dhcp\" type=\"checkbox\" name=\"dhcp\" value=\"en\" checked onclick=\"vsw(this.checked);\">"
"</li>"
"{{CONFIG_IP}}"
"<li><input type=\"submit\" name=\"apply\" value=\"Apply\"></li>"
"<li><input type=\"submit\" name=\"apply\" value=\"" AUTOCONNECT_PAGECONFIG_APPLY "\"></li>"
"</ul>"
"</form>"
"</div>"
@ -713,7 +713,7 @@ const char AutoConnect::_PAGE_CONFIGNEW[] PROGMEM = {
/**< A page that reads stored authentication information and starts connection. */
const char AutoConnect::_PAGE_OPENCREDT[] PROGMEM = {
"{{HEAD}}"
"<title>AutoConnect credentials</title>"
"<title>" AUTOCONNECT_PAGETITLE_CREDENTIALS "</title>"
"<style type=\"text/css\">"
"{{CSS_BASE}}"
"{{CSS_ICON_LOCK}}"
@ -740,7 +740,7 @@ const char AutoConnect::_PAGE_OPENCREDT[] PROGMEM = {
const char AutoConnect::_PAGE_CONNECTING[] PROGMEM = {
"{{REQ}}"
"{{HEAD}}"
"<title>AutoConnect connecting</title>"
"<title>" AUTOCONNECT_PAGETITLE_CONNECTING "</title>"
"<style type=\"text/css\">"
"{{CSS_BASE}}"
"{{CSS_SPINNER}}"
@ -768,7 +768,7 @@ const char AutoConnect::_PAGE_CONNECTING[] PROGMEM = {
/**< A page announcing that a connection has been established. */
const char AutoConnect::_PAGE_SUCCESS[] PROGMEM = {
"{{HEAD}}"
"<title>AutoConnect statistics</title>"
"<title>" AUTOCONNECT_PAGETITLE_STATISTICS "</title>"
"<style type=\"text/css\">"
"{{CSS_BASE}}"
"{{CSS_TABLE}}"
@ -784,30 +784,30 @@ const char AutoConnect::_PAGE_SUCCESS[] PROGMEM = {
"<table class=\"info\" style=\"border:none;\">"
"<tbody>"
"<tr>"
"<td>Established connection</td>"
"<td>" AUTOCONNECT_PAGESTATS_ESTABLISHEDCONNECTION "</td>"
"<td>{{ESTAB_SSID}}</td>"
"</tr>"
"<tr>"
"<td>Mode</td>"
"<td>" AUTOCONNECT_PAGESTATS_MODE "</td>"
"<td>{{WIFI_MODE}}({{WIFI_STATUS}})</td>"
"</tr>"
"<tr>"
"<td>IP</td>"
"<td>" AUTOCONNECT_PAGESTATS_IP "</td>"
"<td>{{LOCAL_IP}}</td>"
"</tr>"
"<td>GW</td>"
"<td>" AUTOCONNECT_PAGESTATS_GATEWAY "</td>"
"<td>{{GATEWAY}}</td>"
"</tr>"
"<tr>"
"<td>Subnet mask</td>"
"<td>" AUTOCONNECT_PAGESTATS_SUBNETMASK "</td>"
"<td>{{NETMASK}}</td>"
"</tr>"
"<tr>"
"<td>Channel</td>"
"<td>" AUTOCONNECT_PAGESTATS_CHANNEL "</td>"
"<td>{{CHANNEL}}</td>"
"</tr>"
"<tr>"
"<td>dBm</td>"
"<td>" AUTOCONNECT_PAGESTATS_DBM "</td>"
"<td>{{DBM}}</td>"
"</tr>"
"</tbody>"
@ -821,7 +821,7 @@ const char AutoConnect::_PAGE_SUCCESS[] PROGMEM = {
/**< A response page for connection failed. */
const char AutoConnect::_PAGE_FAIL[] PROGMEM = {
"{{HEAD}}"
"<title>AutoConnect statistics</title>"
"<title>" AUTOCONNECT_PAGETITLE_CONNECTIONFAILED "</title>"
"<style type=\"text/css\">"
"{{CSS_BASE}}"
"{{CSS_TABLE}}"
@ -837,7 +837,7 @@ const char AutoConnect::_PAGE_FAIL[] PROGMEM = {
"<table class=\"info\" style=\"border:none;\">"
"<tbody>"
"<tr>"
"<td>Connection Failed</td>"
"<td>" AUTOCONNECT_PAGECONNECTIONFAILED_CONNECTIONFAILED "</td>"
"<td>{{STATION_STATUS}}</td>"
"</tr>"
"</tbody>"
@ -852,7 +852,7 @@ const char AutoConnect::_PAGE_FAIL[] PROGMEM = {
const char AutoConnect::_PAGE_DISCONN[] PROGMEM = {
"{{DISCONNECT}}"
"{{HEAD}}"
"<title>AutoConnect disconnected</title>"
"<title>" AUTOCONNECT_PAGETITLE_DISCONNECTED "</title>"
"<style type=\"text/css\">"
"{{CSS_BASE}}"
"{{CSS_LUXBAR}}"
@ -1281,7 +1281,7 @@ String AutoConnect::_token_OPEN_SSID(PageArgument& args) {
_scanCount = WiFi.scanNetworks(false, true);
}
else
ssidList = String(F("<p><b>No saved credentials.</b></p>"));
ssidList = String(F("<p><b>" AUTOCONNECT_TEXT_NOSAVEDCREDENTIALS "</b></p>"));
for (uint8_t i = 0; i < creEntries; i++) {
rssiCont[0] = '\0';
@ -1394,7 +1394,7 @@ PageElement* AutoConnect::_setupPage(String uri) {
else if (uri == String(AUTOCONNECT_URI_CONNECT)) {
// Setup /auto/connect
_menuTitle = FPSTR("Connecting");
_menuTitle = FPSTR(AUTOCONNECT_MENUTEXT_CONNECTING);
elm->setMold(_PAGE_CONNECTING);
elm->addToken(String(FPSTR("REQ")), std::bind(&AutoConnect::_induceConnect, this, std::placeholders::_1));
elm->addToken(String(FPSTR("HEAD")), std::bind(&AutoConnect::_token_HEAD, this, std::placeholders::_1));
@ -1422,7 +1422,7 @@ PageElement* AutoConnect::_setupPage(String uri) {
else if (uri == String(AUTOCONNECT_URI_DISCON)) {
// Setup /auto/disc
_menuTitle = FPSTR("Disconnect");
_menuTitle = FPSTR(AUTOCONNECT_MENUTEXT_DISCONNECT);
elm->setMold(_PAGE_DISCONN);
elm->addToken(String(FPSTR("DISCONNECT")), std::bind(&AutoConnect::_induceDisconnect, this, std::placeholders::_1));
elm->addToken(String(FPSTR("HEAD")), std::bind(&AutoConnect::_token_HEAD, this, std::placeholders::_1));
@ -1469,7 +1469,7 @@ PageElement* AutoConnect::_setupPage(String uri) {
else if (uri == String(AUTOCONNECT_URI_FAIL)) {
// Setup /auto/fail
_menuTitle = FPSTR("Failed");
_menuTitle = FPSTR(AUTOCONNECT_MENUTEXT_FAILED);
elm->setMold(_PAGE_FAIL);
elm->addToken(String(FPSTR("HEAD")), std::bind(&AutoConnect::_token_HEAD, this, std::placeholders::_1));
elm->addToken(String(FPSTR("CSS_BASE")), std::bind(&AutoConnect::_token_CSS_BASE, this, std::placeholders::_1));

@ -10,7 +10,11 @@
#ifndef _AUTOCONNECTPAGE_H_
#define _AUTOCONNECTPAGE_H_
#include "AutoConnectLabels.h"
#ifndef _AUTOCONNECTLABELSLANG_
#include "AutoConnectLabels.h"
#else
#include _AUTOCONNECTLABELSLANG_
#endif
#define AUTOCONNECT_PARAMID_SSID "SSID"
#define AUTOCONNECT_PARAMID_PASS "Passphrase"

Loading…
Cancel
Save