Skip to content

Commit

Permalink
Fix build
Browse files Browse the repository at this point in the history
  • Loading branch information
floppyhammer committed Feb 3, 2025
1 parent 4dc5ab7 commit f6009c7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/servers/translation_server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,14 @@ std::string TranslationServer::get_translation(std::string tag) {
const auto& locale_map = db_[current_locale_];

// Fallback
if (!locale_map.contains(tag)) {
if (locale_map.find(tag) == locale_map.end()) {
return tag;
}

return locale_map.at(tag);
}

void TranslationServer::load_translations(std::string filename) {
void TranslationServer::load_translations(const std::string& filename) {
std::ifstream file(filename);

rapidcsv::Document doc(filename);
Expand All @@ -42,7 +42,7 @@ void TranslationServer::load_translations(std::string filename) {
auto row = doc.GetRow<std::string>(row_idx);

for (int i = 0; i < locale_count; i++) {
auto locale = locale_names[i];
const auto& locale = locale_names[i];
db_[locale][row[0]] = row[i];
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/servers/translation_server.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class TranslationServer {

std::string get_translation(std::string tag);

void load_translations(std::string filename);
void load_translations(const std::string& filename);

private:
std::map<std::string, std::map<std::string, std::string>> db_;
Expand Down

0 comments on commit f6009c7

Please # to comment.