From 1ce36a82209a4731032d745e2a4a9f31557a6ddd Mon Sep 17 00:00:00 2001 From: David Conran Date: Tue, 8 Oct 2019 09:53:41 +1000 Subject: [PATCH] Minor i18n changes and add some platformio environs. (#955) * rename locale files from xx_XX.h to xx-XX.h * Enable building different langauges for IRrecvDumpV2 via platformio. * IRrecvDumpV2: Add Comments and add back "Raw Timing" as legacy option. * Clean up platformio.ini files. --- examples/CommonAcControl/platformio.ini | 3 +- examples/ControlSamsungAC/platformio.ini | 5 ++- examples/DumbIRRepeater/platformio.ini | 3 +- examples/IRGCSendDemo/platformio.ini | 3 +- examples/IRGCTCPServer/platformio.ini | 3 +- examples/IRMQTTServer/platformio.ini | 13 ++------ examples/IRServer/platformio.ini | 3 +- examples/IRrecvDemo/platformio.ini | 3 +- examples/IRrecvDump/platformio.ini | 3 +- examples/IRrecvDumpV2/IRrecvDumpV2.ino | 17 ++++++++-- examples/IRrecvDumpV2/platformio.ini | 31 +++++++++++++++++-- examples/IRsendDemo/platformio.ini | 3 +- examples/IRsendProntoDemo/platformio.ini | 3 +- examples/JVCPanasonicSendDemo/platformio.ini | 3 +- examples/LGACSend/platformio.ini | 3 +- examples/SmartIRRepeater/platformio.ini | 3 +- examples/TurnOnArgoAC/platformio.ini | 3 +- examples/TurnOnDaikinAC/platformio.ini | 3 +- examples/TurnOnFujitsuAC/platformio.ini | 5 ++- examples/TurnOnKelvinatorAC/platformio.ini | 5 ++- examples/TurnOnMitsubishiAC/platformio.ini | 5 ++- .../TurnOnMitsubishiHeavyAc/platformio.ini | 5 ++- examples/TurnOnPanasonicAC/platformio.ini | 5 ++- examples/TurnOnToshibaAC/platformio.ini | 5 ++- examples/TurnOnTrotecAC/platformio.ini | 3 +- examples/Web-AC-control/platformio.ini | 3 +- platformio.ini | 10 +++--- src/IRremoteESP8266.h | 2 +- src/i18n.h | 2 +- src/locale/{de_CH.h => de-CH.h} | 2 +- src/locale/{de_DE.h => de-DE.h} | 0 src/locale/defaults.h | 10 ++++-- src/locale/{en_AU.h => en-AU.h} | 2 +- src/locale/{en_IE.h => en-IE.h} | 2 +- src/locale/{en_UK.h => en-UK.h} | 2 +- src/locale/{en_US.h => en-US.h} | 0 src/locale/{es_ES.h => es-ES.h} | 0 test/Makefile | 2 +- tools/Makefile | 2 +- 39 files changed, 95 insertions(+), 85 deletions(-) rename src/locale/{de_CH.h => de-CH.h} (99%) rename src/locale/{de_DE.h => de-DE.h} (100%) rename src/locale/{en_AU.h => en-AU.h} (80%) rename src/locale/{en_IE.h => en-IE.h} (78%) rename src/locale/{en_UK.h => en-UK.h} (79%) rename src/locale/{en_US.h => en-US.h} (100%) rename src/locale/{es_ES.h => es-ES.h} (100%) diff --git a/examples/CommonAcControl/platformio.ini b/examples/CommonAcControl/platformio.ini index 1aba0afc..5fd80755 100644 --- a/examples/CommonAcControl/platformio.ini +++ b/examples/CommonAcControl/platformio.ini @@ -5,14 +5,13 @@ src_dir = . lib_extra_dirs = ../../ lib_ldf_mode = deep+ lib_ignore = examples +framework = arduino build_flags = [env:nodemcuv2] platform = espressif8266 -framework = arduino board = nodemcuv2 [env:esp32dev] platform = espressif32 -framework = arduino board = esp32dev diff --git a/examples/ControlSamsungAC/platformio.ini b/examples/ControlSamsungAC/platformio.ini index 1aba0afc..2d1f8f32 100644 --- a/examples/ControlSamsungAC/platformio.ini +++ b/examples/ControlSamsungAC/platformio.ini @@ -5,14 +5,13 @@ src_dir = . lib_extra_dirs = ../../ lib_ldf_mode = deep+ lib_ignore = examples -build_flags = +framework = arduino +build_flags = -D_IR_LOCALE_=en-AU [env:nodemcuv2] platform = espressif8266 -framework = arduino board = nodemcuv2 [env:esp32dev] platform = espressif32 -framework = arduino board = esp32dev diff --git a/examples/DumbIRRepeater/platformio.ini b/examples/DumbIRRepeater/platformio.ini index 1aba0afc..5fd80755 100644 --- a/examples/DumbIRRepeater/platformio.ini +++ b/examples/DumbIRRepeater/platformio.ini @@ -5,14 +5,13 @@ src_dir = . lib_extra_dirs = ../../ lib_ldf_mode = deep+ lib_ignore = examples +framework = arduino build_flags = [env:nodemcuv2] platform = espressif8266 -framework = arduino board = nodemcuv2 [env:esp32dev] platform = espressif32 -framework = arduino board = esp32dev diff --git a/examples/IRGCSendDemo/platformio.ini b/examples/IRGCSendDemo/platformio.ini index 1aba0afc..5fd80755 100644 --- a/examples/IRGCSendDemo/platformio.ini +++ b/examples/IRGCSendDemo/platformio.ini @@ -5,14 +5,13 @@ src_dir = . lib_extra_dirs = ../../ lib_ldf_mode = deep+ lib_ignore = examples +framework = arduino build_flags = [env:nodemcuv2] platform = espressif8266 -framework = arduino board = nodemcuv2 [env:esp32dev] platform = espressif32 -framework = arduino board = esp32dev diff --git a/examples/IRGCTCPServer/platformio.ini b/examples/IRGCTCPServer/platformio.ini index 1aba0afc..5fd80755 100644 --- a/examples/IRGCTCPServer/platformio.ini +++ b/examples/IRGCTCPServer/platformio.ini @@ -5,14 +5,13 @@ src_dir = . lib_extra_dirs = ../../ lib_ldf_mode = deep+ lib_ignore = examples +framework = arduino build_flags = [env:nodemcuv2] platform = espressif8266 -framework = arduino board = nodemcuv2 [env:esp32dev] platform = espressif32 -framework = arduino board = esp32dev diff --git a/examples/IRMQTTServer/platformio.ini b/examples/IRMQTTServer/platformio.ini index 0c2ed7a9..0a71d574 100644 --- a/examples/IRMQTTServer/platformio.ini +++ b/examples/IRMQTTServer/platformio.ini @@ -5,7 +5,9 @@ src_dir = . lib_extra_dirs = ../../ lib_ldf_mode = deep+ lib_ignore = examples -build_flags = -DMQTT_MAX_PACKET_SIZE=768 +build_flags = -DMQTT_MAX_PACKET_SIZE=768 -D_IR_LOCALE_=en-AU +framework = arduino +platform = espressif8266 [common] lib_deps_builtin = @@ -26,20 +28,14 @@ lib_deps_external = https://github.com/tzapu/WiFiManager.git#development [env:nodemcuv2] -platform = espressif8266 -framework = arduino board = nodemcuv2 lib_deps = ${common_esp8266.lib_deps_external} [env:d1_mini] -platform = espressif8266 -framework = arduino board = d1_mini lib_deps = ${common_esp8266.lib_deps_external} [env:d1_mini_no_mqtt] -platform = espressif8266 -framework = arduino board = d1_mini build_flags = ${env.build_flags} @@ -48,13 +44,10 @@ lib_deps = ${common_esp8266.lib_deps_external} [env:esp32dev] platform = espressif32 -framework = arduino board = esp32dev lib_deps = ${common_esp32.lib_deps_external} [env:esp01_1m] -platform = espressif8266 -framework = arduino board = esp01_1m build_flags = ${env.build_flags} diff --git a/examples/IRServer/platformio.ini b/examples/IRServer/platformio.ini index 1aba0afc..5fd80755 100644 --- a/examples/IRServer/platformio.ini +++ b/examples/IRServer/platformio.ini @@ -5,14 +5,13 @@ src_dir = . lib_extra_dirs = ../../ lib_ldf_mode = deep+ lib_ignore = examples +framework = arduino build_flags = [env:nodemcuv2] platform = espressif8266 -framework = arduino board = nodemcuv2 [env:esp32dev] platform = espressif32 -framework = arduino board = esp32dev diff --git a/examples/IRrecvDemo/platformio.ini b/examples/IRrecvDemo/platformio.ini index 1aba0afc..5fd80755 100644 --- a/examples/IRrecvDemo/platformio.ini +++ b/examples/IRrecvDemo/platformio.ini @@ -5,14 +5,13 @@ src_dir = . lib_extra_dirs = ../../ lib_ldf_mode = deep+ lib_ignore = examples +framework = arduino build_flags = [env:nodemcuv2] platform = espressif8266 -framework = arduino board = nodemcuv2 [env:esp32dev] platform = espressif32 -framework = arduino board = esp32dev diff --git a/examples/IRrecvDump/platformio.ini b/examples/IRrecvDump/platformio.ini index 1aba0afc..5fd80755 100644 --- a/examples/IRrecvDump/platformio.ini +++ b/examples/IRrecvDump/platformio.ini @@ -5,14 +5,13 @@ src_dir = . lib_extra_dirs = ../../ lib_ldf_mode = deep+ lib_ignore = examples +framework = arduino build_flags = [env:nodemcuv2] platform = espressif8266 -framework = arduino board = nodemcuv2 [env:esp32dev] platform = espressif32 -framework = arduino board = esp32dev diff --git a/examples/IRrecvDumpV2/IRrecvDumpV2.ino b/examples/IRrecvDumpV2/IRrecvDumpV2.ino index be825163..fc61f9b8 100644 --- a/examples/IRrecvDumpV2/IRrecvDumpV2.ino +++ b/examples/IRrecvDumpV2/IRrecvDumpV2.ino @@ -9,6 +9,9 @@ * https://github.com/crankyoldgit/IRremoteESP8266/wiki#ir-receiving * * Changes: + * Version 1.0 October, 2019 + * - Internationalisation (i18n) support. + * - Stop displaying the legacy raw timing info. * Version 0.5 June, 2019 * - Move A/C description to IRac.cpp. * Version 0.4 July, 2018 @@ -93,6 +96,11 @@ const uint8_t kTimeout = 15; // from your device. (e.g. Other IR remotes work.) // NOTE: Set this value very high to effectively turn off UNKNOWN detection. const uint16_t kMinUnknownSize = 12; + +// Legacy (No longer supported!) +// +// Change to `true` if you miss/need the old "Raw Timing[]" display. +#define LEGACY_TIMING_INFO false // ==================== end of TUNEABLE PARAMETERS ==================== // Use turn on the save buffer feature for more complete capture coverage. @@ -112,7 +120,7 @@ void setup() { #if DECODE_HASH // Ignore messages with less than minimum on or off pulses. irrecv.setUnknownThreshold(kMinUnknownSize); -#endif // DECODE_HASH +#endif // DECODE_HASH irrecv.enableIRIn(); // Start the receiver } @@ -123,7 +131,7 @@ void loop() { // Display a crude timestamp. uint32_t now = millis(); Serial.printf(D_STR_TIMESTAMP " : %06u.%03u\n", now / 1000, now % 1000); - // Check if we got an IR message tha was to big for our capture buffer. + // Check if we got an IR message that was to big for our capture buffer. if (results.overflow) Serial.printf(D_WARN_BUFFERFULL "\n", kCaptureBufferSize); // Display the library version the message was captured with. @@ -134,6 +142,11 @@ void loop() { String description = IRAcUtils::resultAcToString(&results); if (description.length()) Serial.println(D_STR_MESGDESC ": " + description); yield(); // Feed the WDT as the text output can take a while to print. +#if LEGACY_TIMING_INFO + // Output legacy RAW timing info of the result. + Serial.println(resultToTimingInfo(&results)); + yield(); // Feed the WDT (again) +#endif // LEGACY_TIMING_INFO // Output the results as source code Serial.println(resultToSourceCode(&results)); Serial.println(); // Blank line between entries diff --git a/examples/IRrecvDumpV2/platformio.ini b/examples/IRrecvDumpV2/platformio.ini index 1aba0afc..1eb1d8f5 100644 --- a/examples/IRrecvDumpV2/platformio.ini +++ b/examples/IRrecvDumpV2/platformio.ini @@ -2,17 +2,42 @@ src_dir = . [env] +; Default platform +platform = espressif8266 +; Default board +board = nodemcuv2 +framework = arduino lib_extra_dirs = ../../ lib_ldf_mode = deep+ lib_ignore = examples build_flags = [env:nodemcuv2] -platform = espressif8266 -framework = arduino board = nodemcuv2 +; build_flags = -D_IR_LOCALE_=en-AU [env:esp32dev] platform = espressif32 -framework = arduino board = esp32dev +; build_flags = -D_IR_LOCALE_=en-AU + +[env:de-CH] +build_flags = -D_IR_LOCALE_=de-CH + +[env:de-DE] +build_flags = -D_IR_LOCALE_=de-DE + +[env:en-AU] +build_flags = -D_IR_LOCALE_=en-AU + +[env:en-IE] +build_flags = -D_IR_LOCALE_=en-IE + +[env:en-UK] +build_flags = -D_IR_LOCALE_=en-UK + +[env:en-US] +build_flags = -D_IR_LOCALE_=en-US + +[env:es-ES] +build_flags = -D_IR_LOCALE_=es-ES diff --git a/examples/IRsendDemo/platformio.ini b/examples/IRsendDemo/platformio.ini index 1aba0afc..5fd80755 100644 --- a/examples/IRsendDemo/platformio.ini +++ b/examples/IRsendDemo/platformio.ini @@ -5,14 +5,13 @@ src_dir = . lib_extra_dirs = ../../ lib_ldf_mode = deep+ lib_ignore = examples +framework = arduino build_flags = [env:nodemcuv2] platform = espressif8266 -framework = arduino board = nodemcuv2 [env:esp32dev] platform = espressif32 -framework = arduino board = esp32dev diff --git a/examples/IRsendProntoDemo/platformio.ini b/examples/IRsendProntoDemo/platformio.ini index 1aba0afc..5fd80755 100644 --- a/examples/IRsendProntoDemo/platformio.ini +++ b/examples/IRsendProntoDemo/platformio.ini @@ -5,14 +5,13 @@ src_dir = . lib_extra_dirs = ../../ lib_ldf_mode = deep+ lib_ignore = examples +framework = arduino build_flags = [env:nodemcuv2] platform = espressif8266 -framework = arduino board = nodemcuv2 [env:esp32dev] platform = espressif32 -framework = arduino board = esp32dev diff --git a/examples/JVCPanasonicSendDemo/platformio.ini b/examples/JVCPanasonicSendDemo/platformio.ini index 1aba0afc..5fd80755 100644 --- a/examples/JVCPanasonicSendDemo/platformio.ini +++ b/examples/JVCPanasonicSendDemo/platformio.ini @@ -5,14 +5,13 @@ src_dir = . lib_extra_dirs = ../../ lib_ldf_mode = deep+ lib_ignore = examples +framework = arduino build_flags = [env:nodemcuv2] platform = espressif8266 -framework = arduino board = nodemcuv2 [env:esp32dev] platform = espressif32 -framework = arduino board = esp32dev diff --git a/examples/LGACSend/platformio.ini b/examples/LGACSend/platformio.ini index 1aba0afc..5fd80755 100644 --- a/examples/LGACSend/platformio.ini +++ b/examples/LGACSend/platformio.ini @@ -5,14 +5,13 @@ src_dir = . lib_extra_dirs = ../../ lib_ldf_mode = deep+ lib_ignore = examples +framework = arduino build_flags = [env:nodemcuv2] platform = espressif8266 -framework = arduino board = nodemcuv2 [env:esp32dev] platform = espressif32 -framework = arduino board = esp32dev diff --git a/examples/SmartIRRepeater/platformio.ini b/examples/SmartIRRepeater/platformio.ini index 1aba0afc..5fd80755 100644 --- a/examples/SmartIRRepeater/platformio.ini +++ b/examples/SmartIRRepeater/platformio.ini @@ -5,14 +5,13 @@ src_dir = . lib_extra_dirs = ../../ lib_ldf_mode = deep+ lib_ignore = examples +framework = arduino build_flags = [env:nodemcuv2] platform = espressif8266 -framework = arduino board = nodemcuv2 [env:esp32dev] platform = espressif32 -framework = arduino board = esp32dev diff --git a/examples/TurnOnArgoAC/platformio.ini b/examples/TurnOnArgoAC/platformio.ini index 1aba0afc..5fd80755 100644 --- a/examples/TurnOnArgoAC/platformio.ini +++ b/examples/TurnOnArgoAC/platformio.ini @@ -5,14 +5,13 @@ src_dir = . lib_extra_dirs = ../../ lib_ldf_mode = deep+ lib_ignore = examples +framework = arduino build_flags = [env:nodemcuv2] platform = espressif8266 -framework = arduino board = nodemcuv2 [env:esp32dev] platform = espressif32 -framework = arduino board = esp32dev diff --git a/examples/TurnOnDaikinAC/platformio.ini b/examples/TurnOnDaikinAC/platformio.ini index 1aba0afc..5fd80755 100644 --- a/examples/TurnOnDaikinAC/platformio.ini +++ b/examples/TurnOnDaikinAC/platformio.ini @@ -5,14 +5,13 @@ src_dir = . lib_extra_dirs = ../../ lib_ldf_mode = deep+ lib_ignore = examples +framework = arduino build_flags = [env:nodemcuv2] platform = espressif8266 -framework = arduino board = nodemcuv2 [env:esp32dev] platform = espressif32 -framework = arduino board = esp32dev diff --git a/examples/TurnOnFujitsuAC/platformio.ini b/examples/TurnOnFujitsuAC/platformio.ini index 1aba0afc..2d1f8f32 100644 --- a/examples/TurnOnFujitsuAC/platformio.ini +++ b/examples/TurnOnFujitsuAC/platformio.ini @@ -5,14 +5,13 @@ src_dir = . lib_extra_dirs = ../../ lib_ldf_mode = deep+ lib_ignore = examples -build_flags = +framework = arduino +build_flags = -D_IR_LOCALE_=en-AU [env:nodemcuv2] platform = espressif8266 -framework = arduino board = nodemcuv2 [env:esp32dev] platform = espressif32 -framework = arduino board = esp32dev diff --git a/examples/TurnOnKelvinatorAC/platformio.ini b/examples/TurnOnKelvinatorAC/platformio.ini index 1aba0afc..2d1f8f32 100644 --- a/examples/TurnOnKelvinatorAC/platformio.ini +++ b/examples/TurnOnKelvinatorAC/platformio.ini @@ -5,14 +5,13 @@ src_dir = . lib_extra_dirs = ../../ lib_ldf_mode = deep+ lib_ignore = examples -build_flags = +framework = arduino +build_flags = -D_IR_LOCALE_=en-AU [env:nodemcuv2] platform = espressif8266 -framework = arduino board = nodemcuv2 [env:esp32dev] platform = espressif32 -framework = arduino board = esp32dev diff --git a/examples/TurnOnMitsubishiAC/platformio.ini b/examples/TurnOnMitsubishiAC/platformio.ini index 1aba0afc..2d1f8f32 100644 --- a/examples/TurnOnMitsubishiAC/platformio.ini +++ b/examples/TurnOnMitsubishiAC/platformio.ini @@ -5,14 +5,13 @@ src_dir = . lib_extra_dirs = ../../ lib_ldf_mode = deep+ lib_ignore = examples -build_flags = +framework = arduino +build_flags = -D_IR_LOCALE_=en-AU [env:nodemcuv2] platform = espressif8266 -framework = arduino board = nodemcuv2 [env:esp32dev] platform = espressif32 -framework = arduino board = esp32dev diff --git a/examples/TurnOnMitsubishiHeavyAc/platformio.ini b/examples/TurnOnMitsubishiHeavyAc/platformio.ini index 1aba0afc..2d1f8f32 100644 --- a/examples/TurnOnMitsubishiHeavyAc/platformio.ini +++ b/examples/TurnOnMitsubishiHeavyAc/platformio.ini @@ -5,14 +5,13 @@ src_dir = . lib_extra_dirs = ../../ lib_ldf_mode = deep+ lib_ignore = examples -build_flags = +framework = arduino +build_flags = -D_IR_LOCALE_=en-AU [env:nodemcuv2] platform = espressif8266 -framework = arduino board = nodemcuv2 [env:esp32dev] platform = espressif32 -framework = arduino board = esp32dev diff --git a/examples/TurnOnPanasonicAC/platformio.ini b/examples/TurnOnPanasonicAC/platformio.ini index 1aba0afc..2d1f8f32 100644 --- a/examples/TurnOnPanasonicAC/platformio.ini +++ b/examples/TurnOnPanasonicAC/platformio.ini @@ -5,14 +5,13 @@ src_dir = . lib_extra_dirs = ../../ lib_ldf_mode = deep+ lib_ignore = examples -build_flags = +framework = arduino +build_flags = -D_IR_LOCALE_=en-AU [env:nodemcuv2] platform = espressif8266 -framework = arduino board = nodemcuv2 [env:esp32dev] platform = espressif32 -framework = arduino board = esp32dev diff --git a/examples/TurnOnToshibaAC/platformio.ini b/examples/TurnOnToshibaAC/platformio.ini index 1aba0afc..2d1f8f32 100644 --- a/examples/TurnOnToshibaAC/platformio.ini +++ b/examples/TurnOnToshibaAC/platformio.ini @@ -5,14 +5,13 @@ src_dir = . lib_extra_dirs = ../../ lib_ldf_mode = deep+ lib_ignore = examples -build_flags = +framework = arduino +build_flags = -D_IR_LOCALE_=en-AU [env:nodemcuv2] platform = espressif8266 -framework = arduino board = nodemcuv2 [env:esp32dev] platform = espressif32 -framework = arduino board = esp32dev diff --git a/examples/TurnOnTrotecAC/platformio.ini b/examples/TurnOnTrotecAC/platformio.ini index 1aba0afc..5fd80755 100644 --- a/examples/TurnOnTrotecAC/platformio.ini +++ b/examples/TurnOnTrotecAC/platformio.ini @@ -5,14 +5,13 @@ src_dir = . lib_extra_dirs = ../../ lib_ldf_mode = deep+ lib_ignore = examples +framework = arduino build_flags = [env:nodemcuv2] platform = espressif8266 -framework = arduino board = nodemcuv2 [env:esp32dev] platform = espressif32 -framework = arduino board = esp32dev diff --git a/examples/Web-AC-control/platformio.ini b/examples/Web-AC-control/platformio.ini index e399b7e1..86ac8dfe 100644 --- a/examples/Web-AC-control/platformio.ini +++ b/examples/Web-AC-control/platformio.ini @@ -5,6 +5,7 @@ src_dir = . lib_extra_dirs = ../../ lib_ldf_mode = deep+ lib_ignore = examples +framework = arduino build_flags = [common] @@ -26,12 +27,10 @@ lib_deps_external = [env:nodemcuv2] platform = espressif8266 -framework = arduino board = nodemcuv2 lib_deps = ${common_esp8266.lib_deps_external} [env:esp32dev] platform = espressif32 -framework = arduino board = esp32dev lib_deps = ${common_esp32.lib_deps_external} diff --git a/platformio.ini b/platformio.ini index 66d186f9..fd608fbb 100644 --- a/platformio.ini +++ b/platformio.ini @@ -1,23 +1,21 @@ [platformio] +# Default to building IRrecvDumpV2 if not in a specific example directory. src_dir = examples/IRrecvDumpV2 [env] lib_extra_dirs = . lib_ldf_mode = deep+ lib_ignore = examples -build_flags = +framework = arduino +platform = espressif8266 +build_flags = -D_IR_LOCALE_=en-AU [env:nodemcuv2] -platform = espressif8266 -framework = arduino board = nodemcuv2 [env:d1_mini] -platform = espressif8266 -framework = arduino board = d1_mini [env:esp32dev] platform = espressif32 -framework = arduino board = esp32dev diff --git a/src/IRremoteESP8266.h b/src/IRremoteESP8266.h index a72fb068..606a23a6 100644 --- a/src/IRremoteESP8266.h +++ b/src/IRremoteESP8266.h @@ -55,7 +55,7 @@ // Set the language & locale for the library. See the `locale` dir for options. #ifndef _IR_LOCALE_ -#define _IR_LOCALE_ en_AU +#define _IR_LOCALE_ en-AU #endif // _IR_LOCALE_ // Supported IR protocols diff --git a/src/i18n.h b/src/i18n.h index ae8041d4..27ac4d71 100644 --- a/src/i18n.h +++ b/src/i18n.h @@ -7,7 +7,7 @@ // Load the appropriate locale header file. #ifndef _IR_LOCALE_ -#define _IR_LOCALE_ en_AU +#define _IR_LOCALE_ en-AU #endif // _IR_LOCALE_ #define ENQUOTE_(x) #x diff --git a/src/locale/de_CH.h b/src/locale/de-CH.h similarity index 99% rename from src/locale/de_CH.h rename to src/locale/de-CH.h index 10471822..2c34ca97 100644 --- a/src/locale/de_CH.h +++ b/src/locale/de-CH.h @@ -5,7 +5,7 @@ #define LOCALE_DE_CH_H_ // Import German / Germany as default overrides. -#include "locale/de_DE.h" +#include "locale/de-DE.h" // As we have loaded another language, we need to #undef anything we need // to update/change. diff --git a/src/locale/de_DE.h b/src/locale/de-DE.h similarity index 100% rename from src/locale/de_DE.h rename to src/locale/de-DE.h diff --git a/src/locale/defaults.h b/src/locale/defaults.h index 78fa154c..81df7056 100644 --- a/src/locale/defaults.h +++ b/src/locale/defaults.h @@ -2,10 +2,14 @@ // The default text to use throughout the library. // The library will use this text if no locale (_IR_LOCALE_) is set or if // the locale doesn't define particular values. -// If they are defined, this file should NOT over ride them. +// If they are defined, this file should NOT override them. +// // This file should contain a #define for every translateable/locale dependant -// string used by the library. - +// string used by the library. Language specific files don't have to include +// everything. +// +// NOTE: ASCII/UTF-8 characters only. Unicode is NOT supported. +// // The defaults are English (AU) / en-AU. Australia (AU) is pretty much the same // as English (UK) for this libraries use case. #ifndef LOCALE_DEFAULTS_H_ diff --git a/src/locale/en_AU.h b/src/locale/en-AU.h similarity index 80% rename from src/locale/en_AU.h rename to src/locale/en-AU.h index 839834af..63ecf228 100644 --- a/src/locale/en_AU.h +++ b/src/locale/en-AU.h @@ -3,6 +3,6 @@ // This file will override the default values located in `defaults.h`. #ifndef LOCALE_EN_AU_H_ #define LOCALE_EN_AU_H_ -// Nothing should really need to be set here, as en_AU is the default +// Nothing should really need to be set here, as en-AU is the default // locale/language. #endif // LOCALE_EN_AU_H__ diff --git a/src/locale/en_IE.h b/src/locale/en-IE.h similarity index 78% rename from src/locale/en_IE.h rename to src/locale/en-IE.h index 0c9ba0c5..6a0304bc 100644 --- a/src/locale/en_IE.h +++ b/src/locale/en-IE.h @@ -3,6 +3,6 @@ // This file will override the default values located in `defaults.h`. #ifndef LOCALE_EN_IE_H_ #define LOCALE_EN_IE_H_ -// Nothing should really need to be set here, as en_IE is the same as en_AU, +// Nothing should really need to be set here, as en-IE is the same as en-AU, // which is the default locale/language. #endif // LOCALE_EN_IE_H__ diff --git a/src/locale/en_UK.h b/src/locale/en-UK.h similarity index 79% rename from src/locale/en_UK.h rename to src/locale/en-UK.h index e68d2ed5..2aa57f5c 100644 --- a/src/locale/en_UK.h +++ b/src/locale/en-UK.h @@ -3,6 +3,6 @@ // This file will override the default values located in `defaults.h`. #ifndef LOCALE_EN_UK_H_ #define LOCALE_EN_UK_H_ -// Nothing should really need to be set here, as en_UK is the same as en_AU, +// Nothing should really need to be set here, as en-UK is the same as en-AU, // which is the default locale/language. #endif // LOCALE_EN_UK_H__ diff --git a/src/locale/en_US.h b/src/locale/en-US.h similarity index 100% rename from src/locale/en_US.h rename to src/locale/en-US.h diff --git a/src/locale/es_ES.h b/src/locale/es-ES.h similarity index 100% rename from src/locale/es_ES.h rename to src/locale/es-ES.h diff --git a/test/Makefile b/test/Makefile index 3426f9d7..5767e7dd 100644 --- a/test/Makefile +++ b/test/Makefile @@ -21,7 +21,7 @@ INCLUDES = -I$(USER_DIR) -I. # Flags passed to the preprocessor. # Set Google Test's header directory as a system directory, such that # the compiler doesn't generate warnings in Google Test headers. -CPPFLAGS += -isystem $(GTEST_DIR)/include -DUNIT_TEST -D_IR_LOCALE_=en_AU +CPPFLAGS += -isystem $(GTEST_DIR)/include -DUNIT_TEST -D_IR_LOCALE_=en-AU # Flags passed to the C++ compiler. CXXFLAGS += -g -Wall -Wextra -pthread -std=gnu++11 diff --git a/tools/Makefile b/tools/Makefile index a3039512..81a71c98 100644 --- a/tools/Makefile +++ b/tools/Makefile @@ -18,7 +18,7 @@ INCLUDES = -I$(USER_DIR) -I$(TEST_DIR) # Flags passed to the preprocessor. # Set Google Test's header directory as a system directory, such that # the compiler doesn't generate warnings in Google Test headers. -CPPFLAGS += -DUNIT_TEST -D_IR_LOCALE_=en_AU +CPPFLAGS += -DUNIT_TEST -D_IR_LOCALE_=en-AU # Flags passed to the C++ compiler. CXXFLAGS += -g -Wall -Wextra -pthread -std=gnu++11