summaryrefslogtreecommitdiffstatshomepage
path: root/src/frontend
diff options
context:
space:
mode:
authorGravatarGravatar Vas Crabb <vas@vastheman.com>2019-11-26 12:44:51 +1100
committerGravatarGravatar Vas Crabb <vas@vastheman.com>2019-11-26 12:45:12 +1100
commit43953ea10a8a8678ca3ea1b64f57804b774e0751 (patch)
tree6e731d319e3b254f9e2ead4f3b2e21e4c1a2ffec /src/frontend
parent1172f9d114a0785500d60b6169c02914d013933d (diff)
don't attempt to load a translation file if the language setting is empty (nw)
Diffstat (limited to 'src/frontend')
-rw-r--r--src/frontend/mame/language.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/frontend/mame/language.cpp b/src/frontend/mame/language.cpp
index a95a2b78451..a5f2e9ce3a9 100644
--- a/src/frontend/mame/language.cpp
+++ b/src/frontend/mame/language.cpp
@@ -60,11 +60,14 @@ void load_translation(emu_options &m_options)
f_translation_data.reset();
f_translation_map.clear();
- emu_file file(m_options.language_path(), OPEN_FLAG_READ);
std::string name = m_options.language();
+ if (name.empty())
+ return;
+
strreplace(name, " ", "_");
strreplace(name, "(", "");
strreplace(name, ")", "");
+ emu_file file(m_options.language_path(), OPEN_FLAG_READ);
if (file.open(name.c_str(), PATH_SEPARATOR "strings.mo") != osd_file::error::NONE)
{
osd_printf_error("Error opening translation file %s\n", name);