🔨 Add script for checking outdated translations
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_codeargument to specify the language of the translations. - Compares commit dates of English and translated files.
- Displays the results in a tabular format using the
tabulatelibrary.
- Takes a
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.
📝 Docs preview for commit 5da4ebc7b7e085dd565686b3a161ec5698ebd9b0 at: https://c921c472.fastapitiangolo.pages.dev
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.
@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.
I create a cli based on this PR, so we can use it until this PR gets merged 😃
https://github.com/fastapi/fastapi/discussions/11930
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!
📝 Docs preview for commit 9b86c57be83f309787b32772ba04103c86dff15b at: https://caee3d52.fastapitiangolo.pages.dev