Skip to content

A native macOS app for translating text using the DeepL API with multi-key support for unlimited free translation

Notifications You must be signed in to change notification settings

marvin753/DeeplTranslator

Repository files navigation

DeepL Translator

A native macOS application that brings the power of DeepL's translation API to your desktop, with support for multiple free API keys to maximize your monthly translation quota.

Overview

DeepL Translator is a clean, efficient macOS app built with SwiftUI that lets you translate text between 36 languages using the DeepL API. Unlike the web interface, this app enables you to chain multiple free DeepL API keys together—each providing 500,000 characters per month—giving you effectively unlimited free translation.

Key Benefits:

  • More Translation for Free: Chain multiple DeepL free API keys to get 500k+ characters monthly instead of being limited to one key
  • Automatic Key Rotation: When one key hits its quota, the app automatically suggests or switches to another available key
  • Secure Storage: API keys are stored in macOS Keychain, never in plaintext
  • Real-Time Translation: See results as you type with intelligent 500ms debounce
  • Translation History: Built-in history with automatic 14-day cleanup

System Requirements

  • macOS 14.0 or later
  • Xcode command line tools

Getting Started

Prerequisites

Ensure you have Xcode command line tools installed:

xcode-select --install

Installation & Setup

  1. Clone the repository:

    git clone <repository-url>
    cd DeeplTranslator
  2. Build and launch the app:

    ./run.sh

    For a clean build:

    ./run.sh --clean

    For debug mode with verbose output:

    ./run-debug.sh
  3. First Launch - Onboarding: When you open the app for the first time, an onboarding flow will guide you through adding your first DeepL API key.

  4. Add Your First API Key:

    • Open the Settings tab (Cmd+2)
    • Go to the "API Keys" tab
    • Click "Add New Key"
    • Paste your DeepL Free API key
    • The app will verify and store it securely in Keychain

Getting a DeepL API Key

  1. Visit https://www.deepl.com/pro-api
  2. Sign up for a free account
  3. Generate a free API key (500,000 characters/month limit)
  4. Add the key to the app

You can create multiple free accounts to generate additional API keys.

Features

Translation Interface

The main window features a side-by-side layout:

  • Left panel: Source text input with language selector (auto-detect enabled by default)
  • Right panel: Translated text output with language selector
  • Real-time translation: Results appear as you type (debounced for efficiency)
  • Manual translate button: Force translation on demand
  • Bidirectional editing: Edit the translated text to reverse-translate back to the source

Multi-Key API Management

The Settings panel provides comprehensive API key management:

API Keys Tab:

  • View all registered keys with their status
  • Add new keys with verification
  • Remove inactive keys
  • See which key is currently active

Usage Tab:

  • Real-time character usage per key
  • Color-coded progress bars:
    • Green: 0-70% quota used
    • Orange: 70-95% quota used
    • Red: 95%+ quota used
  • Monthly usage reset tracking
  • Current month's remaining quota

Automatic Key Switching:

  • When a key reaches its quota limit, the app alerts you
  • You'll be prompted to switch to another key with available quota
  • Or manually select a different key from the Settings

Translation History

Access your translation history via the Inspector sidebar (Cmd+Option+S):

  • View previous translations with timestamps
  • Search through history
  • Automatic cleanup of entries older than 14 days
  • Quick access to commonly translated phrases

Inspector Sidebar

Toggle the Inspector sidebar with Cmd+Option+S to access:

  • Translator (Cmd+1): Main translation interface
  • Settings (Cmd+2): API keys, usage stats, and preferences
  • History (Cmd+3): Previous translations

Supported Languages

The app supports translation to and from these 36 languages:

Arabic, Bulgarian, Czech, Danish, German, Greek, English (US), English (GB), Spanish, Spanish (Latin America), Estonian, Finnish, French, Hungarian, Indonesian, Italian, Japanese, Korean, Lithuanian, Latvian, Norwegian, Dutch, Polish, Portuguese (Brazil), Portuguese (Portugal), Romanian, Russian, Slovak, Slovenian, Swedish, Turkish, Ukrainian, Chinese (Simplified), Chinese (Traditional)

Keyboard Shortcuts

Shortcut Action
Cmd+Option+S Toggle Inspector/Sidebar
Cmd+1 Open Translator tab
Cmd+2 Open Settings tab
Cmd+3 Open History tab

Architecture & Technical Details

  • Language: Swift + SwiftUI
  • Minimum macOS: 14.0+
  • API Client: Actor-based for thread safety
  • State Management: Combine framework with reactive architecture
  • Design Pattern: MVVM with AppState singleton
  • Security: Keychain integration for secure key storage

Security

  • API Keys: Stored securely in macOS Keychain with device-lock protection
  • No Plaintext Logging: Keys are never logged to console or stored in UserDefaults
  • Secure Communication: All API calls use HTTPS
  • UUID References: Internal metadata uses UUIDs rather than actual API keys

Development

Build Commands

# Standard build and launch
./run.sh

# Clean build and launch
./run.sh --clean

# Debug mode with verbose output
./run-debug.sh

Project Structure

  • Source code: Located in the Xcode project
  • Scripts: Shell scripts in project root for building and running

Tips for Maximum Free Translation

  1. Create Multiple Free Accounts: Each free DeepL account gives 500k characters/month
  2. Register Multiple Keys: Add 2-3 API keys to the app for 1-1.5M characters monthly
  3. Monitor Usage: Check the Usage tab in Settings to track consumption across keys
  4. Let Automatic Switching Help: The app will guide you to switch keys before running out of quota

Troubleshooting

App won't build:

  • Ensure Xcode command line tools are installed: xcode-select --install
  • Try a clean build: ./run.sh --clean

Translation not working:

  • Verify your API key in Settings > API Keys
  • Check that your key's quota hasn't been exceeded (Settings > Usage)
  • Ensure you have an internet connection

API Key not accepted:

  • Double-check the key is copied without extra spaces
  • Verify it's a valid free API key from https://www.deepl.com/pro-api
  • The app will show an error message if the key is invalid

License

[Specify license here if applicable]

Contributing

[Specify contribution guidelines if applicable]

About

A native macOS app for translating text using the DeepL API with multi-key support for unlimited free translation

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •