mirror of
https://github.com/jorenchik/mdemory.git
synced 2026-03-22 00:26:21 +00:00
all ui translated to Latvian
This commit is contained in:
@@ -90,7 +90,7 @@ Result<NoneType> ValidateGrammar(const std::vector<Token>& tokens) {
|
||||
};
|
||||
return {
|
||||
.error=std::format(
|
||||
"Invalid token sequence: {} cannot precede {}",
|
||||
"Nekorekta tekstvienību secība: {} nevar būt pirms {}",
|
||||
std::string(capitalize(Token::toString(&token.tokenType))),
|
||||
std::string(capitalize(Token::toString(&nextToken.tokenType)))
|
||||
),
|
||||
@@ -133,7 +133,7 @@ Result<ParseInfo> parseQuestions(const std::vector<Token>& tokens) {
|
||||
size_t i = 0;
|
||||
|
||||
if (debug) {
|
||||
std::cout << "SECTION: Parser output:\n";
|
||||
std::cout << "SECTION: PARSER:\n";
|
||||
}
|
||||
|
||||
auto isInBounds = [tokens](size_t i) {
|
||||
@@ -147,7 +147,7 @@ Result<ParseInfo> parseQuestions(const std::vector<Token>& tokens) {
|
||||
std::istringstream ss(datetime);
|
||||
ss >> std::get_time(&tm, format.c_str());
|
||||
if (ss.fail()) {
|
||||
throw std::runtime_error("Failed to parse datetime string");
|
||||
throw std::runtime_error("Neizdevās nolasīt datuma un laiku");
|
||||
}
|
||||
std::time_t time = timegm(&tm);
|
||||
return time;
|
||||
@@ -156,7 +156,7 @@ Result<ParseInfo> parseQuestions(const std::vector<Token>& tokens) {
|
||||
time = parseToUTCTime(tokens[i].content.c_str(), "%d.%m.%Y %H:%M");
|
||||
} catch (std::exception e) {
|
||||
return makeResult(
|
||||
std::format("cannot parse the time - {}", e.what()),
|
||||
std::format("Parsēšanas kļūda - {}", e.what()),
|
||||
tokens[i]
|
||||
);
|
||||
}
|
||||
@@ -175,7 +175,7 @@ Result<ParseInfo> parseQuestions(const std::vector<Token>& tokens) {
|
||||
// Start element parsing & add to the offset.
|
||||
if (isInBounds(i + 1) && tokens[i + 1].tokenType == TokenType::ElementOrderModifier) {
|
||||
return makeResult(
|
||||
"cannot have order modifier ('^') in the question definition",
|
||||
"Nevar izmantot secības modifikatoru ('^') jautājuma sākumā",
|
||||
tokens[i + 1]
|
||||
);
|
||||
}
|
||||
@@ -184,7 +184,7 @@ Result<ParseInfo> parseQuestions(const std::vector<Token>& tokens) {
|
||||
cooldown = std::stod(tokens[i + 2].content);
|
||||
} catch (std::exception e) {
|
||||
return makeResult(
|
||||
"error parsing cooldown",
|
||||
"kļūda nolasot pārtraukumu",
|
||||
tokens[i + 1]
|
||||
);
|
||||
}
|
||||
@@ -214,7 +214,7 @@ Result<ParseInfo> parseQuestions(const std::vector<Token>& tokens) {
|
||||
if (offset == 5 && tokens[i + 5].tokenType != TokenType::QuestionEnd) {
|
||||
// Cannot place the identifier on the ordinary element.
|
||||
return makeResult(
|
||||
"Invalid identifier placement",
|
||||
"Nepareiza idenfikatora izvietošana",
|
||||
tokens[i]
|
||||
);
|
||||
}
|
||||
@@ -235,19 +235,19 @@ Result<ParseInfo> parseQuestions(const std::vector<Token>& tokens) {
|
||||
isOrderQuestion = true;
|
||||
if (!isDash) {
|
||||
return makeResult(
|
||||
"order questions can only be used with dashes ('-')",
|
||||
"secības jautājumus var izmantot tikai ar svītrām ('-')",
|
||||
tokens[i]
|
||||
);
|
||||
}
|
||||
if (isGroupQuestion) {
|
||||
return makeResult(
|
||||
"question with groups cannot be ordered ('-^' and ':')",
|
||||
"jautājumos ar grupām nevar būt secības elementu ('-^' and ':')",
|
||||
tokens[i]
|
||||
);
|
||||
}
|
||||
if (isInBounds(i + 3) && tokens[i + 3].tokenType == TokenType::MatchGroupEnd) {
|
||||
return makeResult(
|
||||
"cannot have groups in order question('-^' and ':')",
|
||||
"secības jautājumā nevar būt grupas ('-^' and ':')",
|
||||
tokens[i]
|
||||
);
|
||||
}
|
||||
@@ -257,7 +257,7 @@ Result<ParseInfo> parseQuestions(const std::vector<Token>& tokens) {
|
||||
isGroupQuestion = true;
|
||||
if (!isDash) {
|
||||
return makeResult(
|
||||
"group questions can only be used with dashes ('-')",
|
||||
"grupas jautājumus var definēt tikai ar svītru elementiem ('-')",
|
||||
tokens[i]
|
||||
);
|
||||
}
|
||||
@@ -338,19 +338,19 @@ Result<ParseInfo> parseQuestions(const std::vector<Token>& tokens) {
|
||||
}
|
||||
} else if (tokens[i].tokenType == TokenType::EndOfFile) {
|
||||
if (debug) {
|
||||
std::cout << "File terminated: EndOfFile\n";
|
||||
std::cout << "Fails beidzās: EndOfFile\n";
|
||||
}
|
||||
break;
|
||||
} else {
|
||||
return makeResult(
|
||||
"Unexpected token encountered",
|
||||
"Negaidīta tekstvienība",
|
||||
tokens[i]
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
if (debug) {
|
||||
std::cout << "SECTION END: Parser output:\n";
|
||||
std::cout << "SECTION END: PARSER:\n";
|
||||
}
|
||||
return makeResult(
|
||||
"",
|
||||
@@ -372,7 +372,7 @@ std::string MultiElementQuestion::toString() const {
|
||||
ss << opener << " " << choice.answer << "; ";
|
||||
}
|
||||
return std::format(
|
||||
"<Multiple element>\nsection:{}\nid:{}\n{}\n{}",
|
||||
"<Vairāku elementu jautājums>\nsekcija:{}\npārtraukums:{}\n{}\n{}",
|
||||
section,
|
||||
cooldown,
|
||||
questionText,
|
||||
@@ -390,7 +390,7 @@ std::string GroupQuestion::toString() const {
|
||||
ss << "; ";
|
||||
}
|
||||
return std::format(
|
||||
"<GroupQuestion>\nsection:{}\nid:{}\n{}\n{}",
|
||||
"<Grupas jautājums>\nsekcija:{}\npārtraukums:{}\n{}\n{}",
|
||||
section,
|
||||
cooldown,
|
||||
questionText,
|
||||
|
||||
Reference in New Issue
Block a user