{"id":29050034,"url":"https://github.com/deeplcom/java-document-translator","last_synced_at":"2025-06-26T20:38:38.606Z","repository":{"id":299085613,"uuid":"999545562","full_name":"DeepLcom/java-document-translator","owner":"DeepLcom","description":"This is a command-line Java application for translating documents using the DeepL API.","archived":false,"fork":false,"pushed_at":"2025-06-10T12:29:01.000Z","size":10,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-06-22T23:42:03.326Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/DeepLcom.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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-06-10T12:16:43.000Z","updated_at":"2025-06-11T08:10:50.000Z","dependencies_parsed_at":"2025-06-14T15:49:29.155Z","dependency_job_id":"63390dcd-8bc7-4edc-b91f-61ba5bd1e4f9","html_url":"https://github.com/DeepLcom/java-document-translator","commit_stats":null,"previous_names":["deeplcom/java-document-translator"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/DeepLcom/java-document-translator","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DeepLcom%2Fjava-document-translator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DeepLcom%2Fjava-document-translator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DeepLcom%2Fjava-document-translator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DeepLcom%2Fjava-document-translator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DeepLcom","download_url":"https://codeload.github.com/DeepLcom/java-document-translator/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DeepLcom%2Fjava-document-translator/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262142464,"owners_count":23265742,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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-06-26T20:38:35.865Z","updated_at":"2025-06-26T20:38:38.585Z","avatar_url":"https://github.com/DeepLcom.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Java Document Translator\n\nThis is a command-line Java application for translating documents using the DeepL API. It leverages the official [DeepL Java SDK (`deepl-java`)](https://github.com/DeepLcom/deepl-java) for its core translation functionalities. The application supports a variety of file types and allows users to specify an input file and a target language, automatically generating an output file with the translation.\n\n## Features\n\n*   Translate documents to various languages supported by DeepL.\n*   Auto-generates output filename (e.g., `input.txt` translated to German (`DE`) becomes `input.txt_DE`).\n*   Checks for a predefined list of supported input file extensions before attempting translation.\n*   Requires DeepL API authentication key to be set as an environment variable (`DEEPL_AUTH_KEY`).\n\n## Prerequisites\n\n*   Java Development Kit (JDK) 8 or higher.\n*   Apache Maven (for building and managing dependencies).\n*   A DeepL API Pro account (or a Free account with API access) and an authentication key.\n\n## Setup\n\n1.  **Clone the repository (or set up the project manually):**\n    ```bash\n    git clone https://github.com/DeepLcom/java-document-translator.git\n    cd java-document-translator\n    ```\n\n2.  **Set your DeepL Authentication Key:**\n    Set the `DEEPL_AUTH_KEY` environment variable to your DeepL API key.\n    ```bash\n    export DEEPL_AUTH_KEY=\"your_deepl_api_key_here\"\n    ```\n    For persistent storage, add this line to your shell's configuration file (e.g., `~/.zshrc`, `~/.bash_profile`).\n\n3.  **Build the project using Maven:**\n    This will compile the source code and download the necessary dependencies (including the `deepl-java` library).\n    ```bash\n    mvn compile\n    ```\n\n## Usage\n\nRun the application from the project's root directory using Maven:\n\n```bash\nmvn exec:java -Dexec.args=\"\u003cinputFile\u003e \u003ctargetLang\u003e\"\n```\n\n**Arguments:**\n\n*   `\u003cinputFile\u003e`: Path to the document you want to translate (e.g., `./report.docx` or `data/my_text.txt`).\n*   `\u003ctargetLang\u003e`: The target language code (e.g., `DE` for German, `FR` for French, `EN-US` for English (US), `ES` for Spanish). Refer to the [DeepL API documentation](https://www.deepl.com/docs-api/translate-text/target-language/) for a full list of supported target language codes.\n\n**Example:**\n\nTo translate a file named `mydocument.pdf` located in your Downloads folder to German:\n\n```bash\nmvn exec:java -Dexec.args=\"./mydocument.pdf DE\"\n```\n\nThe translated file will be saved in the same directory as the input file, with `_DE` appended to its name (e.g., `./mydocument.pdf_DE`).\n\n## Supported File Types (Custom Check)\n\nThe application performs a preliminary check based on the input file's extension. The following extensions and their descriptions are currently recognized by this custom check:\n\n*   `docx`: Microsoft Word Document\n*   `doc`: Microsoft Word Document\n*   `pptx`: Microsoft PowerPoint Document\n*   `xlsx`: Microsoft Excel Document\n*   `pdf`: Portable Document Format\n*   `htm`: HTML Document\n*   `html`: HTML Document\n*   `txt`: Plain Text Document\n*   `xlf`: XLIFF Document, version 2.1\n*   `xliff`: XLIFF Document, version 2.1\n*   `srt`: SubRip Subtitle file\n\n**Note:** While this application performs a preliminary extension check, the actual document translation capability and supported formats are determined by the DeepL API. Refer to the official [DeepL documentation for document translation](https://www.deepl.com/docs-api/translating-documents/) for the most up-to-date list of supported file types by the API itself.\n\n## Project Structure\n\n*   `pom.xml`: Maven project configuration, including dependencies like `deepl-java`.\n*   `src/main/java/App.java`: Main application class containing the translation logic.\n*   `src/main/java/HelloWorld.java`: A simple Hello World program.\n*   `src/main/java/Args.java`: An older version of the argument parsing logic.\n\n## License\n\nMIT\n\n## Links\n\n- [DeepL API Documentation](https://developers.deepl.com/docs)\n- [DeepL API Java SDK](https://github.com/DeepLcom/deepl-java)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdeeplcom%2Fjava-document-translator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdeeplcom%2Fjava-document-translator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdeeplcom%2Fjava-document-translator/lists"}