Contributing to Godot Version Manager
June 25, 2025 ยท View on GitHub
Thank you for considering contributing to GDVM! Here are some guidelines to help you get started.
How to Contribute
- Fork the repository: Click the "Fork" button at the top right of the repository page.
- Clone your fork: Clone your forked repository to your local machine.
git clone https://github.com/adalinesimonian/gdvm.git - Create a branch: Create a new branch for your feature or bugfix.
git checkout -b my-feature-branch - Make your changes: Implement your feature or fix the bug.
- Commit your changes: Commit your changes with a clear and concise commit message.
git add . git commit -m "Description of your changes" - Push to your fork: Push your changes to your forked repository.
git push origin my-feature-branch - Create a Pull Request: Open a pull request to the main repository. Provide a detailed description of your changes.
Building GDVM for Development
To build the project, you need to have Rust installed. You can install Rust from rustup.rs.
From the root of the repository, you can build and run the project with:
cargo run -p gdvm
Building GDVM for Release
For a release build, just add the --release flag to the cargo build command.
cargo build -p gdvm --release
The compiled binary will be available in the target/release directory.
Package Registry
GDVM uses a separate Git branch named registry to store a machine-readable list of Godot versions. This branch is updated automatically and usually should not be modified directly by contributors. For more details on its structure and how it works, please see the registry's README.md.
Internationalization (i18n)
GDVM supports multiple languages using the Fluent localization system. If you want to add or update translations, follow these steps:
Adding a New Language
-
Add a new Fluent file: Create a new Fluent file in the
crates/gdvm/i18ndirectory with the appropriate locale code (e.g.,fr-FR.ftlfor French). -
Update the
i18n.rsfile: Include the new Fluent file incrates/gdvm/src/i18n.rs. Remember to keep the locale variables/entries sorted alphabetically by language code.// Include the new Fluent file static FR_FR_FTL: &str = include_str!("../i18n/fr-FR.ftl"); // ... // Add the new locale to the resources array let resources = [ // Other locales (langid!("fr-FR"), FR_FR_FTL), // ... ];
Updating Existing Translations
-
Translate messages: Add translations for all the keys present in the existing Fluent files.
-
Test your translations: Ensure that the translations are correctly loaded and displayed in the application.
-
Check for missing translations: You can use the scripts in the
scripts/directory to find missing translations.# For Linux/macOS ./scripts/find-missing-i18n.sh# For Windows PowerShell .\scripts\find-missing-i18n.ps1 -
Format and sort translations: This script will help you format and sort the translations in the Fluent files using the
en-US.ftlfile as a reference. It requires that the pwsh command is available in your PATH.# For PowerShell ./scripts/sort-i18n.ps1 # Checks the Fluent bundles for sort/format issues ./scripts/sort-i18n.ps1 --format # Formats/sorts the Fluent bundles ./scripts/sort-i18n.sh # Alias for *nix systems, calls the PowerShell script
Testing
GDVM has two types of tests: unit tests and integration tests.
- Unit tests cover individual components and do not require any special setup.
- Integration tests test the entire application and interact with the file system.
By default, cargo test runs both unit and integration tests. However, for the integration tests to function correctly and not interfere with your personal GDVM settings, the integration-tests feature flag is required. This flag ensures that tests use a temporary directory for GDVM's home directory.
To run all tests correctly, you must use:
cargo test --features integration-tests
Running cargo test without this flag may cause integration tests to fail or modify your local GDVM settings.
If you wish to run only the unit tests, you can use:
cargo test --lib
When adding new tests, please consider whether they should be unit or integration tests. If a test needs to interact with the file system - for example, by installing or using a Godot version - it should be an integration test.
Code Style
- Follow the existing code style and conventions.
- Write clear and concise comments.
- Ensure your code is well-documented.
Reporting Issues
- Use the issue tracker to report bugs or request features.
- Provide as much detail as possible, including steps to reproduce the issue.
Code of Conduct
- Be respectful and considerate of others.
- Follow the Code of Conduct.
Thank you for your contributions!