Skip to content

Commit

Permalink
Merge pull request #2 from ceb10n/fix/outdated-files
Browse files Browse the repository at this point in the history
fix: translation date check
  • Loading branch information
ceb10n authored Sep 4, 2024
2 parents 8857b90 + 599708c commit 8e83ef8
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion fastapi_translations/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,16 +86,20 @@ def report(
original_doc_date = git.get_commit_date_for(
os.path.join(root, file)
)
translation_is_outdated = False
translated_date = git.get_commit_date_for(translated_path)

if translated_date and original_doc_date:
translation_is_outdated = translated_date > original_doc_date

doc = DocFile(
translation_lang=lang.value,
original_file=os.path.join(root, file),
original_commit=original_doc_date,
translation_file=translated_path,
translation_exists=translation_exists,
translation_commit=translated_date,
translation_is_outdated=translation_exists
translation_is_outdated=translation_is_outdated
)
summary.append_file(doc)
printer.print_table(summary, console, 10)
Expand Down

0 comments on commit 8e83ef8

Please sign in to comment.