Files
Fu-Jie_openwebui-extensions/plugins/pipes/github-copilot-sdk/tests/verify_i18n.py
fujie f5a983fb4a feat(github-copilot-sdk): release v0.10.0 with native prompt restoration and live todo widget
- Restore native Copilot CLI prompts for authentic Plan Mode behavior
- Add SQLite-backed session management for state persistence via system prompt
- Implement Adaptive Autonomy (Agent chooses planning vs direct execution)
- Fix OpenWebUI custom tool context injection for v0.8.x compatibility
- Add compact Live TODO widget synchronized with session.db
- Upgrade SDK to github-copilot-sdk==0.1.30
- Remove legacy mode switch RPC calls (moved to prompt-driven orchestration)
- Fix intent status localization and widget whitespace optimization
- Sync bilingual READMEs and all documentation mirrors to v0.10.0
2026-03-07 04:30:15 +08:00

57 lines
1.7 KiB
Python

import sys
import importlib.util
import os
def check_i18n(file_path):
"""
Check if all language keys are synchronized across all translations in a plugin.
Always uses en-US as the source of truth.
"""
if not os.path.exists(file_path):
print(f"File not found: {file_path}")
return
# Dynamically import the plugin's Pipe class
spec = importlib.util.spec_from_file_location("github_copilot_sdk", file_path)
module = importlib.util.module_from_spec(spec)
spec.loader.exec_module(module)
pipe = module.Pipe()
translations = pipe.TRANSLATIONS
# en-US is our baseline
en_keys = set(translations["en-US"].keys())
print(f"Comparing all languages against en-US baseline ({len(en_keys)} keys)...")
print(f"Found {len(translations)} languages: {', '.join(translations.keys())}")
all_good = True
for lang, trans in translations.items():
if lang == "en-US":
continue
lang_keys = set(trans.keys())
missing = en_keys - lang_keys
extra = lang_keys - en_keys
if missing:
all_good = False
print(f"\n[{lang}] 🔴 MISSING keys: {missing}")
if extra:
all_good = False
print(f"[{lang}] 🔵 EXTRA keys: {extra}")
if all_good:
print("\n✅ All translations are fully synchronized!")
else:
print("\n❌ Translation sync check failed.")
if __name__ == "__main__":
# Get the parent path of this script to find the plugin relative to it
base_path = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
target_plugin = os.path.join(base_path, "github_copilot_sdk.py")
check_i18n(target_plugin)