diff options
Diffstat (limited to 'packages')
-rw-r--r-- | packages/darwin_app/Info.plist.in | 4 | ||||
-rw-r--r-- | packages/darwin_app/Makefile | 4 | ||||
-rwxr-xr-x | packages/darwin_app/embed-languages-in-info-list.py | 15 |
3 files changed, 22 insertions, 1 deletions
diff --git a/packages/darwin_app/Info.plist.in b/packages/darwin_app/Info.plist.in index 7f38d7fa..79c9cc75 100644 --- a/packages/darwin_app/Info.plist.in +++ b/packages/darwin_app/Info.plist.in @@ -25,6 +25,10 @@ </array> <key>CFBundleExecutable</key> <string>PD_APP_NAME</string> + <key>CFBundleLocalizations</key> + <array> + CFBUNDLELOCALIZATIONS + </array> <key>CFBundleIconFile</key> <string>pd.icns</string> <key>CFBundleIdentifier</key> diff --git a/packages/darwin_app/Makefile b/packages/darwin_app/Makefile index a05b7e99..92609bb3 100644 --- a/packages/darwin_app/Makefile +++ b/packages/darwin_app/Makefile @@ -130,11 +130,13 @@ endif # NOT /System #------------------------------------------------------------------------------# # generate Info.plist using PD_APP_NAME and PD_VERSION Info.plist: CFBUNDLEVERSION_DATE := $(shell date +%Y.%m.%d) +Info.plist: CFBUNDLELOCALIZATIONS := $(shell $(packages_src)/darwin_app/embed-languages-in-info-list.py $(pd_src)/po/Makefile.am) Info.plist: Info.plist.in cat Info.plist.in | \ sed 's/PD_APP_NAME/$(PD_APP_NAME)/' | \ sed 's/CFBUNDLESHORTVERSIONSTRING/$(PD_MAJOR_VERSION).$(PD_MINOR_VERSION).$(PD_BUGFIX_VERSION)/' | \ - sed 's/CFBUNDLEVERSION/$(CFBUNDLEVERSION_DATE)/' > \ + sed 's/CFBUNDLEVERSION/$(CFBUNDLEVERSION_DATE)/' | \ + sed 's|CFBUNDLELOCALIZATIONS|$(CFBUNDLELOCALIZATIONS)|' > \ Info.plist spotlight_importer_install: diff --git a/packages/darwin_app/embed-languages-in-info-list.py b/packages/darwin_app/embed-languages-in-info-list.py new file mode 100755 index 00000000..c2dd28db --- /dev/null +++ b/packages/darwin_app/embed-languages-in-info-list.py @@ -0,0 +1,15 @@ +#!/usr/bin/python + +import sys +import re + +f = open(sys.argv[1], 'r') +for line in f.readlines(): + if re.match('^ALL_LINGUAS = (.*)', line): + for po in line.split('=')[1].strip().rstrip().split(' '): + s = po.split('_') + if len(s) == 2: + iso = s[0] + '_' + s[1].upper() + else: + iso = po + print '<string>' + iso + '</string>\\n\\t', |