Index: packagerEdge.py |
=================================================================== |
--- a/packagerEdge.py |
+++ b/packagerEdge.py |
@@ -6,6 +6,7 @@ |
import shutil |
import json |
import re |
+import errno |
from StringIO import StringIO |
from glob import glob |
import subprocess |
@@ -101,6 +102,23 @@ |
for attr, value in attributes: |
element.set(attr, value) |
+ # Windows rejects to install packages that contain localized resources |
+ # for either 'az' or 'uz'. Both languages have dialects using different |
+ # scripts. Using the script-sepcific language code instead seems to work. |
+ resources_dir = os.path.join(os.path.dirname(manifest_path), 'Resources') |
+ for element in root.findall('_d:Resources/_d:Resource', namespaces): |
+ old_code = element.get('Language') |
+ new_code = {'az': 'az-latn', |
+ 'uz': 'uz-cyrl'}.get(old_code) |
+ if new_code: |
+ element.set('Language', new_code) |
+ try: |
+ os.rename(os.path.join(resources_dir, old_code), |
+ os.path.join(resources_dir, new_code)) |
+ except OSError as e: |
+ if e.errno != errno.ENOENT: |
+ raise |
+ |
tree.write(manifest_path, encoding='utf-8', xml_declaration=True) |