Prefer test versions of translations
This commit is contained in:
parent
815f30c75c
commit
370e573209
1 changed files with 6 additions and 6 deletions
|
|
@ -237,21 +237,21 @@ const char *LanguageMetadata(const char *key)
|
|||
|
||||
bool HasTranslation(const std::string &locale)
|
||||
{
|
||||
std::string gmoPath = paths::LangPath() + locale + ".gmo";
|
||||
if (FileExists(gmoPath.c_str()))
|
||||
std::string moPath = paths::LangPath() + locale + ".mo";
|
||||
if (FileExists(moPath.c_str()))
|
||||
return true;
|
||||
|
||||
std::string moPath = paths::LangPath() + locale + ".mo";
|
||||
return FileExists(moPath.c_str());
|
||||
std::string gmoPath = paths::LangPath() + locale + ".gmo";
|
||||
return FileExists(gmoPath.c_str());
|
||||
}
|
||||
|
||||
void LanguageInitialize()
|
||||
{
|
||||
SDL_RWops *rw;
|
||||
|
||||
auto path = paths::LangPath() + sgOptions.Language.szCode + ".gmo";
|
||||
auto path = paths::LangPath() + sgOptions.Language.szCode + ".mo";
|
||||
if ((rw = SDL_RWFromFile(path.c_str(), "rb")) == nullptr) {
|
||||
path = paths::LangPath() + sgOptions.Language.szCode + ".mo";
|
||||
path = paths::LangPath() + sgOptions.Language.szCode + ".gmo";
|
||||
if ((rw = SDL_RWFromFile(path.c_str(), "rb")) == nullptr) {
|
||||
perror(path.c_str());
|
||||
return;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue