Build mo translation files on all platforms. Had to import msgfmt executable in the Externals to do this on windows.

Save wxLanguage enumeration value in ini file so that users are not surprised when a language is added and dolphin-emu is suddenly translated in a different language.
Update Spanish, Korean, and Simplified Chinese translations.


git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@6804 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
Glenn Rice
2011-01-10 19:26:36 +00:00
parent 601eab79e1
commit 83eed62449
35 changed files with 1680 additions and 1779 deletions

View File

@ -40,6 +40,23 @@
extern CFrame* main_frame;
// keep these in sync with CConfigMain::InitializeGUILists
static const wxLanguage langIds[] =
{
wxLANGUAGE_DEFAULT,
wxLANGUAGE_CHINESE_SIMPLIFIED,
wxLANGUAGE_ENGLISH,
wxLANGUAGE_FRENCH,
wxLANGUAGE_GERMAN,
wxLANGUAGE_HEBREW,
wxLANGUAGE_ITALIAN,
wxLANGUAGE_KOREAN,
wxLANGUAGE_NORWEGIAN_BOKMAL,
wxLANGUAGE_POLISH,
wxLANGUAGE_RUSSIAN,
wxLANGUAGE_SPANISH,
};
// Strings for Device Selections
#define DEV_NONE_STR "<Nothing>"
#define DEV_DUMMY_STR "Dummy"
@ -258,7 +275,7 @@ void CConfigMain::InitializeGUILists()
arrayStringFor_WiiSystemLang.Add(_("Korean"));
// GUI language arrayStrings
// keep those in sync with DolphinApp::InitLanguageSupport
// keep these in sync with the langIds array at the beginning of this file
arrayStringFor_InterfaceLang.Add(_("<System>"));
arrayStringFor_InterfaceLang.Add(_("Chinese (Simplified)"));
arrayStringFor_InterfaceLang.Add(_("English"));
@ -309,8 +326,12 @@ void CConfigMain::InitializeGUIValues()
UsePanicHandlers->SetValue(startup_params.bUsePanicHandlers);
Theme->SetSelection(startup_params.iTheme);
// need redesign
InterfaceLang->SetSelection(SConfig::GetInstance().m_InterfaceLanguage);
for (unsigned int i = 0; i < sizeof(langIds) / sizeof(wxLanguage); i++)
if (langIds[i] == SConfig::GetInstance().m_InterfaceLanguage)
{
InterfaceLang->SetSelection(i);
break;
}
// Gamecube - IPL
GCSystemLang->SetSelection(startup_params.SelectedLanguage);
@ -883,9 +904,9 @@ void CConfigMain::DisplaySettingsChanged(wxCommandEvent& event)
main_frame->InitBitmaps();
break;
case ID_INTERFACE_LANG:
if (SConfig::GetInstance().m_InterfaceLanguage != InterfaceLang->GetSelection())
if (SConfig::GetInstance().m_InterfaceLanguage != langIds[InterfaceLang->GetSelection()])
SuccessAlert("You must restart Dolphin in order for the change to take effect.");
SConfig::GetInstance().m_InterfaceLanguage = InterfaceLang->GetSelection();
SConfig::GetInstance().m_InterfaceLanguage = langIds[InterfaceLang->GetSelection()];
bRefreshList = true;
break;
case ID_HOTKEY_CONFIG:

View File

@ -411,32 +411,14 @@ void DolphinApp::InitLanguageSupport()
{
unsigned int language = 0;
// keep those in sync with CConfigMain::InitializeGUILists
const wxLanguage langIds[] =
{
wxLANGUAGE_DEFAULT,
wxLANGUAGE_CHINESE_SIMPLIFIED,
wxLANGUAGE_ENGLISH,
wxLANGUAGE_FRENCH,
wxLANGUAGE_GERMAN,
wxLANGUAGE_HEBREW,
wxLANGUAGE_ITALIAN,
wxLANGUAGE_KOREAN,
wxLANGUAGE_NORWEGIAN_BOKMAL,
wxLANGUAGE_POLISH,
wxLANGUAGE_RUSSIAN,
wxLANGUAGE_SPANISH,
};
IniFile ini;
ini.Load(File::GetUserPath(F_DOLPHINCONFIG_IDX));
ini.Get("Interface", "Language", &language, 0);
ini.Get("Interface", "Language", &language, wxLANGUAGE_DEFAULT);
// Load language if possible, fall back to system default otherwise
if(language >= 0 && language < sizeof(langIds) / sizeof(wxLanguage) && wxLocale::IsAvailable(langIds[language]))
if(wxLocale::IsAvailable(language))
{
m_locale = new wxLocale(langIds[language]);
m_locale = new wxLocale(language);
#ifdef _WIN32
m_locale->AddCatalogLookupPathPrefix(wxT("Languages"));

View File

@ -76,13 +76,18 @@ elif sys.platform == 'darwin' and env['HAVE_WX']:
env.Install(env['data_dir'],
'#Source/Core/DolphinWX/resources/Dolphin.icns')
mo_files = Glob('#Data/Languages/*/dolphin-emu.mo', strings=True)
for mo in mo_files:
index_lo = mo.find("Languages/") + len("Languages/")
index_hi = mo.find("/dolphin-emu.mo")
lang = mo[index_lo:index_hi]
lproj = env['data_dir'] + '/' + lang + ".lproj/dolphin-emu.mo"
env.InstallAs(lproj, mo)
msgfmt = env.WhereIs('msgfmt')
if not msgfmt == None:
po_files = Glob('#Languages/*.po', strings=True)
for po in po_files:
index_lo = po.find('Languages/') + len('Languages/')
index_hi = po.find('.po')
lang = po[index_lo:index_hi]
mo_dir = env['build_dir'] + '/Languages/' + lang + '.lproj'
mo_file = mo_dir + '/dolphin-emu.mo'
env.Command('#' + mo_file, po, 'mkdir -p ' + mo_dir +
' && msgfmt -o ' + mo_file + ' ' + po)
env.Install(env['data_dir'] + '/' + lang + '.lproj', '#' + mo_file)
from plistlib import writePlist
def createPlist(target, source, env):

View File

@ -657,10 +657,14 @@ Global
{56C4B06E-F2C9-4729-A15A-DD327A9AA465}.Release|x64.Build.0 = Release|x64
{0B8D0A82-C520-46BA-849D-3BB8F637EE0C}.Debug|Win32.ActiveCfg = Debug|Win32
{0B8D0A82-C520-46BA-849D-3BB8F637EE0C}.Debug|x64.ActiveCfg = Debug|Win32
{0B8D0A82-C520-46BA-849D-3BB8F637EE0C}.Debug|x64.Build.0 = Debug|Win32
{0B8D0A82-C520-46BA-849D-3BB8F637EE0C}.DebugFast|Win32.ActiveCfg = Debug|Win32
{0B8D0A82-C520-46BA-849D-3BB8F637EE0C}.DebugFast|x64.ActiveCfg = Debug|Win32
{0B8D0A82-C520-46BA-849D-3BB8F637EE0C}.DebugFast|x64.Build.0 = Debug|Win32
{0B8D0A82-C520-46BA-849D-3BB8F637EE0C}.Release|Win32.ActiveCfg = Release|Win32
{0B8D0A82-C520-46BA-849D-3BB8F637EE0C}.Release|x64.ActiveCfg = Release|x64
{0B8D0A82-C520-46BA-849D-3BB8F637EE0C}.Release|Win32.Build.0 = Release|Win32
{0B8D0A82-C520-46BA-849D-3BB8F637EE0C}.Release|x64.ActiveCfg = Release|Win32
{0B8D0A82-C520-46BA-849D-3BB8F637EE0C}.Release|x64.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE