Glenn Rice 83eed62449 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
2011-01-10 19:26:36 +00:00

124 lines
3.3 KiB
Python

# -*- python -*-
Import('env')
import os
import sys
from SconsTests import utils
files = [
'BootManager.cpp',
]
libs = [
'core', 'lzo2', 'discio', 'bdisasm',
'inputcommon', 'common', 'lua', 'z', 'sfml-network',
]
wxlibs = [ ]
ldflags = [ ]
if env['HAVE_WX']:
files += [
'AboutDolphin.cpp',
'ARCodeAddEdit.cpp',
'GeckoCodeDiag.cpp',
'ConfigMain.cpp',
'Frame.cpp',
'FrameAui.cpp',
'FrameTools.cpp',
'LuaWindow.cpp',
'LogWindow.cpp',
'GameListCtrl.cpp',
'HotkeyDlg.cpp',
'InputConfigDiag.cpp',
'InputConfigDiagBitmaps.cpp',
'ISOFile.cpp',
'ISOProperties.cpp',
'PatchAddEdit.cpp',
'CheatsWindow.cpp',
'Main.cpp',
'MemcardManager.cpp',
'MemoryCards/GCMemcard.cpp',
'MemoryCards/WiiSaveCrypted.cpp',
'NetPlay.cpp',
'NetPlayClient.cpp',
'NetPlayServer.cpp',
'NetWindow.cpp',
'UDPConfigDiag.cpp',
'WiimoteConfigDiag.cpp',
'WxUtils.cpp',
]
wxlibs += [ 'debwx', 'debugger_ui_util', 'inputuicommon' ]
else:
files += [
'MainNoGUI.cpp',
'cmdline.c',
]
if sys.platform == 'win32':
files += [ "stdafx.cpp" ]
elif sys.platform == 'darwin' and not env['HAVE_WX']:
files += [ 'cocoaApp.m' ]
ldflags += [ '-Wl,-pagezero_size,0x1000' ]
exeNoGUI = '#' + env['prefix'] + '/DolphinNoGUI'
elif sys.platform == 'darwin' and env['HAVE_WX']:
wxlibs += env['wxconfiglibs']
ldflags += [ '-Wl,-pagezero_size,0x1000' ]
exeGUI = '#' + env['prefix'] + '/Dolphin.app/Contents/MacOS/Dolphin'
env.Install('#' + env['prefix'] + '/Dolphin.app/Contents/' +
'Library/Frameworks', '#Externals/Cg/Cg.framework')
env.Install(env['data_dir'], '#Data/Sys')
env.Install(env['data_dir'], '#Data/User')
env.Install(env['data_dir'],
'#Source/Core/DolphinWX/resources/Dolphin.icns')
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):
for srcNode in source:
writePlist(srcNode.value, str(target[0]))
env.Append(BUILDERS = {'Plist' : Builder(action = createPlist)})
env.Plist('#' + env['prefix'] + '/Dolphin.app/Contents/Info.plist',
Value(dict(
CFBundleExecutable = 'Dolphin',
CFBundleIconFile = 'Dolphin.icns',
CFBundleIdentifier = 'com.dolphin-emu.dolphin',
CFBundlePackageType = 'APPL',
CFBundleShortVersionString =
utils.GenerateRevFile('', Dir('#None').abspath, None),
CFBundleVersion = '3.0',
LSMinimumSystemVersion = '10.5.4',
LSRequiresCarbon = True,
)))
else:
files += [ 'X11Utils.cpp' ]
libs += [ 'SDL' ]
exeGUI = env['binary_dir'] + '/dolphin-emu'
exeNoGUI = env['binary_dir'] + '/dolphin-emu-nogui'
env.InstallAs(env['data_dir'] + '/sys', '#Data/Sys')
env.InstallAs(env['data_dir'] + '/user', '#Data/User')
libs = wxlibs + libs + env['LIBS']
linkflags = ldflags + env['LINKFLAGS']
if env['HAVE_WX']:
env.Program(exeGUI, files, LIBS = libs, LINKFLAGS = linkflags)
else:
env.Program(exeNoGUI, files, LIBS = libs, LINKFLAGS = linkflags)