| 34 | } |
| 35 | |
| 36 | static std::string getI18nDataFilePath(const std::string& path) { |
| 37 | auto locale = getDesiredLocale(); |
| 38 | auto desired_file_path = std::format("{}/{}.i18n", path, locale); |
| 39 | if (file::isFile(desired_file_path)) { |
| 40 | return desired_file_path; |
| 41 | } else { |
| 42 | LOGGER.warn("Translations not found for {} at {}", locale, desired_file_path); |
| 43 | } |
| 44 | |
| 45 | auto fallback_locale = getFallbackLocale(); |
| 46 | auto fallback_file_path = std::format("{}/{}.i18n", path, getFallbackLocale()); |
| 47 | if (file::isFile(fallback_file_path)) { |
| 48 | return fallback_file_path; |
| 49 | } else { |
| 50 | LOGGER.warn("Fallback translations not found for {} at {}", fallback_locale, fallback_file_path); |
| 51 | return ""; |
| 52 | } |
| 53 | } |
| 54 | |
| 55 | std::string TextResources::ERROR_RESULT = "TXT_RES_ERROR"; |
| 56 |
no test coverage detected