Thank you for your interest in contributing to LRM! This document provides guidelines and instructions for contributing.
- Code of Conduct
- Getting Started
- Development Setup
- How to Contribute
- Coding Guidelines
- Testing
- Submitting Changes
- Release Process
By participating in this project, you agree to maintain a respectful and inclusive environment for all contributors.
- Fork the repository on GitHub
- Clone your fork locally:
git clone https://github.com/YOUR-USERNAME/LocalizationManager.git cd LocalizationManager - Add upstream remote:
git remote add upstream https://github.com/nickprotop/LocalizationManager.git
- .NET 9.0 SDK or later (Download)
- Git for version control
- Text Editor/IDE (recommended: VS Code, Visual Studio, or Rider)
- Linux or Windows operating system
# Restore dependencies
dotnet restore
# Build the project
dotnet build
# Run tests
dotnet test
# Run the application
dotnet run -- validate --helpLocalizationManager/
├── Commands/ # CLI command implementations
├── Core/ # Core logic (models, parsing, validation)
├── UI/ # TUI editor components
├── Utils/ # Utility classes (backup manager)
├── LocalizationManager.Tests/ # Unit and integration tests
├── .github/ # GitHub Actions workflows
└── build.sh # Build script for releases
- Search existing issues to avoid duplicates
- Use the bug report template when creating a new issue
- Include:
- Clear description of the bug
- Steps to reproduce
- Expected vs actual behavior
- Environment details (OS, .NET version, LRM version)
- Error messages or screenshots
- Check existing feature requests and discussions
- Use the feature request template
- Describe:
- The problem you're trying to solve
- Your proposed solution
- Alternative solutions you've considered
- Why this feature would be useful
- Pick an issue or create one for discussion
- Create a feature branch:
git checkout -b feature/your-feature-name
- Make your changes (see Coding Guidelines)
- Test your changes (see Testing)
- Commit your changes:
git commit -m "Add feature: description" - Push to your fork:
git push origin feature/your-feature-name
- Create a Pull Request on GitHub
- Follow standard C# conventions (Microsoft C# Coding Conventions)
- Use meaningful variable and method names
- Add XML documentation comments for public APIs
- Keep methods focused and concise
- Use async/await for asynchronous operations where appropriate
/// <summary>
/// Validates resource files for consistency issues.
/// </summary>
/// <param name="resourceFiles">Collection of resource files to validate</param>
/// <returns>Validation result with any issues found</returns>
public ValidationResult Validate(IEnumerable<ResourceFile> resourceFiles)
{
// Implementation
}All source files should include the MIT license header:
// Copyright (c) 2025 Nikolaos Protopapas
// Licensed under the MIT LicenseWrite clear, descriptive commit messages:
Add validation for empty resource values
- Check for null or whitespace values
- Add tests for empty value detection
- Update validator to report empty values
Format:
- First line: Brief summary (50 chars or less)
- Blank line
- Detailed description (if needed)
- Use present tense ("Add feature" not "Added feature")
# Run all tests
dotnet test
# Run with detailed output
dotnet test --verbosity detailed
# Run specific test
dotnet test --filter "TestName"- Add tests for all new features
- Add tests for bug fixes to prevent regression
- Use descriptive test names that explain what is being tested
- Follow AAA pattern: Arrange, Act, Assert
Example:
[Fact]
public void Validate_ShouldDetectMissingKeys_WhenTranslationIsMissing()
{
// Arrange
var defaultFile = new ResourceFile { /* setup */ };
var translationFile = new ResourceFile { /* setup */ };
// Act
var result = validator.Validate(defaultFile, translationFile);
// Assert
Assert.True(result.HasMissingKeys);
Assert.Contains("KeyName", result.MissingKeys);
}- Update documentation if you're adding/changing features
- Add/update tests for your changes
- Ensure all tests pass locally
- Fill out the PR template completely
- Request review from maintainers
- Code follows project style guidelines
- Self-reviewed code
- Added/updated tests
- All tests pass
- Updated documentation (README, comments, etc.)
- No breaking changes (or documented if necessary)
- Commit messages are clear and descriptive
- Maintainers will review your PR within a few days
- You may be asked to make changes or improvements
- Once approved, a maintainer will merge your PR
- Your changes will be included in the next release
Releases are created using the release.sh script:
For Maintainers:
# Create a patch release (0.6.3 → 0.6.4)
./release.sh patch
# Create a minor release (0.6.3 → 0.7.0)
./release.sh minor
# Create a major release (0.6.3 → 1.0.0)
./release.sh majorWhat the script does:
-
Pre-flight checks:
- Verifies working directory is clean
- Confirms you're on main branch
- Tests remote connection and push permissions
-
Version bump:
- Bumps version in
LocalizationManager.csproj - Generates
CHANGELOG.mdfrom commits since last release - Categorizes commits (Fixed/Added/Changed) based on keywords
- Creates a commit with version changes and CHANGELOG
- Bumps version in
-
Tag and push:
- Creates version tag (e.g.,
v0.6.4) - Pushes commit and tag atomically to GitHub
- Creates version tag (e.g.,
-
On push failure:
- Automatically rolls back all changes
- No manual cleanup needed
GitHub Actions then:
- Triggers on the version tag
- Runs all tests
- Builds all 4 platforms (Linux/Windows x64/ARM64)
- Creates GitHub release with binaries and changelog
Note: Contributors don't need to worry about version numbers or releases. Maintainers handle the release process.
See BUILDING.md for more details.
The project uses three automated GitHub Actions workflows:
Triggers: Push to main or pull requests to main
What it does:
- Restores dependencies
- Builds the project in Release mode
- Runs all unit and integration tests
- Reports test results
Skip CI: Add [skip ci] to commit message to skip (used for docs-only changes)
Example:
git commit -m "Update documentation [skip ci]"Triggers: Push of version tags (e.g., v0.6.4, v1.0.0)
What it does:
- Extracts version from tag
- Generates changelog from commits since last release
- Runs all tests
- Builds all 4 platforms (Linux/Windows x64/ARM64)
- Creates archives with static filenames (lrm-linux-x64.tar.gz, etc.)
- Creates GitHub release with binaries and changelog
Note: Version tags are created by the release.sh script. Only maintainers create releases.
Here's how your changes flow through the automated system:
# 1. Sync with upstream
git checkout main
git pull upstream main
# 2. Create feature branch
git checkout -b feature/my-feature
# 3. Make changes and test locally
dotnet build
dotnet test
# 4. Commit changes (use descriptive prefixes for CHANGELOG)
git add .
git commit -m "Add support for nested resource files"
# or: "Fix validation for empty values"
# or: "Change export format to include metadata"
# 5. Push to your fork
git push origin feature/my-feature
# 6. Create PR on GitHub
# → CI workflow runs automatically
# → Tests must pass before merge
# 7. After PR is merged to main:
# → CI workflow runs tests
# → Your changes are included in the next release CHANGELOG- CI Workflow runs all tests on
mainbranch - Your commit is tracked in git history
- When a release is created, your commit will be included in the CHANGELOG
- When a maintainer creates a release,
LocalizationManager.csprojandCHANGELOG.mdare updated - Always sync before starting new work to avoid conflicts
For better CHANGELOG generation during releases, use descriptive commit messages with keywords:
# ✅ Good - Clear categorization
git commit -m "Fix memory leak in resource parser" # → CHANGELOG Fixed section
git commit -m "Add JSON export format" # → CHANGELOG Added section
git commit -m "Change validation to be case-insensitive" # → CHANGELOG Changed section
# ✅ Also good - Keywords detected
git commit -m "Fixed crash when loading empty files"
git commit -m "Added support for comments in CSV"
git commit -m "Refactor export logic for better performance"
# ⚠️ Less ideal - Will default to "Changed"
git commit -m "Update code"
git commit -m "Make improvements"Keywords for categorization:
- Fixed:
fix,fixed,bugfix - Added:
feat,add,added - Changed:
change,changed,update,refactor
# Fetch upstream changes
git fetch upstream
# Merge into your main
git checkout main
git merge upstream/main
# Push to your fork
git push origin mainIf you need to update or recreate the demo GIF (e.g., after adding new features):
asciinemafor recording terminal sessionsaggfor converting recordings to GIF
# Install asciinema (if not already installed)
sudo apt-get install asciinema
# Download pre-built agg binary
wget https://github.com/asciinema/agg/releases/download/v1.4.3/agg-x86_64-unknown-linux-gnu -O agg
chmod +x agg
sudo mv agg /usr/local/bin/# 1. Build the project first
./build.sh
# 2. Set optimal terminal size (120x30)
resize -s 30 120
# 3. Record the demo (runs demo.sh automatically)
asciinema rec lrm-demo.cast -c ./demo.sh
# 4. Convert to GIF
agg lrm-demo.cast lrm-demo.gif --speed 1.5 --font-size 14 --theme monokai
# 5. Move to assets folder
mv lrm-demo.gif assets/
# 6. Commit the updated GIF
git add assets/lrm-demo.gif
git commit -m "Update demo GIF with latest features"Notes:
- The
demo.shscript automatically backs up and restores test data - Terminal size 120x30 is optimal for GitHub README display
- Speed 1.5x provides good balance between watchability and brevity
- Use
monokaitheme for consistency with existing demo
- Questions? Open a GitHub Discussion
- Bug? Create an Issue
- Chat? Join our discussions on GitHub
Contributors will be recognized in:
- GitHub contributors page
- Release notes (when applicable)
- CHANGELOG.md (for significant contributions)
Thank you for contributing to LRM! 🌍