Skip to content

Commit

Permalink
added translation for compass point notation
Browse files Browse the repository at this point in the history
  • Loading branch information
lmarzen committed Feb 16, 2024
1 parent 15b7b7a commit 54aaad6
Show file tree
Hide file tree
Showing 7 changed files with 73 additions and 13 deletions.
3 changes: 3 additions & 0 deletions platformio/include/_locale.h
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,9 @@ extern const std::vector<String> TERM_HURRICANE;
extern const std::vector<String> TERM_DUST;
extern const std::vector<String> TERM_STRONG_WIND;

// COMPASS POINT
extern const char *COMPASS_POINT_NOTATION[32];

// AIR QUALITY INDEX
extern "C" {
extern const char *AUSTRALIA_AQI_TXT[6];
Expand Down
8 changes: 1 addition & 7 deletions platformio/src/display_utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1528,12 +1528,6 @@ const uint8_t *getWindBitmap24(int windDeg)
return wind_direction_icon_arr[arr_offset];
} // end getWindBitmap24

static const char *compass_point_notation_arr[32] = {
"N", "NbE", "NNE", "NEbN", "NE", "NEbE", "ENE", "EbN",
"E", "EbS", "ESE", "SEbE", "SE", "SEbS", "SSE", "SbE",
"S", "SbW", "SSW", "SWbS", "SW", "SWbW", "WSW", "WbS",
"W", "WbN", "WNW", "NWbW", "NW", "NWbN", "NNW", "NbW"};

/* Returns a pointer to a string that expresses the Compass Point Notation (CPN)
* of the given windDeg.
*
Expand Down Expand Up @@ -1561,7 +1555,7 @@ const char *getCompassPointNotation(int windDeg)
int arr_offset = (int) (windDeg / ( 360 / (float) precision ))
* ( 32 / precision) ;

return compass_point_notation_arr[arr_offset];
return COMPASS_POINT_NOTATION[arr_offset];
} // end getCompassPointNotation

/* This function returns a pointer to a string representing the meaning for a
Expand Down
17 changes: 15 additions & 2 deletions platformio/src/locales/locale_de_DE.inc
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,9 @@
/* Special thanks to Matthias Deimbacher (deimi) for contributing this
* translation.
*
* If you have any feedback or suggestions, please open an issue on this
* project's github page: <https://github.com/lmarzen/esp32-weather-epd/issues>
* If you have any feedback or suggestions on translations, please open an issue
* on this project's github page:
* <https://github.com/lmarzen/esp32-weather-epd/issues>
*/

#include <vector>
Expand Down Expand Up @@ -209,6 +210,18 @@ const std::vector<String> TERM_DUST =
const std::vector<String> TERM_STRONG_WIND =
{"wind"};

// COMPASS POINT
const char *COMPASS_POINT_NOTATION[32] = {
// 0° 11.25° 22.5° 33.75° 45° 56.25° 67.5° 78.75°
"N", "NzO", "NNO", "NOzN", "NO", "NOzO", "ONO", "OzN",
// 90° 101.25° 112.5° 123.75° 135° 146.25° 157.5° 168.75°
"O", "OzS", "OSO", "SOzO", "SO", "SOzS", "SSO", "SzO",
// 180° 191.25° 202.5° 213.75° 225° 236.25° 247.5° 258.75°
"S", "SzW", "SSW", "SWzS", "SW", "SWzW", "WSW", "WzS",
// 270° 281.25° 292.5° 303.75° 315° 326.25° 337.5° 348.75°
"W", "WzN", "WNW", "NWzW", "NW", "NWzN", "NNW", "NzW",
};

// AIR QUALITY INDEX
extern "C" {
const char *AUSTRALIA_AQI_TXT[6] =
Expand Down
12 changes: 12 additions & 0 deletions platformio/src/locales/locale_en_GB.inc
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,18 @@ const std::vector<String> TERM_DUST =
const std::vector<String> TERM_STRONG_WIND =
{"wind"};

// COMPASS POINT
const char *COMPASS_POINT_NOTATION[32] = {
// 0° 11.25° 22.5° 33.75° 45° 56.25° 67.5° 78.75°
"N", "NbE", "NNE", "NEbN", "NE", "NEbE", "ENE", "EbN",
// 90° 101.25° 112.5° 123.75° 135° 146.25° 157.5° 168.75°
"E", "EbS", "ESE", "SEbE", "SE", "SEbS", "SSE", "SbE",
// 180° 191.25° 202.5° 213.75° 225° 236.25° 247.5° 258.75°
"S", "SbW", "SSW", "SWbS", "SW", "SWbW", "WSW", "WbS",
// 270° 281.25° 292.5° 303.75° 315° 326.25° 337.5° 348.75°
"W", "WbN", "WNW", "NWbW", "NW", "NWbN", "NNW", "NbW",
};

// AIR QUALITY INDEX
extern "C" {
const char *AUSTRALIA_AQI_TXT[6] =
Expand Down
12 changes: 12 additions & 0 deletions platformio/src/locales/locale_en_US.inc
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,18 @@ const std::vector<String> TERM_DUST =
const std::vector<String> TERM_STRONG_WIND =
{"wind"};

// COMPASS POINT
const char *COMPASS_POINT_NOTATION[32] = {
// 0° 11.25° 22.5° 33.75° 45° 56.25° 67.5° 78.75°
"N", "NbE", "NNE", "NEbN", "NE", "NEbE", "ENE", "EbN",
// 90° 101.25° 112.5° 123.75° 135° 146.25° 157.5° 168.75°
"E", "EbS", "ESE", "SEbE", "SE", "SEbS", "SSE", "SbE",
// 180° 191.25° 202.5° 213.75° 225° 236.25° 247.5° 258.75°
"S", "SbW", "SSW", "SWbS", "SW", "SWbW", "WSW", "WbS",
// 270° 281.25° 292.5° 303.75° 315° 326.25° 337.5° 348.75°
"W", "WbN", "WNW", "NWbW", "NW", "NWbN", "NNW", "NbW",
};

// AIR QUALITY INDEX
extern "C" {
const char *AUSTRALIA_AQI_TXT[6] =
Expand Down
17 changes: 15 additions & 2 deletions platformio/src/locales/locale_fr_FR.inc
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,9 @@
/* Special thanks to Luc Sanchez (ColonelMoutarde) for contributing this
* translation.
*
* If you have any feedback or suggestions, please open an issue on this
* project's github page: <https://github.com/lmarzen/esp32-weather-epd/issues>
* If you have any feedback or suggestions on translations, please open an issue
* on this project's github page:
* <https://github.com/lmarzen/esp32-weather-epd/issues>
*/

#include <vector>
Expand Down Expand Up @@ -209,6 +210,18 @@ const std::vector<String> TERM_DUST =
const std::vector<String> TERM_STRONG_WIND =
{"wind"};

// COMPASS POINT
const char *COMPASS_POINT_NOTATION[32] = {
// 0° 11.25° 22.5° 33.75° 45° 56.25° 67.5° 78.75°
"N", "NbE", "NNE", "NEbN", "NE", "NEbE", "ENE", "EbN",
// 90° 101.25° 112.5° 123.75° 135° 146.25° 157.5° 168.75°
"E", "EbS", "ESE", "SEbE", "SE", "SEbS", "SSE", "SbE",
// 180° 191.25° 202.5° 213.75° 225° 236.25° 247.5° 258.75°
"S", "SbO", "SSO", "SObS", "SO", "SObO", "OSO", "ObS",
// 270° 281.25° 292.5° 303.75° 315° 326.25° 337.5° 348.75°
"O", "ObN", "ONO", "NObO", "NO", "NObN", "NNO", "NbO",
};

// AIR QUALITY INDEX
extern "C" {
const char *AUSTRALIA_AQI_TXT[6] =
Expand Down
17 changes: 15 additions & 2 deletions platformio/src/locales/locale_nl_BE.inc
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,9 @@

/* Special thanks to Juan Rial (jrial) for contributing this translation.
*
* If you have any feedback or suggestions, please open an issue on this
* project's github page: <https://github.com/lmarzen/esp32-weather-epd/issues>
* If you have any feedback or suggestions on translations, please open an issue
* on this project's github page:
* <https://github.com/lmarzen/esp32-weather-epd/issues>
*/

#include <vector>
Expand Down Expand Up @@ -208,6 +209,18 @@ const std::vector<String> TERM_DUST =
const std::vector<String> TERM_STRONG_WIND =
{"wind"};

// COMPASS POINT
const char *COMPASS_POINT_NOTATION[32] = {
// 0° 11.25° 22.5° 33.75° 45° 56.25° 67.5° 78.75°
"N", "NbO", "NNO", "NObN", "NO", "NObO", "ONO", "ObN",
// 90° 101.25° 112.5° 123.75° 135° 146.25° 157.5° 168.75°
"O", "ObZ", "OZO", "ZObO", "ZO", "ZObZ", "ZZO", "ZbO",
// 180° 191.25° 202.5° 213.75° 225° 236.25° 247.5° 258.75°
"Z", "ZbW", "ZZW", "ZWbZ", "ZW", "ZWbW", "WZW", "WbZ",
// 270° 281.25° 292.5° 303.75° 315° 326.25° 337.5° 348.75°
"W", "WbN", "WNW", "NWbW", "NW", "NWbN", "NNW", "NbW",
};

// AIR QUALITY INDEX
extern "C" {
const char *AUSTRALIA_AQI_TXT[6] =
Expand Down

0 comments on commit 54aaad6

Please sign in to comment.