Transbuilder is an automated translation tool developed in Go that uses the ChatGPT API to automatically translate various file types into one or more target languages. It supports popular file formats such as XLIFF, JSON, YAML, and CSV.
- Automatically translates files using the ChatGPT API.
- Supports multiple file formats:
- XLIFF (
.xlf,.xliff) - YAML (
.yaml,.yml) - JSON (
.json) - CSV (
.csv)
- XLIFF (
- Allows translation into multiple target languages at once.
- Generates translated files with proper formatting for each file type.
- Go version 1.15 or later.
- An API key for the ChatGPT API (OpenAI).
-
Clone the project repository:
git clone https://github.com/ICTools/transbuilder.git cd transbuilder -
Install dependencies:
go mod tidy
-
Build the project:
go build -o transbuilder ./cmd
--file: Path to the file to be translated (required).--langs: Comma-separated list of target languages (e.g.,fr,de,es) (required).--api-key: Your ChatGPT API key (required).
-
To translate an XLIFF file into French and German:
./transbuilder --file input.xliff --langs fr,de --api-key YOUR_API_KEY
-
To translate a JSON file into Spanish:
./transbuilder --file input.json --langs es --api-key YOUR_API_KEY
The translated files will be generated with the original input file name, followed by the target language code, for example: input_fr.xliff.
| Format | Extensions | Description |
|---|---|---|
| XLIFF | .xlf, .xliff |
Localization exchange file in XML |
| YAML | .yaml, .yml |
Readable text format for configuration or data |
| JSON | .json |
JSON data file |
| CSV | .csv |
Spreadsheet-like data file, each cell can be translated |
If you'd like to contribute to this project, please submit a pull request or open an issue on the GitHub repository.