Skip to content

Commit

Permalink
Merge pull request #1455 from Zeit-Labs/shadinaif/sync-tags-bug
Browse files Browse the repository at this point in the history
fix: sync translation tags
  • Loading branch information
OmarIthawi authored Oct 4, 2023
2 parents a32fecf + 289fdf7 commit 002c2be
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions scripts/sync_translations.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,9 +125,10 @@ def sync_tags(self, old_resource, new_resource):
old_resource_str = self.tx_api.ResourceString.filter(resource=old_resource)
new_resource_str = self.tx_api.ResourceString.filter(resource=new_resource)

old_quick_lookup = {
item['attributes']['string_hash']: item['attributes']['tags'] for item in old_resource_str.to_dict()['data']
}
old_quick_lookup = {}
for item in old_resource_str.all():
dict_item = item.to_dict()
old_quick_lookup[dict_item['attributes']['string_hash']] = dict_item['attributes']['tags']

for new_info in new_resource_str.all():
old_tags = old_quick_lookup.get(new_info.string_hash)
Expand Down

0 comments on commit 002c2be

Please sign in to comment.