Put the list of locales in the bundle plist to make wxLANGUAGE_DEFAULT work.

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@7028 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
Soren Jorvang
2011-02-01 02:22:15 +00:00
parent 27a3e533f4
commit 1c6572faa7
3 changed files with 11 additions and 7 deletions

View File

@ -80,18 +80,21 @@ elif sys.platform == 'darwin':
env.Install(env['data_dir'],
'#Source/Core/DolphinWX/resources/Dolphin.icns')
languages = []
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')
lproj = os.sep + po[index_lo:index_hi] + '.lproj'
lang = po[index_lo:index_hi]
lproj = os.sep + lang + '.lproj'
mo_dir = env['build_dir'] + '/Languages' + 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'] + lproj, '#' + mo_file)
languages += [lang]
from plistlib import writePlist
def createPlist(target, source, env):
@ -103,6 +106,7 @@ elif sys.platform == 'darwin':
CFBundleExecutable = 'Dolphin',
CFBundleIconFile = 'Dolphin.icns',
CFBundleIdentifier = 'com.dolphin-emulator.dolphin',
CFBundleLocalizations = languages,
CFBundlePackageType = 'APPL',
CFBundleShortVersionString =
utils.GenerateRevFile('', Dir('#None').abspath, None),