Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: packagerEdge.py

Issue 29947559: Issue 7114 - Remove az and untranslated resources from Windows packages (Closed)
Patch Set: Different approach Created Nov. 20, 2018, 9:29 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | tests/expecteddata/AppxManifest_edge_development_build.xml » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: packagerEdge.py
===================================================================
--- a/packagerEdge.py
+++ b/packagerEdge.py
@@ -101,6 +101,20 @@
for attr, value in attributes:
element.set(attr, value)
+ # Windows rejects to install the package if it contains localized
+ # resources for 'az', or if the manifest lists resources for 'uz'
+ # but the relevant strings aren't translated.
+ resources_dir = os.path.join(os.path.dirname(manifest_path), 'Resources')
+ resources_element = root.find('_d:Resources', namespaces)
+ for element in resources_element.findall('_d:Resource', namespaces):
+ language = element.get('Language')
+ if language:
+ folder = os.path.join(resources_dir, language)
+ if language == 'az':
+ shutil.rmtree(folder, ignore_errors=True)
+ if not os.path.exists(folder):
+ resources_element.remove(element)
+
tree.write(manifest_path, encoding='utf-8', xml_declaration=True)
« no previous file with comments | « no previous file | tests/expecteddata/AppxManifest_edge_development_build.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld