Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🔨 Add script for checking outdated translations #11864

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

lucasbalieiro
Copy link
Contributor

This pull request introduces a script that checks for outdated translations in documentation by comparing the last commit dates of English documents with those in a specific language.

Main Change:

  • Added Check Outdated Command: A new command has been added to ./scripts/docs.py:
    • Takes a language_code argument to specify the language of the translations.
    • Compares commit dates of English and translated files.
    • Displays the results in a tabular format using the tabulate library.

Usage:

To use the script, run the following command from the root of the FastAPI directory:

python ./scripts/docs.py check-outdated <language_code>

Replace <language_code> with the appropriate ISO 639-1 code for the translations you want to check.

Why This Script Can Be Useful:

This script provides an automated way to check for outdated translations by comparing commit dates of the English documentation with those of translated versions.

Key benefits include:

  • Efficiency: Quickly identify which translated files need updates without manually checking each file.
  • Consistency: Helps maintain consistency across different language versions of the documentation.
  • Automation: Streamlines the process of verifying translation freshness, reducing manual overhead.

Video:

Screencast.from.18-07-2024.22.27.46.webm

Testing:

  • Verify that the script correctly identifies outdated translations.

Dependencies Added to requirements-docs.txt:

  • tabulate: For formatting the output table.
  • gitpython: For retrieving commit information from Git repositories.

Other:

This idea originated from the discussion on 🇧🇷 Portuguese translations. Special thanks to @nazarepiedady and @Joao-Pedro-P-Holanda for their valuable feedback and insights!

I hope the FastAPI community finds this tool useful, and I'm excited to contribute back to the community that has given me so much through this framework.

@tiangolo
Copy link
Member

📝 Docs preview for commit 5da4ebc at: https://c921c472.fastapitiangolo.pages.dev

@ceb10n
Copy link
Contributor

ceb10n commented Jul 19, 2024

It's really a great idea @lucasbalieiro 🚀🚀

I can't review the code right now, but definitely I'll do it saturday or sunday.

I don't know if @tiangolo finds it useful, but I think it can help us a lot with the docs.

Copy link
Contributor

@nazarepiedady nazarepiedady left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The feature is good and understandable. Also, the code is not too extensive, so the person who sees it will not take too long to figure it out.

Well done 👏.

@nazarepiedady
Copy link
Contributor

@Kludex, we would like you to review the code and analyse the feature.

@tiangolo, what do you think about this feature?

To me, it is similar to what we have on the ecosystem of vue.

@alejsdev alejsdev changed the title Add Script for Checking Outdated Translations 🔨 Add script for checking outdated translations Jul 19, 2024
@ceb10n
Copy link
Contributor

ceb10n commented Jul 31, 2024

I create a cli based on this PR, so we can use it until this PR gets merged 😃

#11930

@alejsdev
Copy link
Member

Hi @lucasbalieiro @ceb10n

Thanks for being so interested in contributing to FastAPI, and for the time and effort that you have taken to submit this. I think this is a great idea, thanks for the initiative!
We have a high volume of PRs and we're working to review and classify them. This has been added to our backlog. We have to review several things before deciding which may be the best option (the script or CLI package) 🤔

We appreciate your patience as we managed the queue 🙇🏻‍♀️
Thanks again for your support and contribution!

Copy link
Contributor

📝 Docs preview for commit 9b86c57 at: https://caee3d52.fastapitiangolo.pages.dev

@alejsdev alejsdev self-assigned this Aug 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants