Skip to content

Commit 64bf90f

Browse files
author
Federico Fissore
committed
Translations: fixed a nasty bug that prevented new translations to be included
1 parent 119cda6 commit 64bf90f

File tree

2 files changed

+5
-12
lines changed

2 files changed

+5
-12
lines changed

arduino-core/src/processing/app/i18n/python/transifex.py

+1-7
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,7 @@ def canonical_lang(self, lang):
3737

3838
def translation(self, lang):
3939
r = requests.get(
40-
'http://www.transifex.com/api/2/project/'
41-
'arduino-ide-15/resource/ide-15/translation/%s/?file' % lang,
40+
'https://www.transifex.com/api/2/project/arduino-ide-15/resource/ide-15/translation/%s/?file' % lang,
4241
auth=self.auth_
4342
)
4443
r.raise_for_status()
@@ -50,13 +49,8 @@ def pull(self, lang, fname):
5049
new = map(lambda a: a + '\n', new.split('\n'))
5150
new = update.read_po(new)
5251

53-
# remove the key '' to preserve the first comment block.
54-
first = new.pop('', ('', '', ''))
55-
5652
catalog = update.read_po(fname)
5753
update.merge(catalog, new)
58-
(comment, rkey, rvalue) = catalog.get('', ('', 'msgid ""\n', ''))
59-
catalog[''] = (comment, rkey, first[2])
6054

6155
update.dump(catalog, fname)
6256

arduino-core/src/processing/app/i18n/python/update.py

+4-5
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,10 @@ def dump(d, dstFile):
5454

5555
out.close()
5656

57-
def merge(d, dd):
58-
for key in dd.keys():
59-
if d.has_key(key):
60-
d[key] = dd[key]
61-
return d
57+
def merge(old, new):
58+
for key in new.keys():
59+
old[key] = new[key]
60+
return old
6261

6362
# Remove currently unused catalog text lines from ".po" file.
6463
def main():

0 commit comments

Comments
 (0)