Skip to content

Blush/DGTranslate

Repository files navigation

DGTranslate

DGTranslate is a Windows desktop utility for fast text translation and keyboard layout conversion via global hotkeys.
The project targets users who need functionality similar to QTranslate and Punto Switcher.

Author: Dmitrii Gavrilov
Year: 2026
Location: Novi Sad, Serbia


Project Purpose

DGTranslate was built as a lightweight tool for everyday text work:

  • fast translation of selected text via Double Ctrl;
  • layout conversion of the last typed word or selected text;
  • quick switching of the active keyboard layout;

Compared to Punto Switcher, it does not continuously listen to or store the input stream in memory.

Operational details:

  • Uses global keyboard event tracking.
  • The app does not log typed characters and does not store input history in memory or elsewhere.
  • By default, the app logs errors to "%LOCALAPPDATA%\DGTranslate\logs", and in Debug configuration of the Serilog also logs key processing events and cleanup of the pressed-keys collection by TTL (characters are not recorded in this collection).
  • Double Ctrl triggers only on two separate presses with a key release in between; auto-repeat and unrelated keys are ignored.
  • Triggering a hotkey does not prevent other globally tracking applications from handling the same key event.

Key Features

Text Translation

  • Double Ctrl - translate selected text.

Layout Conversion

  • Break (Pause) - convert the layout of the last typed word.
  • Shift + Break (Pause) - convert the layout of selected text.

Keyboard Layout Switching

(The hotkey scheme can be selected in Settings.)

  • Left Ctrl - English (US)
  • Right Ctrl - Russian (RU)

Settings

Open Settings via the gear icon in the main window.

Available options:

  • enable/disable quick translate (Double Ctrl);
  • Double Ctrl delay;
  • enable/disable layout switching via hotkeys;
  • switching scheme;
  • select left/right layouts from the list installed in the system;
  • UI language (en, ru, sr, uk).

Auto-Start

The app can be minimized to the system tray.
Auto-start is enabled via the tray icon context menu.


Configuration

Files

  • appsettings.json
  • appsettings.Local.json

Translation providers

DGTranslate supports translation via multiple providers.
The default provider is Google.
The optional provider DeepL is also supported but requires an API key.

Using a Deepl translate provider

Translation uses the external API from deepl.com. How to get a key:

  • Go to https://developers.deepl.com/docs/getting-started/intro
  • Click "Create free API account" at the top right corner
  • Click "Sign up for free" in the left column of the table (you can upgrade to Pro later)
  • Fill out the form (they ask for a credit card to prevent multiple registrations; I tried it: they perform a test transaction, take EUR 1.00 and the EUR 1.00 is immediately refunded)
  • You will see the message "Your subscription is now active" and the link "Account management / Retrieve your authentication key"
  • Go to the "API keys & limits" tab and press "Create key"
  • Copy the key string and put it into appsettings.Local.json
  • The free plan limit is 500,000 characters per month
{
  "Translator": {
    "DefaultProviderName": "deepl",
    "Providers": [
      {
        "Name": "deepl",
        "Url": "https://api-free.deepl.com/v2/translate",
        "ApiKey": "YOUR_KEY_HERE"
      },
    ]
  },
}

DoubleCtrlDelayMs

Delay (in milliseconds) between two Ctrl presses that is recognized as Double Ctrl.

{
  "Keyboard": {
    "DoubleCtrlDelayMs": 500
  }
}

HKL Layout Codes

  • 00000419 - Russian
  • 00000409 - English (US)
  • 0000081A - Serbian Latin
  • 00000C1A - Serbian Cyrillic

UI Language

{
  "UI": {
    "Language": "en"
  }
}

Available values: en, ru, sr, uk.
Default is en.


AllowQuickTranslate

{
  "AllowQuickTranslate": true
}
  • true - quick translate is enabled
  • false - disabled

AllowSwitchLanguage

{
  "AllowSwitchLanguage": true
}
  • true - Ctrl-based switching is enabled
  • false - disabled

Project Status

Beta. UI and settings may change.


Requirements

  • Windows 10/11
  • .NET SDK 9.0 (for building from source)

Roadmap / Known Issues

  • More stable metrics/logging are needed to diagnose rare global hotkey issues.
  • Rare periods (up to 2s) where shortcuts do not work may occur due to missed key-release events.
  • Only Windows is supported for now (WinAPI hook and layout switching). Linux support is planned.

License

This project is licensed under the MIT License - see the LICENSE file for details.


Changelog

0.10.10

  • Fixed false triggering of translation on Ctrl auto-repeat without key release.
  • Added/updated hotkey behavior tests for Double Ctrl.
  • Fixed popup/main window behavior when showing from tray and IPC events.
  • Added detailed foreground activation diagnostics for window show requests.

0.10.9

  • Release version update in build metadata (Version, AssemblyVersion, FileVersion) without functional code changes.

0.10.8

  • Improved translation stability.
  • Fixed an error when selecting a language pair.

0.10.7

  • Fixed duplicate agent startup when launching from a pinned taskbar icon;
  • Fixed UI focus/foreground activation when triggered by hotkeys (double Ctrl).
  • Added coordinated shutdown so the UI closes together with the agent.
  • Fixed tray icon handling and embedded a proper Windows .ico
  • Fixed tray autostart menu state

0.10.6

  • Significantly improved CPU and memory consumption splitting the application into two processes: UI and agent (background).
  • Added configurable Avalonia rendering presets to lower UI CPU usage

0.10.5

  • Fixed restoration of non-text clipboard content (images, HTML, RTF, custom formats) after layout conversion.
  • Added logging errors.
  • Reduced operation delays/timeouts in conversion/capture paths to improve responsiveness.

0.10.4

  • Added build version display in the Help window.
  • Added translation provider list and Google provider.
  • Improved translator error handling with task cancellation logging.
  • Changed default logging level.
  • Updated publish script to use the renamed default branch.
  • Documentation corrections.
  • Fixed some functional bugs.

0.10.2

  • Fixed configuration Serilog when built as on file

0.10.1

  • Added Serilog file logging and configuration via appsettings.json.
  • Improved global hotkey stability with pressed-key TTL cleanup and handler error logging.
  • Localized language names via resource strings and refresh lists on UI language change.
  • Updated tests for UI localization wiring.
  • Updated documentation.

0.10.0

  • Reworked hotkey processing: trigger on key release, reset after unrelated keys.
  • Reload handlers when settings change (without restarting the app).
  • Clarified privacy logic: typed characters are not stored.
  • Added tests for hotkey processing and modifier normalization.
  • Expanded comments for keyboard hook constants.
  • Added license info (MIT).

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors