blob: 6602dffaa8e59d6bf33ecb200cb9e1b4d79c506b (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
|
// license:BSD-3-Clause
// copyright-holders:Vas Crabb
/***************************************************************************
language.cpp
Multi-language support.
***************************************************************************/
#include "emu.h"
#include "language.h"
#include "emuopts.h"
#include "corestr.h"
#include <string>
void load_translation(emu_options &m_options)
{
util::unload_translation();
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 + PATH_SEPARATOR "strings.mo"))
{
osd_printf_error("Error opening translation file %s\n", name);
return;
}
osd_printf_verbose("Loading translation file %s\n", file.fullpath());
util::load_translation(file);
}
|