mirror of
https://github.com/langgenius/dify-docs.git
synced 2026-03-27 13:28:32 +07:00
## Changes ### Unified Configuration - Centralized all language configuration in `tools/translate/config.json` - Added `source_language`, `target_languages`, and `languages` structure - Merged translation notices from `notices.json` into language configs - Each language now has: code, name, directory, and translation_notice ### Updated sync_and_translate.py - Removed hardcoded LANGUAGES dict and TARGET_LANGUAGES list - Enhanced load_config() with validation - Added helper methods for language info access - All methods now use config-based language properties ### Updated main.py - Added config loading at module level - Dynamically builds docs_structure from config - Keeps plugin-dev/versioned paths hardcoded as requested ### Updated workflow - .github/workflows/sync_docs_execute.yml now loads config - Replaced all hardcoded language references with config values ### Cleanup - Removed deprecated notices.json ### Test File - Added en/testing/config-refactor-test.mdx to test the refactoring - Added to docs.json to trigger auto-translation workflow ## Benefits - Single source of truth for language configuration - Adding new languages requires only config.json changes - No code changes needed to add/modify languages - Better validation and error handling 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>