diff --git a/platformio/include/_locale.h b/platformio/include/_locale.h index a300a3e98..6b2cf642d 100644 --- a/platformio/include/_locale.h +++ b/platformio/include/_locale.h @@ -89,9 +89,13 @@ extern const char *TXT_UNITS_PRES_MILLIBARS; extern const char *TXT_UNITS_PRES_ATMOSPHERES; extern const char *TXT_UNITS_PRES_GRAMSPERSQUARECENTIMETER; extern const char *TXT_UNITS_PRES_POUNDSPERSQUAREINCH; -// UNITS - VISIBILITY DISTANCE +// UNIT SYMBOLS - VISIBILITY DISTANCE extern const char *TXT_UNITS_DIST_KILOMETERS; extern const char *TXT_UNITS_DIST_MILES; +// UNIT SYMBOLS - PRECIPITATION +extern const char *TXT_UNITS_PRECIP_MILLIMETERS; +extern const char *TXT_UNITS_PRECIP_CENTIMETERS; +extern const char *TXT_UNITS_PRECIP_INCHES; // MISCELLANEOUS MESSAGES // Title Case diff --git a/platformio/src/locales/locale_de_DE.inc b/platformio/src/locales/locale_de_DE.inc index acafedfc4..935ae32db 100644 --- a/platformio/src/locales/locale_de_DE.inc +++ b/platformio/src/locales/locale_de_DE.inc @@ -125,9 +125,13 @@ const char *TXT_UNITS_PRES_MILLIBARS = "mbar"; const char *TXT_UNITS_PRES_ATMOSPHERES = "atm"; const char *TXT_UNITS_PRES_GRAMSPERSQUARECENTIMETER = "g/cm\262"; const char *TXT_UNITS_PRES_POUNDSPERSQUAREINCH = "lb/in\262"; -// UNITS - VISIBILITY DISTANCE +// UNITS SYMBOLS - VISIBILITY DISTANCE const char *TXT_UNITS_DIST_KILOMETERS = "km"; const char *TXT_UNITS_DIST_MILES = "mi"; +// UNITS SYMBOLS - PRECIPITATION +const char *TXT_UNITS_PRECIP_MILLIMETERS = "mm"; +const char *TXT_UNITS_PRECIP_CENTIMETERS = "cm"; +const char *TXT_UNITS_PRECIP_INCHES = "in"; // MISCELLANEOUS MESSAGES // Title Case diff --git a/platformio/src/locales/locale_en_GB.inc b/platformio/src/locales/locale_en_GB.inc index c0ab7671e..d62e25a9a 100644 --- a/platformio/src/locales/locale_en_GB.inc +++ b/platformio/src/locales/locale_en_GB.inc @@ -117,9 +117,13 @@ const char *TXT_UNITS_PRES_MILLIBARS = "mbar"; const char *TXT_UNITS_PRES_ATMOSPHERES = "atm"; const char *TXT_UNITS_PRES_GRAMSPERSQUARECENTIMETER = "g/cm\xB2"; const char *TXT_UNITS_PRES_POUNDSPERSQUAREINCH = "lb/in\xB2"; -// UNITS - VISIBILITY DISTANCE +// UNITS SYMBOLS - VISIBILITY DISTANCE const char *TXT_UNITS_DIST_KILOMETERS = "km"; const char *TXT_UNITS_DIST_MILES = "mi"; +// UNITS SYMBOLS - PRECIPITATION +const char *TXT_UNITS_PRECIP_MILLIMETERS = "mm"; +const char *TXT_UNITS_PRECIP_CENTIMETERS = "cm"; +const char *TXT_UNITS_PRECIP_INCHES = "in"; // MISCELLANEOUS MESSAGES // Title Case diff --git a/platformio/src/locales/locale_en_US.inc b/platformio/src/locales/locale_en_US.inc index aac23b6e2..b963880de 100644 --- a/platformio/src/locales/locale_en_US.inc +++ b/platformio/src/locales/locale_en_US.inc @@ -117,9 +117,13 @@ const char *TXT_UNITS_PRES_MILLIBARS = "mbar"; const char *TXT_UNITS_PRES_ATMOSPHERES = "atm"; const char *TXT_UNITS_PRES_GRAMSPERSQUARECENTIMETER = "g/cm\262"; const char *TXT_UNITS_PRES_POUNDSPERSQUAREINCH = "lb/in\262"; -// UNITS - VISIBILITY DISTANCE +// UNITS SYMBOLS - VISIBILITY DISTANCE const char *TXT_UNITS_DIST_KILOMETERS = "km"; const char *TXT_UNITS_DIST_MILES = "mi"; +// UNITS SYMBOLS - PRECIPITATION +const char *TXT_UNITS_PRECIP_MILLIMETERS = "mm"; +const char *TXT_UNITS_PRECIP_CENTIMETERS = "cm"; +const char *TXT_UNITS_PRECIP_INCHES = "in"; // MISCELLANEOUS MESSAGES // Title Case diff --git a/platformio/src/locales/locale_et_EE.inc b/platformio/src/locales/locale_et_EE.inc index 51765b8a2..789420b41 100644 --- a/platformio/src/locales/locale_et_EE.inc +++ b/platformio/src/locales/locale_et_EE.inc @@ -124,9 +124,13 @@ const char *TXT_UNITS_PRES_MILLIBARS = "mbar"; const char *TXT_UNITS_PRES_ATMOSPHERES = "atm"; const char *TXT_UNITS_PRES_GRAMSPERSQUARECENTIMETER = "g/cm\262"; const char *TXT_UNITS_PRES_POUNDSPERSQUAREINCH = "lb/in\262"; -// UNITS - VISIBILITY DISTANCE +// UNITS SYMBOLS - VISIBILITY DISTANCE const char *TXT_UNITS_DIST_KILOMETERS = "km"; const char *TXT_UNITS_DIST_MILES = "mi"; +// UNITS SYMBOLS - PRECIPITATION +const char *TXT_UNITS_PRECIP_MILLIMETERS = "mm"; +const char *TXT_UNITS_PRECIP_CENTIMETERS = "cm"; +const char *TXT_UNITS_PRECIP_INCHES = "in"; // MISCELLANEOUS MESSAGES // Title Case diff --git a/platformio/src/locales/locale_fi_FI.inc b/platformio/src/locales/locale_fi_FI.inc index 2c75d86bb..05264d208 100644 --- a/platformio/src/locales/locale_fi_FI.inc +++ b/platformio/src/locales/locale_fi_FI.inc @@ -125,9 +125,13 @@ const char *TXT_UNITS_PRES_MILLIBARS = "mbar"; const char *TXT_UNITS_PRES_ATMOSPHERES = "atm"; const char *TXT_UNITS_PRES_GRAMSPERSQUARECENTIMETER = "g/cm\262"; const char *TXT_UNITS_PRES_POUNDSPERSQUAREINCH = "lb/in\262"; -// UNITS - VISIBILITY DISTANCE +// UNITS SYMBOLS - VISIBILITY DISTANCE const char *TXT_UNITS_DIST_KILOMETERS = "km"; const char *TXT_UNITS_DIST_MILES = "mi"; +// UNITS SYMBOLS - PRECIPITATION +const char *TXT_UNITS_PRECIP_MILLIMETERS = "mm"; +const char *TXT_UNITS_PRECIP_CENTIMETERS = "cm"; +const char *TXT_UNITS_PRECIP_INCHES = "in"; // MISCELLANEOUS MESSAGES // Title Case diff --git a/platformio/src/locales/locale_fr_FR.inc b/platformio/src/locales/locale_fr_FR.inc index de02ce291..51823b445 100644 --- a/platformio/src/locales/locale_fr_FR.inc +++ b/platformio/src/locales/locale_fr_FR.inc @@ -125,9 +125,13 @@ const char *TXT_UNITS_PRES_MILLIBARS = "mbar"; const char *TXT_UNITS_PRES_ATMOSPHERES = "atm"; const char *TXT_UNITS_PRES_GRAMSPERSQUARECENTIMETER = "g/cm\262"; const char *TXT_UNITS_PRES_POUNDSPERSQUAREINCH = "lb/in\262"; -// UNITS - VISIBILITY DISTANCE +// UNITS SYMBOLS - VISIBILITY DISTANCE const char *TXT_UNITS_DIST_KILOMETERS = "km"; const char *TXT_UNITS_DIST_MILES = "mi"; +// UNITS SYMBOLS - PRECIPITATION +const char *TXT_UNITS_PRECIP_MILLIMETERS = "mm"; +const char *TXT_UNITS_PRECIP_CENTIMETERS = "cm"; +const char *TXT_UNITS_PRECIP_INCHES = "in"; // MISCELLANEOUS MESSAGES // Title Case diff --git a/platformio/src/locales/locale_it_IT.inc b/platformio/src/locales/locale_it_IT.inc index 644d97cb2..abce7307e 100644 --- a/platformio/src/locales/locale_it_IT.inc +++ b/platformio/src/locales/locale_it_IT.inc @@ -125,9 +125,13 @@ const char *TXT_UNITS_PRES_MILLIBARS = "mbar"; const char *TXT_UNITS_PRES_ATMOSPHERES = "atm"; const char *TXT_UNITS_PRES_GRAMSPERSQUARECENTIMETER = "g/cm\262"; const char *TXT_UNITS_PRES_POUNDSPERSQUAREINCH = "lb/in\262"; -// UNITS - VISIBILITY DISTANCE +// UNITS SYMBOLS - VISIBILITY DISTANCE const char *TXT_UNITS_DIST_KILOMETERS = "km"; const char *TXT_UNITS_DIST_MILES = "mi"; +// UNITS SYMBOLS - PRECIPITATION +const char *TXT_UNITS_PRECIP_MILLIMETERS = "mm"; +const char *TXT_UNITS_PRECIP_CENTIMETERS = "cm"; +const char *TXT_UNITS_PRECIP_INCHES = "in"; // MISCELLANEOUS MESSAGES // Title Case diff --git a/platformio/src/locales/locale_nl_BE.inc b/platformio/src/locales/locale_nl_BE.inc index a3c211422..9b372c4ea 100644 --- a/platformio/src/locales/locale_nl_BE.inc +++ b/platformio/src/locales/locale_nl_BE.inc @@ -124,9 +124,13 @@ const char *TXT_UNITS_PRES_MILLIBARS = "mbar"; const char *TXT_UNITS_PRES_ATMOSPHERES = "atm"; const char *TXT_UNITS_PRES_GRAMSPERSQUARECENTIMETER = "g/cm\262"; const char *TXT_UNITS_PRES_POUNDSPERSQUAREINCH = "lb/in\262"; -// UNITS - VISIBILITY DISTANCE +// UNITS SYMBOLS - VISIBILITY DISTANCE const char *TXT_UNITS_DIST_KILOMETERS = "km"; const char *TXT_UNITS_DIST_MILES = "mi"; +// UNITS SYMBOLS - PRECIPITATION +const char *TXT_UNITS_PRECIP_MILLIMETERS = "mm"; +const char *TXT_UNITS_PRECIP_CENTIMETERS = "cm"; +const char *TXT_UNITS_PRECIP_INCHES = "in"; // MISCELLANEOUS MESSAGES // Title Case diff --git a/platformio/src/locales/locale_pt_BR.inc b/platformio/src/locales/locale_pt_BR.inc index 01575536a..9d9307f72 100644 --- a/platformio/src/locales/locale_pt_BR.inc +++ b/platformio/src/locales/locale_pt_BR.inc @@ -125,9 +125,13 @@ const char *TXT_UNITS_PRES_MILLIBARS = "mbar"; const char *TXT_UNITS_PRES_ATMOSPHERES = "atm"; const char *TXT_UNITS_PRES_GRAMSPERSQUARECENTIMETER = "g/cm\xB2"; const char *TXT_UNITS_PRES_POUNDSPERSQUAREINCH = "lb/in\xB2"; -// UNITS - VISIBILITY DISTANCE +// UNITS SYMBOLS - VISIBILITY DISTANCE const char *TXT_UNITS_DIST_KILOMETERS = "km"; const char *TXT_UNITS_DIST_MILES = "mi"; +// UNITS SYMBOLS - PRECIPITATION +const char *TXT_UNITS_PRECIP_MILLIMETERS = "mm"; +const char *TXT_UNITS_PRECIP_CENTIMETERS = "cm"; +const char *TXT_UNITS_PRECIP_INCHES = "in"; // MISCELLANEOUS MESSAGES // Title Case diff --git a/platformio/src/renderer.cpp b/platformio/src/renderer.cpp index 4a68682fb..c7c5a290a 100644 --- a/platformio/src/renderer.cpp +++ b/platformio/src/renderer.cpp @@ -393,31 +393,31 @@ void drawCurrentConditions(const owm_current_t ¤t, #endif #ifdef UNITS_SPEED_METERSPERSECOND dataStr = String(static_cast(std::round(current.wind_speed))); - unitStr = TXT_UNITS_SPEED_METERSPERSECOND; + unitStr = String(" ") + TXT_UNITS_SPEED_METERSPERSECOND; #endif #ifdef UNITS_SPEED_FEETPERSECOND dataStr = String(static_cast(std::round( meterspersecond_to_feetpersecond(current.wind_speed) ))); - unitStr = TXT_UNITS_SPEED_FEETPERSECOND; + unitStr = String(" ") + TXT_UNITS_SPEED_FEETPERSECOND; #endif #ifdef UNITS_SPEED_KILOMETERSPERHOUR dataStr = String(static_cast(std::round( meterspersecond_to_kilometersperhour(current.wind_speed) ))); - unitStr = TXT_UNITS_SPEED_KILOMETERSPERHOUR; + unitStr = String(" ") + TXT_UNITS_SPEED_KILOMETERSPERHOUR; #endif #ifdef UNITS_SPEED_MILESPERHOUR dataStr = String(static_cast(std::round( meterspersecond_to_milesperhour(current.wind_speed) ))); - unitStr = TXT_UNITS_SPEED_MILESPERHOUR; + unitStr = String(" ") + TXT_UNITS_SPEED_MILESPERHOUR; #endif #ifdef UNITS_SPEED_KNOTS dataStr = String(static_cast(std::round( meterspersecond_to_knots(current.wind_speed) ))); - unitStr = TXT_UNITS_SPEED_KNOTS; + unitStr = String(" ") + TXT_UNITS_SPEED_KNOTS; #endif #ifdef UNITS_SPEED_BEAUFORT dataStr = String(meterspersecond_to_beaufort(current.wind_speed)); - unitStr = TXT_UNITS_SPEED_BEAUFORT; + unitStr = String(" ") + TXT_UNITS_SPEED_BEAUFORT; #endif #ifdef WIND_INDICATOR_ARROW @@ -563,46 +563,46 @@ void drawCurrentConditions(const owm_current_t ¤t, // pressure #ifdef UNITS_PRES_HECTOPASCALS dataStr = String(current.pressure); - unitStr = TXT_UNITS_PRES_HECTOPASCALS; + unitStr = String(" ") + TXT_UNITS_PRES_HECTOPASCALS; #endif #ifdef UNITS_PRES_PASCALS dataStr = String(static_cast(std::round( hectopascals_to_pascals(current.pressure) ))); - unitStr = TXT_UNITS_PRES_PASCALS; + unitStr = String(" ") + TXT_UNITS_PRES_PASCALS; #endif #ifdef UNITS_PRES_MILLIMETERSOFMERCURY dataStr = String(static_cast(std::round( hectopascals_to_millimetersofmercury(current.pressure) ))); - unitStr = TXT_UNITS_PRES_MILLIMETERSOFMERCURY; + unitStr = String(" ") + TXT_UNITS_PRES_MILLIMETERSOFMERCURY; #endif #ifdef UNITS_PRES_INCHESOFMERCURY dataStr = String(std::round(1e1f * hectopascals_to_inchesofmercury(current.pressure) ) / 1e1f, 1); - unitStr = TXT_UNITS_PRES_INCHESOFMERCURY; + unitStr = String(" ") + TXT_UNITS_PRES_INCHESOFMERCURY; #endif #ifdef UNITS_PRES_MILLIBARS dataStr = String(static_cast(std::round( hectopascals_to_millibars(current.pressure) ))); - unitStr = TXT_UNITS_PRES_MILLIBARS; + unitStr = String(" ") + TXT_UNITS_PRES_MILLIBARS; #endif #ifdef UNITS_PRES_ATMOSPHERES dataStr = String(std::round(1e3f * hectopascals_to_atmospheres(current.pressure) ) / 1e3f, 3); - unitStr = TXT_UNITS_PRES_ATMOSPHERES; + unitStr = String(" ") + TXT_UNITS_PRES_ATMOSPHERES; #endif #ifdef UNITS_PRES_GRAMSPERSQUARECENTIMETER dataStr = String(static_cast(std::round( hectopascals_to_gramspersquarecentimeter(current.pressure) ))); - unitStr = TXT_UNITS_PRES_GRAMSPERSQUARECENTIMETER; + unitStr = String(" ") + TXT_UNITS_PRES_GRAMSPERSQUARECENTIMETER; #endif #ifdef UNITS_PRES_POUNDSPERSQUAREINCH dataStr = String(std::round(1e2f * hectopascals_to_poundspersquareinch(current.pressure) ) / 1e2f, 2); - unitStr = TXT_UNITS_PRES_POUNDSPERSQUAREINCH; + unitStr = String(" ") + TXT_UNITS_PRES_POUNDSPERSQUAREINCH; #endif display.setFont(&FONT_12pt8b); drawString(170 + 48, 204 + 17 / 2 + (48 + 8) * 2 + 48 / 2, dataStr, LEFT); @@ -615,11 +615,11 @@ void drawCurrentConditions(const owm_current_t ¤t, display.setFont(&FONT_12pt8b); #ifdef UNITS_DIST_KILOMETERS float vis = meters_to_kilometers(current.visibility); - unitStr = TXT_UNITS_DIST_KILOMETERS; + unitStr = String(" ") + TXT_UNITS_DIST_KILOMETERS; #endif #ifdef UNITS_DIST_MILES float vis = meters_to_miles(current.visibility); - unitStr = TXT_UNITS_DIST_MILES; + unitStr = String(" ") + TXT_UNITS_DIST_MILES; #endif // if visibility is less than 1.95, round to 1 decimal place // else round to int @@ -728,19 +728,19 @@ void drawForecast(owm_daily_t *const daily, tm timeInfo) // Round up to nearest mm dailyPrecip = std::round(dailyPrecip); dataStr = String(static_cast(dailyPrecip)); - unitStr = "mm"; + unitStr = String(" ") + TXT_UNITS_PRECIP_MILLIMETERS; #elif defined(UNITS_DAILY_PRECIP_CENTIMETERS) // Round up to nearest 0.1 cm dailyPrecip = millimeters_to_centimeters(dailyPrecip); dailyPrecip = std::round(dailyPrecip * 10) / 10.0f; dataStr = String(dailyPrecip, 1); - unitStr = "cm"; + unitStr = String(" ") + TXT_UNITS_PRECIP_CENTIMETERS; #elif defined(UNITS_DAILY_PRECIP_INCHES) // Round up to nearest 0.1 inch dailyPrecip = millimeters_to_inches(dailyPrecip); dailyPrecip = std::round(dailyPrecip * 10) / 10.0f; dataStr = String(dailyPrecip, 1); - unitStr = "in"; + unitStr = String(" ") + TXT_UNITS_PRECIP_INCHES; #endif #endif #if (DISPLAY_DAILY_PRECIP == 2) // smart