diff --git a/include/airly/Config.h b/include/airly/Config.h new file mode 100755 index 0000000..758ee2b --- /dev/null +++ b/include/airly/Config.h @@ -0,0 +1,11 @@ +#ifndef AIRLY_INCLUDE_AIRLY_CONFIG_H_ +#define AIRLY_INCLUDE_AIRLY_CONFIG_H_ + +#if !defined(THING_MODEL_B) && !defined(THING_MODEL_M) +#error \ + "Undefined thing model! Please define thing model via macro THING_#####_# \ +(Example: THING_MODEL_B). Supported thing models: Model B, Model M." +#define THING_UNDEFINED +#endif + +#endif // AIRLY_INCLUDE_AIRLY_CONFIG_H_ diff --git a/include/airly/I18n.h b/include/airly/I18n.h new file mode 100755 index 0000000..52b2d7b --- /dev/null +++ b/include/airly/I18n.h @@ -0,0 +1,22 @@ +#ifndef AIRLY_INCLUDE_AIRLY_I18N_H_ +#define AIRLY_INCLUDE_AIRLY_I18N_H_ + +/* Compilation-time config */ +#include + +#if !defined(LANG_EN_US) +#define LANG_UNDEFINED +#error \ + "Undefined language! Please define language via macro LANG_##_## \ +(Example: LANG_EN_US). Available languages: en-US." +#else +#define LANG_DEFINED +#endif + +namespace i18n { + +extern const char* DeviceTitle; + +} // namespace i18n + +#endif // AIRLY_INCLUDE_AIRLY_I18N_H_ diff --git a/src/airly/I18n.cc b/src/airly/I18n.cc new file mode 100755 index 0000000..093a2f2 --- /dev/null +++ b/src/airly/I18n.cc @@ -0,0 +1,15 @@ +#include + +// -------------------------------------------------------------------------- // +// Translations: stub +// -------------------------------------------------------------------------- // +#if defined(LANG_UNDEFINED) + +namespace i18n { + +const char* DeviceTitle = ""; + +} // namespace i18n + +#endif +// -------------------------------------------------------------------------- // diff --git a/src/airly/locales/en-US.cc b/src/airly/locales/en-US.cc new file mode 100755 index 0000000..9fcab26 --- /dev/null +++ b/src/airly/locales/en-US.cc @@ -0,0 +1,18 @@ +#include + +/* AVR low-level */ +#include + +// -------------------------------------------------------------------------- // +// Translations: common +// -------------------------------------------------------------------------- // +#if defined(LANG_DEFINED) && defined(THING_MODEL_B) + +namespace i18n { + +const char* DeviceTitle PROGMEM = "Airly Model B"; + +} // namespace i18n + +#endif +// -------------------------------------------------------------------------- //