Get default langauge

This commit is contained in:
Anders Jenbo 2021-08-01 02:58:42 +02:00
commit 5c2a559487
3 changed files with 26 additions and 1 deletions

View file

@ -235,6 +235,19 @@ const char *LanguageMetadata(const char *key)
return it->second;
}
bool HasTranslation(const std::string &locale)
{
std::string gmoPath = paths::LangPath() + "./" + locale + ".gmo";
if (FileExists(gmoPath.c_str()))
return true;
std::string moPath = paths::LangPath() + "./" + locale + ".mo";
if (FileExists(moPath.c_str()))
return true;
return false;
}
void LanguageInitialize()
{
FILE *fp;