| 55 | std::string TextResources::ERROR_RESULT = "TXT_RES_ERROR"; |
| 56 | |
| 57 | bool TextResources::load() { |
| 58 | std::vector<std::string> new_data; |
| 59 | |
| 60 | // Resolve the language file that we need (depends on system language selection) |
| 61 | auto file_path = getI18nDataFilePath(path); |
| 62 | if (file_path.empty()) { |
| 63 | LOGGER.error("Couldn't find i18n data for {}", path); |
| 64 | return false; |
| 65 | } |
| 66 | |
| 67 | file::readLines(file_path, true, [&new_data](const char* line) { |
| 68 | new_data.push_back(line); |
| 69 | }); |
| 70 | |
| 71 | if (new_data.empty()) { |
| 72 | LOGGER.error("Couldn't find i18n data for {}", path); |
| 73 | return false; |
| 74 | } |
| 75 | |
| 76 | data = std::move(new_data); |
| 77 | return true; |
| 78 | } |
| 79 | |
| 80 | } |