#pragma once

// Select the language used by the OLED interface.
// Build with UI_LANGUAGE_EN for English or UI_LANGUAGE_RU for Russian.
#define UI_LANGUAGE_EN 0
#define UI_LANGUAGE_RU 1

#ifndef UI_LANGUAGE
#define UI_LANGUAGE UI_LANGUAGE_RU
#endif

namespace UiText {

#if UI_LANGUAGE == UI_LANGUAGE_RU

constexpr const char *ROLE_NAMES[] = {
  "СОЛО", "МАСТЕР", "СЛЕЙВ"
};

constexpr const char *FAIL_NAMES[] = {
  "НЕТ ОШИБКИ",
  "НЕТ СИГНАЛА",
  "ПЕРИОД ВНЕ ДОПУСКА",
  "ЗАПОЛН. ВНЕ ДОПУСКА",
  "ЛИШНИЙ ФРОНТ",
  "ИМПУЛЬСНАЯ ПОМЕХА",
  "ПРОПУЩЕН ФРОНТ",
  "ОШИБКА ПОТЕРИ ДАННЫХ",
  "СВЯЗЬ ПОТЕРЯНА",
  "РЕЖИМ НЕ ПОДДЕРЖИВ.",
  "НЕ ХВАТАЕТ ТОЧНОСТИ",
  "ТЕСТ ОСТАНОВЛЕН"
};

constexpr const char *MODE_PREFIX = "РЕЖИМ: ";
constexpr const char *START_RUN = "ГОТОВ К ЗАПУСКУ";

constexpr const char *MENU_START_FREQUENCY = "ЧАСТОТА ОТ:";
constexpr const char *MENU_END_FREQUENCY = "ЧАСТОТА ДО:";
constexpr const char *MENU_ACCURACY = "ТОЧНОСТЬ:";
constexpr const char *MENU_TEST_TIME = "ВРЕМЯ ВЫБОРКИ:";
constexpr const char *MENU_PWM_DUTY = "ЗАПОЛНЕНИЕ:";
constexpr const char *MENU_TOTAL_TIME = "ОБЩЕЕ ВРЕМЯ:";
constexpr const char *FREQUENCY_UNIT = " Гц";

constexpr const char *SLAVE_READY = "СЛЕЙВ ГОТОВ";
constexpr const char *WAIT_MASTER = "ОЖИДАНИЕ МАСТЕРА";
constexpr const char *LINK_FAILED = "СВЯЗЬ НЕ УСТАНОВЛЕНА";
constexpr const char *RADIO_ERROR = "ОШИБКА СВЯЗИ";
constexpr const char *MASTER_SEARCH = "ПОИСК СЛЕЙВА";
constexpr const char *HOLD_START_STOP = "УДЕРЖ. START ДЛЯ СТОП";
constexpr const char *MASTER_SEEN = "МАСТЕР ОБНАРУЖЕН";
constexpr const char *ACK_SENT = "ОТВЕТ ОТПРАВЛЕН";
constexpr const char *START_AGAIN = "ГОТОВ К ЗАПУСКУ";
constexpr const char *TEST_FAILED = "ТЕСТ НЕ ПРОЙДЕН";

constexpr const char *PASS_WORD = "ТЕСТ ПРОЙДЕН";
constexpr const char *FAIL_FORMAT = "СБОЙ %s %.0f%%";
constexpr const char *TEST_FORMAT = "Тест:%-6s %2.0f%% %5s";
constexpr const char *PERIOD_OUT_FORMAT = "ОШИБКА ЧАСТОТЫ %s";
constexpr const char *DUTY_OUT_FORMAT = "ОШИБКА ЗАПОЛН. %s";
constexpr const char *NO_MEASUREMENT = "F:---      D:---%";

#elif UI_LANGUAGE == UI_LANGUAGE_EN

constexpr const char *ROLE_NAMES[] = {
  "SOLO", "MASTER", "SLAVE"
};

constexpr const char *FAIL_NAMES[] = {
  "NONE",
  "NO SIGNAL",
  "PERIOD OUT",
  "DUTY OUT",
  "EXTRA EDGE",
  "GLITCH",
  "LOST EDGE",
  "DATA LOSS ERROR",
  "LINK LOST",
  "UNSUPPORTED",
  "RESOLUTION",
  "ABORTED"
};

constexpr const char *MODE_PREFIX = "MODE: ";
constexpr const char *START_RUN = "READY TO START";

constexpr const char *MENU_START_FREQUENCY = "START FREQ:";
constexpr const char *MENU_END_FREQUENCY = "END FREQ:";
constexpr const char *MENU_ACCURACY = "ACCURACY:";
constexpr const char *MENU_TEST_TIME = "TEST TIME:";
constexpr const char *MENU_PWM_DUTY = "PWM DUTY:";
constexpr const char *MENU_TOTAL_TIME = "TOTAL TIME:";
constexpr const char *FREQUENCY_UNIT = " Hz";

constexpr const char *SLAVE_READY = "SLAVE READY";
constexpr const char *WAIT_MASTER = "WAIT MASTER";
constexpr const char *LINK_FAILED = "LINK FAILED";
constexpr const char *RADIO_ERROR = "RADIO ERROR";
constexpr const char *MASTER_SEARCH = "MASTER SEARCH";
constexpr const char *HOLD_START_STOP = "HOLD START TO STOP";
constexpr const char *MASTER_SEEN = "MASTER SEEN";
constexpr const char *ACK_SENT = "ACK SENT";
constexpr const char *START_AGAIN = "READY TO START";
constexpr const char *TEST_FAILED = "TEST FAILED";

constexpr const char *PASS_WORD = "TEST PASS";
constexpr const char *FAIL_FORMAT = "FAIL %s %.0f%%";
constexpr const char *TEST_FORMAT = "Test:%-6s %2.0f%% %5s";
constexpr const char *PERIOD_OUT_FORMAT = "PERIOD OUT %s";
constexpr const char *DUTY_OUT_FORMAT = "DUTY OUT %s";
constexpr const char *NO_MEASUREMENT = "F:---      D:---%";

#else
#error "UI_LANGUAGE must be UI_LANGUAGE_EN or UI_LANGUAGE_RU"
#endif

}  // namespace UiText
