Skip to content

Commit

Permalink
fix: fixup previous commit
Browse files Browse the repository at this point in the history
  • Loading branch information
OmarIthawi committed Jan 9, 2025
1 parent 6836c00 commit 7a63ca3
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions scripts/release_project_sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ def sync_translations(self, lang_id, main_resource, release_resource):
for release_translation in self.get_translations(lang_id=lang_id, resource=release_resource):
translation_id = self.get_translation_id(release_translation)
if translation_from_main_project := translations_from_main_project.get(translation_id):
status, updates = self.sync_translation_entry(
status, updates = self.determine_translation_updates(
translation_from_main_project=translation_from_main_project,
release_translation=release_translation,
)
Expand All @@ -127,16 +127,17 @@ def sync_translations(self, lang_id, main_resource, release_resource):

print(' finished', lang_id)

def sync_translation_entry(self, translation_from_main_project, release_translation):

def determine_translation_updates(self, translation_from_main_project, release_translation):
"""
Sync translation review from the main project to the release one.
Compare translations between main and release projects and determine needed updates.
Return:
tuple: status code, updates
- status code:
- updated: if the entry was updated
tuple: status, updates
- status:
- updated: the entry needs to be updated
- no-op: if the entry don't need any updates
- updated-dry-run: if the entry was updated in dry-run mode
- updated-dry-run: the entry needs to be updated but actually skipped due to dry-run mode
- updates: dict of updates to be applied to the release translation
"""
translation_id = self.get_translation_id(release_translation)
Expand Down

0 comments on commit 7a63ca3

Please sign in to comment.