Skip to content

Commit

Permalink
fixup! Enable loading of po files in addons
Browse files Browse the repository at this point in the history
  • Loading branch information
CelticMinstrel committed Nov 16, 2016
1 parent 20c75f1 commit adbdd28
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions src/gettext_boost.cpp
Expand Up @@ -98,25 +98,24 @@ namespace
DBG_G << "Searching for po files for domain " << domain << '\n';
std::string path;
for(auto base_path : paths) {
DBG_G << "Searching in dir " << base_path << '\n';
if(base_path[base_path.length()-1] != '/') {
base_path += '/';
}
base_path += domain;
base_path += '/';
std::string try_path = base_path + lang_name_long + ".po";
DBG_G << " Trying path " << try_path << '\n';
path = filesystem::get_binary_file_location("", try_path);
if(!path.empty()) {
path = base_path + lang_name_long + ".po";
DBG_G << " Trying path " << path << '\n';
if(filesystem::file_exists(path)) {
break;
}
try_path = base_path + lang_name_short + ".po";
DBG_G << " Trying path " << try_path << '\n';
path = filesystem::get_binary_file_location("", try_path);
if(!path.empty()) {
path = base_path + lang_name_short + ".po";
DBG_G << " Trying path " << path << '\n';
if(filesystem::file_exists(path)) {
break;
}
}
if(path.empty()) {
if(!filesystem::file_exists(path)) {
continue;
}
std::ifstream po_file;
Expand Down

0 comments on commit adbdd28

Please sign in to comment.