Skip to content

hasanbeder/translation-diff-checker

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

1 Commit
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Translation Diff Checker

A robust GitHub Action and CLI tool to compare two JSON translation files (Source vs Target) for missing keys and type mismatches.

Features

  • Recursive Check: Traverses deeply nested JSON structures.
  • Type Safety: Flags if value types do not match (e.g., String vs Array).
  • GitHub Actions Integration: Generates a detailed Markdown report in $GITHUB_STEP_SUMMARY.
  • Strict Mode: Optionally fails the CI pipeline if errors are found.

Usage (Local)

  1. Prerequisites: Python 3.x
  2. Setup:
    # No dependencies required for core logic, but if you add any:
    pip install -r requirements.txt
  3. Run:
    python src/main.py --source en.json --target tr.json --strict

Usage (GitHub Actions)

Add this to your workflow .yml file:

steps:
  - uses: actions/checkout@v3
  
  - name: Check Translations
    uses: hasanbeder/translation-diff-checker@main
    with:
      source_file: 'locales/en.json'
      target_file: 'locales/tr.json'
      strict_mode: 'true'

Inputs

Input Description Required Default
source_file Path to the source JSON file. Yes -
target_file Path to the target JSON file. Yes -
strict_mode Fail the build if differences are found (true/false). No true

About

๐ŸŒ A powerful CLI tool for analyzing translation files - featuring real-time comparison, interactive HTML reports, and support for nested JSON structures. Perfect for i18n projects.

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors