diff --git a/mkdocs.yml b/mkdocs.yml index ef38e70..878efc5 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -40,6 +40,7 @@ nav: - 'Saved credentials access': credit.md - 'File upload handler': acupload.md - 'Custom colorized': colorized.md + - 'Change label text': changelabel.md - 'FAQ' : faq.md - 'Change log' : changelog.md - 'License' : license.md diff --git a/mkdocs/changelabel.md b/mkdocs/changelabel.md new file mode 100644 index 0000000..dc36074 --- /dev/null +++ b/mkdocs/changelabel.md @@ -0,0 +1,120 @@ +## Change the item's label text + +You can change the text of AutoConnect menu items. The easiest way is to rewrite the header file directly in the library that defines the menu label. [Advanced Usage](advancedusage.md#change-the-menu-labels) section describes the detailed how to change the label text directly. + +However, this way is less preferred as it modifies the library code and further affects the entire Arduino project you compile. So, here's how to change the label text for each Arduino project without directly modifying the library code. Using this method, you can also display the label text and fixed text on AutoConnect pages in your national language. + +(e.g. in Japanese) + + +### Preparation + +AutoConnect needs a definition file as c++ header (.h) to change the label text. It is used when your Arduino project is compiled, and there is no additional memory consumption due to changing the label text. This header file describes each fixed text of AutoConnect with the `#define` preprocessor directive. + +The next thing you need is [PlatformIO](https://platformio.org/). [PlatformIO](https://docs.platformio.org/en/latest/what-is-platformio.html#overview) is a very powerful environment for embedded development with multi-platform and multi-architecture build systems. And you can easily set up a PlatformIO for the Arduino development system as follows on your host machine. + +- [Microsoft Visual Studio Code](https://platformio.org/install/ide?install=vscode) +- [PlatformIO IDE](https://platformio.org/platformio-ide) (included PlatformIO core) + +!!! info "Install PlatformIO and VSCode" + Please refer to [the official documentation](https://docs.platformio.org/en/latest/ide/vscode.html#installation) for PlatformIO and VSCode installation. + +The rest of this section assumes that you have a PlatformIO environment with VSCode as the front end that has installed on your host machine. + +## How to change the label text + +### Label text replacement header file + +AutoConnect label texts are pre-assigned with a fixed string so that it can be determined at compile time. Their default definitions are in the [`AutoConnectLabels.h`](https://github.com/Hieromon/AutoConnect/blob/master/src/AutoConnectLabels.h) file that has all the replaceable label text defined by the `#define` directive. + +
Label placed | Pre-defined text | ID (#define macro) |
---|---|---|
Menu item | Configure new AP | AUTOCONNECT_MENULABEL_CONFIGNEW |
Open SSIDs | AUTOCONNECT_MENULABEL_OPENSSIDS | |
Disconnect | AUTOCONNECT_MENULABEL_DISCONNECT | |
Reset... | AUTOCONNECT_MENULABEL_RESET | |
HOME | AUTOCONNECT_MENULABEL_HOME | |
Update | AUTOCONNECT_MENULABEL_UPDATE | |
Button label | RESET | AUTOCONNECT_BUTTONLABEL_RESET |
Page title | Page not found | AUTOCONNECT_PAGETITLE_NOTFOUND |
AutoConnect config | AUTOCONNECT_PAGETITLE_CONFIG | |
AutoConnect connecting | AUTOCONNECT_PAGETITLE_CONNECTING | |
AutoConnect connection failed | AUTOCONNECT_PAGETITLE_CONNECTIONFAILED | |
AutoConnect credentials | AUTOCONNECT_PAGETITLE_CREDENTIALS | |
AutoConnect disconnected | AUTOCONNECT_PAGETITLE_DISCONNECTED | |
AutoConnect resetting | AUTOCONNECT_PAGETITLE_RESETTING | |
AutoConnect statistics | AUTOCONNECT_PAGETITLE_STATISTICS | |
Page:[statistics] row | Established connection | AUTOCONNECT_PAGESTATS_ESTABLISHEDCONNECTION |
Mode | AUTOCONNECT_PAGESTATS_MODE | |
IP | AUTOCONNECT_PAGESTATS_IP | |
GW | AUTOCONNECT_PAGESTATS_GATEWAY | |
Subnet mask | AUTOCONNECT_PAGESTATS_SUBNETMASK | |
SoftAP IP | AUTOCONNECT_PAGESTATS_SOFTAPIP | |
AP MAC | AUTOCONNECT_PAGESTATS_APMAC | |
STA MAC | AUTOCONNECT_PAGESTATS_STAMAC | |
Channel | AUTOCONNECT_PAGESTATS_CHANNEL | |
dBm | AUTOCONNECT_PAGESTATS_DBM | |
Chip ID | AUTOCONNECT_PAGESTATS_CHIPID | |
CPU Freq. | AUTOCONNECT_PAGESTATS_CPUFREQ | |
Flash size | AUTOCONNECT_PAGESTATS_FLASHSIZE | |
Free memory | AUTOCONNECT_PAGESTATS_FREEMEM | |
Page:[config] text | Total: | AUTOCONNECT_PAGECONFIG_TOTAL |
Hidden: | AUTOCONNECT_PAGECONFIG_HIDDEN | |
SSID | AUTOCONNECT_PAGECONFIG_SSID | |
Passphrase | AUTOCONNECT_PAGECONFIG_PASSPHRASE | |
Enable DHCP | AUTOCONNECT_PAGECONFIG_ENABLEDHCP | |
Apply | AUTOCONNECT_PAGECONFIG_APPLY | |
Page:[connection failed] | Connection Failed | AUTOCONNECT_PAGECONNECTIONFAILED_CONNECTIONFAILED |
Text | No saved credentials. | AUTOCONNECT_TEXT_NOSAVEDCREDENTIALS |
Menu Text | Connecting | AUTOCONNECT_MENUTEXT_CONNECTING |
Disconnect | AUTOCONNECT_MENUTEXT_DISCONNECT | |
Failed | AUTOCONNECT_MENUTEXT_FAILED |