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

Unified Diff: localeTools.py

Issue 9257092: More build tools improvements (Closed)
Patch Set: Created Jan. 25, 2013, 10:22 a.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 | « localeSyncChrome.py ('k') | packager.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: localeTools.py
===================================================================
--- a/localeTools.py
+++ b/localeTools.py
@@ -241,27 +241,16 @@ def fromJSON(path, data):
file.write(generateStringEntry(key, value['message'], path))
file.close()
def preprocessChromeLocale(path, metadata, isMaster):
fileHandle = codecs.open(path, 'rb', encoding='utf-8')
data = json.load(fileHandle)
fileHandle.close()
- # Remove synced keys, these don't need to be translated
- if metadata.has_section('locale_sync'):
- for file, stringIDs in metadata.items('locale_sync'):
- for stringID in re.split(r'\s+', stringIDs):
- if file == 'remove':
- key = stringID
- else:
- key = re.sub(r'\..*', '', file) + '_' + re.sub(r'\W', '_', stringID)
- if key in data:
- del data[key]
-
for key, value in data.iteritems():
if isMaster:
# Make sure the key name is listed in the description
if "description" in value:
value["description"] = "%s: %s" % (key, value["description"])
else:
value["description"] = key
else:
« no previous file with comments | « localeSyncChrome.py ('k') | packager.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld