{"id":48946718,"url":"https://github.com/gycks/transctl","last_synced_at":"2026-04-17T17:06:52.457Z","repository":{"id":339267978,"uuid":"1151345140","full_name":"Gycks/Transctl","owner":"Gycks","description":"A pragmatic, engine-agnostic localization CLI that manages translation workflows. 🌍","archived":false,"fork":false,"pushed_at":"2026-04-16T10:14:58.000Z","size":58,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-04-16T12:29:02.161Z","etag":null,"topics":["developer-tools","i18n","localization-tool","machine-translation","python"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Gycks.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","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,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-02-06T10:53:47.000Z","updated_at":"2026-04-16T10:15:00.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/Gycks/Transctl","commit_stats":null,"previous_names":["gycks/transctl"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/Gycks/Transctl","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Gycks%2FTransctl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Gycks%2FTransctl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Gycks%2FTransctl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Gycks%2FTransctl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Gycks","download_url":"https://codeload.github.com/Gycks/Transctl/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Gycks%2FTransctl/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31937751,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-17T12:37:54.787Z","status":"ssl_error","status_checked_at":"2026-04-17T12:37:25.095Z","response_time":62,"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":["developer-tools","i18n","localization-tool","machine-translation","python"],"created_at":"2026-04-17T17:06:51.661Z","updated_at":"2026-04-17T17:06:52.439Z","avatar_url":"https://github.com/Gycks.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# transctl\n\n\u003e A pragmatic localization CLI ⚙️\n\n`transctl` is a command-line tool for managing application translation workflows. It scans source files, extracts translatable content, translates it using a configured machine translation provider, and writes translated output files according to your project structure.\n\nThe tool maintains a local manifest and translation memory to avoid unnecessary retranslations across runs.\n\n---\n\n## Installation\n\nRequires **Python ≥ 3.11**.\n\nInstall from PyPI:\n\n```bash\npip install transctl\n```\n\n---\n\n## Quick Start\n\nInitialize a configuration file:\n\n```bash\ntransctl init\n```\n\nRun the translation workflow:\n\n```bash\ntransctl run\n```\n\nThat’s the minimal happy path.\n\nUse:\n\n```bash\ntransctl --help\n```\n\nto explore additional commands.\n\n---\n\n## What It Does\n\n`transctl`:\n\n- Scans configured resource directories\n- Extracts translatable content from files\n- Translates content into one or more target locales\n- Writes translated output files (never overwrites the source file)\n- Skips unchanged files using a generated `manifest.json`\n- Maintains a local SQLite-based translation memory\n- Supports optional glossary injection\n- Supports placeholder protection using `{{placeholder}}` syntax\n\n---\n\n## Avoiding Unnecessary Retranslations\n\nTwo mechanisms are used:\n\n### 1. Translation Manifest (`manifest.json`)\n\nAfter each run, a `manifest.json` file is generated automatically.  \nIt tracks file state to skip unchanged files in subsequent runs.\n\nIf the manifest is deleted or purged, files may be reprocessed.\n\n---\n\n### 2. Local Translation Memory (SQLite)\n\nA local SQLite database stores translated segments to prevent repeated translation of identical content across runs.\n\n- Automatically created and maintained\n- Oldest entries may be pruned when the file grows too large\n- Can be purged manually via `transctl purge`\n\nIf deleted, memory will rebuild over time.\n\n---\n\n## Configuration\n\nThe `.transctl.toml` file is required for operation.\n\nIf `transctl init` is executed and a configuration file already exists, no changes are made.\n\n---\n\n### Example Configuration\n\n```toml\n[locale]\nsource = \"en\"\ntargets = [\n    \"fr\",\n]\n\n[engine]\nprovider = \"deepl\"\n\n[resources.html]\ndirs = [\n    { path = \"templates/*\", layout = \"along-sided\" }\n]\n\n[resources.json]\ndirs = [\n    { path = \"locales/[source].*.json\"}\n]\n```\n\n---\n\n### Locale\n\n```toml\n[locale]\nsource = \"en\"\ntargets = [\"fr\"]\n```\n\n- `source` — source language  \n- `targets` — one or more target languages  \n\n---\n\n### Engine\n\n```toml\n[engine]\nprovider = \"deepl\"\n```\n\nSupported providers:\n\n- `deepl`\n- `azure`\n\nEngine-specific parameters can be provided interactively or via CLI flags.\n\n**Note**: The `auth_key` of all engines must be provided as an environment variable.\n\n\n#### DeepL\n\nRequired parameters: None\n\nExample (non-interactive):\n\n```bash\ntransctl init -y \\\n  -e deepl\n```\n\n\n#### Azure\n\nRequired parameters:\n\n- `region` — Azure resource region\n\nExample (non-interactive):\n\n```bash\ntransctl init -y \\\n  -e azure \\\n  --param region=$AZURE_REGION\n```\n\n---\n\n### Resources\n\nResources define what files should be translated.\n\nCurrently supported:\n\n- HTML\n- JSON\n\nExample:\n\n```toml\n[resources.json]\ndirs = [\n    { path = \"locales/*\", layout = \"along-sided\" },\n]\n```\n\n---\n\n### Layout Behavior\n\n`layout` determines where translated files are written.\n\nAllowed values:\n\n- `along-sided`\n- `by-language`\n\nIf omitted, the default behavior is equivalent to `along-sided`.\nNote that `layout=\"\"` is not valid and will result in an error.\n\n#### along-sided\n\nIf the original file is:\n\n```\ni18n.json\n```\n\nThe translated file becomes:\n\n```\nfr_i18n.json\n```\n\n---\n\n#### by-language\n\nKeeps the original filename but creates a language directory:\n\n```\nlocales/en/i18n.json\n→\nlocales/fr/i18n.json\n```\n\n---\n\n## Placeholder Protection\n\nTo prevent specific content from being translated, wrap it in:\n\n```\n{{placeholder}}\n```\n\nAnything inside `{{}}` is preserved.\n\n---\n\n## Glossary Support\n\nA glossary file can be provided as a simple JSON key-value mapping.\n\nExample:\n\n```json\n{\n  \"Key\": \"Value\"\n}\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgycks%2Ftransctl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgycks%2Ftransctl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgycks%2Ftransctl/lists"}