Skip to content

Commit

Permalink
dump all newly computed hashes instead of only pushing updates to met…
Browse files Browse the repository at this point in the history
…adata
  • Loading branch information
andrew-fenton committed Nov 15, 2024
1 parent c4c21db commit 6ffc187
Showing 1 changed file with 3 additions and 11 deletions.
14 changes: 3 additions & 11 deletions i18nilize/src/internationalize/diffing_processor.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,14 +52,6 @@ def update_to_current_state(self, changed_files_list, hash_dict):
self.sync_translations()

def update_metadata(self, changed_files_list, hash_dict):
metadata = {}
with open(self.metadata_file_dir) as file:
metadata = json.load(file)

for file_name in changed_files_list:
file_name_no_ext = file_name.split(".")[0]
metadata[file_name_no_ext] = hash_dict[file_name_no_ext]

with open(self.metadata_file_dir, "w") as outfile:
json.dump(hash_dict, outfile)

Expand Down Expand Up @@ -129,8 +121,8 @@ def get_changed_translations(self):
Gets differences between old and new translations for one language
"""
def compare_language(self, file_name, changed_translations):
original_language_location = self.diff_state_files_dir + "\\" + file_name
current_language_location = self.curr_translation_files_dir + "\\" + file_name
original_language_location = os.path.join(self.diff_state_files_dir, file_name)
current_language_location = os.path.join(self.curr_translation_files_dir, file_name)

original_language = read_json_file(original_language_location)
current_language = read_json_file(current_language_location)
Expand All @@ -150,7 +142,7 @@ def compare_language(self, file_name, changed_translations):
return changed_translations

def add_language(self, file_name, changed_translations):
current_language_location = self.curr_translation_files_dir + "\\" + file_name
current_language_location = os.path.join(self.curr_translation_files_dir, file_name)
current_language = read_json_file(current_language_location)

for word, translation in current_language.items():
Expand Down

0 comments on commit 6ffc187

Please sign in to comment.