bonuska1/App/I18n.cs
Slavasil 3f7adfd417 various fixes in TextDisplay
- do not move the cursor when it is already in the correct position
- maintain currentFgColor and currentBgColor fields
- use translations for the game title
2025-03-23 21:23:10 +03:00

52 lines
2.2 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

namespace Game {
public class I18n {
public static readonly string LANGUAGE = "ru-RU";
static readonly Dictionary<string, string[]> LANGUAGES = new Dictionary<string, string[]>() {
{"en-US", new string[] {
"No answers added for question",
"Expected `=>`",
"Expected `True` or `False`",
"Expected `||` between answers",
"The output is not a terminal",
"Syntax error in the question database: {0} ({1}:{2}:{3})",
"Syntax error in the question database: {0} (line {1} column {2})",
"Cannot get console mode",
"Cannot set console mode",
"WHO WANTS TO BECOME",
"A STOPWATCHIONAIRE"
}},
{"ru-RU", new string[] {
"Не указано ни одного варианта ответа на вопрос",
"Ожидалось `=>`",
"Ожидалось `True` или `False`",
"Ожидалось `||` между вариантами ответа",
"Поток вывода не идёт в терминал",
"Ошибка синтаксиса в банке вопросов: {0} ({1}:{2}:{3})",
"Ошибка синтаксиса в банке вопросов: {0} (строка {1} символ {2})",
"Не удалось узнать режим консоли",
"Не удалось установить режим консоли",
"КТО ХОЧЕТ СТАТЬ",
"СЕКУНДОМЕРОМ"
}}
};
public static string? GetMessage(Message id) {
return LANGUAGES[LANGUAGE][(int)id];
}
public enum Message {
ERROR_NO_ANSWER_OPTIONS = 0,
ERROR_EXPECTED_ARROW_TOKEN,
ERROR_EXPECTED_TRUE_OR_FALSE,
ERROR_EXPECTED_ANSWER_SEPARATOR,
OUTPUT_IS_NOT_TERMINAL,
SYNTAX_ERROR_WITH_FILENAME,
SYNTAX_ERROR,
ERROR_GETCONSOLEMODE,
ERROR_SETCONSOLEMODE,
TITLE_LINE1,
TITLE_LINE2,
}
}
}