Contributing to the Project
Caution
The current project maintainers are researching automated documentation internationalization. Therefore, any PRs related to documentation internationalization/translation will NOT be accepted!
Please do NOT submit PRs related to documentation internationalization/translation!
Thank you for your interest in this project! Before you start contributing, please take some time to read the following guidelines to ensure your contribution can be smoothly accepted.
Types of Contributions Not Accepted
- Documentation internationalization/translation
- Contributions related to core infrastructure, such as HTTP API, etc.
- Issues explicitly marked as "No help needed" (including issues in the Byaidu/PDFMathTranslate and the PDFMathTranslate/PDFMathTranslate-next repository).
- Other contributions deemed inappropriate by the maintainers.
- Contributing documentation, but changing the documentation in languages other than English.
- PRs that require modifying PDF files.
Please do NOT submit PRs related to the above types.
Note
If you want to contribute documentation, please only modify the English version of the documentation. Other language versions are translated by contributors themselves.
Contribution Process
- Fork this repository and clone it locally.
- Create a new branch:
git checkout -b feature/<feature-name>
. - Develop and ensure your code meets the requirements.
- Commit your code:
- Push to your repository:
git push origin feature/<feature-name>
. - Create a PR on GitHub, provide a detailed description, and request a review from @awwaawwa.
- Ensure all automated checks pass.
Tip
You do not need to wait until your development is fully complete to create a PR. Creating one early allows us to review your implementation and provide suggestions.
If you have any questions about the source code or related matters, please contact the maintainer at [email protected].
Resource files for version 2.0 are shared with BabelDOC. The code for downloading related resources is in BabelDOC. If you want to add new resource files, please contact the BabelDOC maintainer at [email protected].
Basic Requirements
1. Workflow
- Please fork from the
main
branch and develop on your forked branch. - When submitting a Pull Request (PR), provide a detailed description of your changes.
- If your PR does not pass automated checks (indicated by
checks failed
and a red cross), please review the correspondingdetails
and modify your submission to ensure the new PR passes all checks.
2. Development and Testing
- Use the command
pip install -e .
for development and testing.
3. Code Formatting
- Configure the
pre-commit
tool and enableblack
andflake8
for code formatting.
4. Dependency Updates
- If you introduce new dependencies, please update the dependency list in the
pyproject.toml
file in a timely manner.
5. Documentation Updates
- If you add new command-line options, please update the list of command-line options in all language versions of the
README.md
file accordingly.
6. Commit Messages
- Use Conventional Commits, for example:
feat(translator): add openai
.
7. Coding Style
- Ensure your submitted code adheres to basic coding style standards.
- Use either snake_case or camelCase for variable naming.
8. Documentation Formatting
- For
README.md
formatting, please follow the Chinese Copywriting Guidelines. - Ensure that both English and Chinese documentation are always up to date; other language documentation updates are optional.
Adding a Translation Engine
- Add a new translator configuration class in the
pdf2zh/config/translate_engine_model.py
file. - Add an instance of the new translator configuration class to the
TRANSLATION_ENGINE_SETTING_TYPE
type alias in the same file. - Add the new translator implementation class in the
pdf2zh/translator/translator_impl
folder.
Note
This project does not intend to support any translation engines with an RPS (requests per second) lower than 4. Please do not submit support for such engines.
Project Structure
- config folder: Configuration system.
- translator folder: Translator-related implementations.
- gui.py: Provides the GUI interface.
- const.py: Some constants.
- main.py: Provides the command-line tool.
- high_level.py: High-level interfaces based on BabelDOC.
- http_api.py: Provides HTTP API (not started).
Contact Us
If you have any questions, please submit feedback via Issue or join our Telegram Group. Thank you for your contribution!
Tip
Immersive Translate sponsors monthly Pro membership codes for active contributors to this project. For details, please see: BabelDOC/PDFMathTranslate Contributor Reward Rules