po-to-transifex.py 462 B

123456789101112131415161718
  1. #!/usr/bin/env python3
  2. import subprocess
  3. from pathlib import Path
  4. from translation_utils import init_sync_dir
  5. RESOURCE_NAME = "mc.pot"
  6. SCRIPT_DIR = Path(__file__).parent
  7. SOURCE_DIR = SCRIPT_DIR.parent.parent
  8. sync_dir = init_sync_dir(SCRIPT_DIR, RESOURCE_NAME)
  9. # Copy mc.pot to the working directory
  10. (sync_dir / RESOURCE_NAME).write_text((SOURCE_DIR / "po" / RESOURCE_NAME).read_text())
  11. subprocess.run(("tx", "push", "--source"), cwd=sync_dir, check=True)