{"id":31898277,"url":"https://github.com/onthegosystems/simple-wordpress-translations-with-ptc-cli","last_synced_at":"2026-02-16T22:04:23.844Z","repository":{"id":311137877,"uuid":"1042557421","full_name":"OnTheGoSystems/simple-wordpress-translations-with-ptc-cli","owner":"OnTheGoSystems","description":null,"archived":false,"fork":false,"pushed_at":"2025-09-02T07:13:18.000Z","size":16,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-10-21T13:34:56.959Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/OnTheGoSystems.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-08-22T07:51:19.000Z","updated_at":"2025-09-02T07:38:25.000Z","dependencies_parsed_at":"2025-08-22T11:55:07.370Z","dependency_job_id":null,"html_url":"https://github.com/OnTheGoSystems/simple-wordpress-translations-with-ptc-cli","commit_stats":null,"previous_names":["pavel-te/simple-wordpress-translations-with-ptc-cli"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/OnTheGoSystems/simple-wordpress-translations-with-ptc-cli","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OnTheGoSystems%2Fsimple-wordpress-translations-with-ptc-cli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OnTheGoSystems%2Fsimple-wordpress-translations-with-ptc-cli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OnTheGoSystems%2Fsimple-wordpress-translations-with-ptc-cli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OnTheGoSystems%2Fsimple-wordpress-translations-with-ptc-cli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/OnTheGoSystems","download_url":"https://codeload.github.com/OnTheGoSystems/simple-wordpress-translations-with-ptc-cli/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OnTheGoSystems%2Fsimple-wordpress-translations-with-ptc-cli/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29521143,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-16T21:45:09.491Z","status":"ssl_error","status_checked_at":"2026-02-16T21:44:58.452Z","response_time":115,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-10-13T11:56:37.063Z","updated_at":"2026-02-16T22:04:23.827Z","avatar_url":"https://github.com/OnTheGoSystems.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# Simple WordPress Translations with PTC CLI\n\nThis repository demonstrates how to use [PTC CLI](https://github.com/OnTheGoSystems/ptc-cli/) to automate the translation process for WordPress plugins and themes.\n\n## 📋 Overview\n\nThe project shows a complete workflow for translation processing:\n- 📤 Upload `.pot` files to PTC (Private Translation Cloud)\n- 🔄 Automatic translation generation\n- 📥 Download ready `.po` and `.mo` files\n- 🤖 Automation via GitHub Actions\n\n## 🏗️ Project Structure\n\n```\n.\n├── .github/workflows/ptc.yml    # GitHub Actions workflow\n├── .ptc/config.yml              # PTC CLI configuration\n├── languages/                   # Translations folder\n│   ├── examplewp.pot           # Source translation file\n│   ├── examplewp-*.po          # Translation files\n│   └── examplewp-*.mo          # Compiled translations\n└── README.md                   # This documentation\n```\n\n## ⚙️ Configuration\n\n### 1. PTC Configuration (`.ptc/config.yml`)\n\n```yaml\nsource_locale: en\nfiles:\n  - file: languages/examplewp.pot\n    output: languages/examplewp-{{lang}}.po\n    additional_translation_files:\n      - type: mo\n        path: languages/examplewp-{{lang}}.mo\n      - type: wp\n        path: languages/examplewp-{{lang}}.json\n      - type: php\n        path: languages/examplewp-{{lang}}.l10n.php\n```\n\n**Parameter descriptions:**\n- `source_locale: en` - source language (English)\n- `file` - path to source `.pot` file\n- `output` - template for output files ({{lang}} is replaced with language code)\n- `additional_translation_files` - additional file formats:\n  - `mo` - compiled files for WordPress\n  - `wp` - JSON files for JavaScript translations\n  - `php` - PHP files for modern WordPress translations\n\n### 2. GitHub Actions (`.github/workflows/ptc.yml`)\n\nThe workflow automatically triggers on:\n- Push to `main` branch with changes in `config/locales/**/*.yml`\n- Manual trigger through GitHub UI\n\n## 🚀 Quick Start\n\n### Step 1: API Token Setup\n\n1. Get your API token from [PTC Dashboard](https://app.ptc.wpml.org/)\n2. Add token to repository secrets:\n   - Go to `Settings` → `Secrets and variables` → `Actions`\n   - Create new secret `PTC_API_TOKEN`\n   - Paste your token\n\n### Step 2: Local Usage\n\n```bash\n# Clone the repository\ngit clone \u003cyour-repo-url\u003e\ncd gh-simple-wordpress-translations-with-ptc-cli\n\n# Download PTC CLI\ncurl -fsSL https://raw.githubusercontent.com/OnTheGoSystems/ptc-cli/refs/heads/main/ptc-cli.sh -o ptc-cli.sh\nchmod +x ptc-cli.sh\n\n# Run translation processing\n./ptc-cli.sh --config-file .ptc/config.yml --api-token your-secret-token --verbose\n```\n\n### Step 3: GitHub Actions Automation\n\n1. Ensure `PTC_API_TOKEN` is configured in secrets\n2. Enable Actions permissions:\n   - `Settings` → `Actions` → `General` \n   - `Workflow permissions` → ✅ \"Allow GitHub Actions to create and approve pull requests\"\n3. Run the workflow:\n   - Go to `Actions` tab\n   - Select \"Process Translation Files\"\n   - Click \"Run workflow\"\n\n## 📊 Processing Flow\n\nPTC CLI performs the following steps:\n\n1. **📤 Upload** - `examplewp.pot` file is uploaded to PTC\n2. **⚙️ Processing** - automatic translation is triggered\n3. **👀 Monitoring** - translation status is tracked:\n   ```\n   🔵 QQ 1/30  → Queued\n   🔵 PP 15/30 → Processing\n   🟢 CC 28/30 → Completed\n   ```\n4. **📥 Download** - ready translations are saved to `languages/`\n\n### Changing File Paths\n\n```yaml\nfiles:\n  - file: path/to/your.pot\n    output: path/to/translations/your-{{lang}}.po\n    additional_translation_files:\n      - type: mo\n        path: path/to/translations/your-{{lang}}.mo\n```\n\n### Monitoring Configuration\n\n```bash\n# Increase timeout\n./ptc-cli.sh --config-file .ptc/config.yml --monitor-max-attempts 60\n\n# Change check interval\n./ptc-cli.sh --config-file .ptc/config.yml --monitor-interval 10\n```\n\n## 🐛 Troubleshooting\n\n### Common Errors\n\n**HTTP 401 Unauthorized**\n```\n[ERROR] Failed to upload file: examplewp.pot (HTTP 401)\n```\n✅ **Solution:** Check your API token is correct\n\n**Files Not Found**\n```\n[ERROR] No files found for pattern: examplewp.pot\n```\n✅ **Solution:** Ensure the file exists and path is correct\n\n**Translation Timeout**\n```\n[WARNING] Timed out files: 1\n```\n✅ **Solution:** Increase `--monitor-max-attempts` or check status manually\n\n### Debug Mode\n\nFor detailed diagnostics use:\n\n```bash\n./ptc-cli.sh --config-file .ptc/config.yml --verbose --dry-run\n```\n\n## 📝 Logs and Monitoring\n\nPTC CLI provides colored logs:\n- 🔵 **INFO** - general information\n- 🟢 **SUCCESS** - successful operations  \n- 🟡 **WARNING** - warnings\n- 🔴 **ERROR** - errors\n- 🔵 **DEBUG** - detailed information (only with --verbose)\n\n## 🎯 Use Cases\n\nThis setup is perfect for:\n- **WordPress Plugin Development** - automate translations for international distribution\n- **Theme Development** - provide multilingual support out of the box\n- **CI/CD Integration** - automatic translation updates on code changes\n- **Team Collaboration** - consistent translation workflow across team members\n\n## 🔄 Workflow Integration\n\n### Manual Trigger\n1. Update your `.pot` file with new strings\n2. Run the GitHub Action manually\n3. Review the generated Pull Request\n4. Merge translations\n\n### Automatic Trigger\n1. Commit changes to translation source files\n2. Push to main branch\n3. GitHub Actions automatically processes translations\n4. Pull Request is created with updates\n\n## 🔗 Useful Links\n\n- [PTC CLI Repository](https://github.com/OnTheGoSystems/ptc-cli/)\n- [PTC Dashboard](https://app.ptc.wpml.org/)\n- [GitHub Actions Documentation](https://docs.github.com/en/actions)\n\n## 🏆 Best Practices\n\n### Security\n- ✅ Store API tokens in GitHub Secrets, never in code\n- ✅ Use environment variables for local development\n- ✅ Review translation PRs before merging\n\n---\n\n💡 **Tip:** This repository serves as a template. Fork it and adapt it to your needs!","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fonthegosystems%2Fsimple-wordpress-translations-with-ptc-cli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fonthegosystems%2Fsimple-wordpress-translations-with-ptc-cli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fonthegosystems%2Fsimple-wordpress-translations-with-ptc-cli/lists"}