Hieromon / AutoConnect

An Arduino library for ESP8266/ESP32 WLAN configuration at runtime with the Web interface
https://hieromon.github.io/AutoConnect/
MIT License
889 stars 185 forks source link

Feature Request: Additional labels in AutoConnectLabels.h for translations #562

Closed faanskit closed 1 year ago

faanskit commented 1 year ago

Kindly ask to include three new labels, I.e.,

// Page AutoConnectConfigAux text: Prev.
#ifndef AUTOCONNECT_PAGECONFIG_PREVIOUS
#define AUTOCONNECT_PAGECONFIG_PREVIOUS "Prev."
#endif // !AUTOCONNECT_PAGECONFIG_PREVIOUS

// Page AutoConnectConfigAux text: Next
#ifndef AUTOCONNECT_PAGECONFIG_NEXT
#define AUTOCONNECT_PAGECONFIG_NEXT "Next"
#endif // !AUTOCONNECT_PAGECONFIG_NEXT

// Page AutoConnectConfigAux text: Next
#ifndef AUTOCONNECT_TEXTLABEL_RESET
#define AUTOCONNECT_TEXTLABEL_RESET " in progress..."
#endif // !AUTOCONNECT_TEXTLABEL_RESET

And have them used in the following places:

AutoConnectPageImpl.hpp line 1232/1237

  // Prepare perv. button
  if (page >= 1) {
    snprintf_P(slBuf, bufSize - (slBuf - ssidList), (PGM_P)_ssidPage, page - 1, PSTR("Prev."));
    slBuf = ssidList + strlen(ssidList);
  }
  // Prepare next button
  if (validCount > (page + 1) * AUTOCONNECT_SSIDPAGEUNIT_LINES) {
    snprintf_P(slBuf, bufSize - (slBuf - ssidList), (PGM_P)_ssidPage, page + 1, PSTR("Next"));
  }

==>

  // Prepare perv. button
  if (page >= 1) {
    snprintf_P(slBuf, bufSize - (slBuf - ssidList), (PGM_P)_ssidPage, page - 1, PSTR(AUTOCONNECT_PAGECONFIG_PREVIOUS));
    slBuf = ssidList + strlen(ssidList);
  }
  // Prepare next button
  if (validCount > (page + 1) * AUTOCONNECT_SSIDPAGEUNIT_LINES) {
    snprintf_P(slBuf, bufSize - (slBuf - ssidList), (PGM_P)_ssidPage, page + 1, PSTR(AUTOCONNECT_PAGECONFIG_NEXT));
  }

AutoConnectCoreImpl.hpp - Line 1208

template<typename T>
String AutoConnectCore<T>::_induceReset(PageArgument& args) {
  AC_UNUSED(args);
  _rfReset = true;
  return String(F(AUTOCONNECT_BUTTONLABEL_RESET " in progress..."));
}

==>

template<typename T>
String AutoConnectCore<T>::_induceReset(PageArgument& args) {
  AC_UNUSED(args);
  _rfReset = true;
  return String(F(AUTOCONNECT_BUTTONLABEL_RESET AUTOCONNECT_TEXTLABEL_RESET));
}
Hieromon commented 1 year ago

Please submit a PR with your change intentions.

P.S. Please post Feature requests to Discussions, as closing an Issue makes it difficult for other users to trace the history of what requests were made in the past. Discussions have been categorized for that. Thank you.