Skip to content

naraesk/krunner-translator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

165 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Translator for KDE KRunner (Plasma 6)

Screenshot Runner

This is a plugin for Plasma 6 KRunner. It's a translator and it translates text. Currently Google Translate, Bing Translator, youdao, and Baidu Fanyi are supported. By clicking on the corresponding icon, the translation can be copied or read aloud.

Packages

Logo Arch Linux

Pre-built packages for recent distro releases (ubuntu, debian, fedora, opensuse) are available on the GitHub Releases page.

Install Packages

translate-shell is required for the default key-less Google engine, Bing, and audio playback.

Ubuntu 25.04+

translate-shell is packaged in Ubuntu multiverse. Ubuntu usually enables this by default, but enabling it explicitly keeps package installs reliable:

sudo add-apt-repository multiverse
sudo apt update
sudo apt install ./krunner-translator-ubuntu-amd64.deb

Replace the file name with the package you downloaded from the release page.

Debian trixie

The plugin package installs directly, but translate-shell is only available from Debian contrib, which is not enabled in stock sources. If you want Google/Bing/audio support, enable contrib first and then install the package:

sudo editor /etc/apt/sources.list.d/debian.sources

Add contrib to each Components: line, then run:

sudo apt update
sudo apt install ./krunner-translator-debian-amd64.deb

See the Debian sources format reference for the exact file structure: https://wiki.debian.org/SourcesList

Fedora 42

sudo dnf install ./krunner-translator-fedora-amd64.rpm

openSUSE Tumbleweed

sudo zypper install ./krunner-translator-opensuse-amd64.rpm

Replace the file names above with the package matching your distro and architecture.

Building from source

  1. Clone this repo, cd into it, and run ./install.sh
  2. To uninstall, run ./uninstall.sh

OR, if you prefer to build manually,

  1. Install the dependencies listed below
  2. Clone this repo, cd into it, and run
cmake -B build
cmake --build build --parallel --config Release
sudo cmake --install build --config Release
killall -q krunner  # or systemctl --user restart plasma-krunner
  1. To uninstall, run
sudo cmake --build build --target uninstall
killall -q krunner  # or systemctl --user restart plasma-krunner

Ubuntu Dependencies

Note: Requires Ubuntu 25.04 (Plucky) or newer.

translate-shell build-essential cmake extra-cmake-modules qt6-base-dev libkf6runner-dev libkf6i18n-dev libkf6coreaddons-dev libkf6config-dev libkf6configwidgets-dev libkf6kcmutils-dev

Fedora/openSUSE Dependencies

translate-shell cmake extra-cmake-modules cmake(Qt6Core) cmake(Qt6Gui) cmake(Qt6Widgets) cmake(Qt6Network) cmake(KF6Runner) cmake(KF6I18n) cmake(KF6CoreAddons) cmake(KF6Config) cmake(KF6ConfigWidgets) cmake(KF6KCMUtils)

Configuration

For being able to use Youdao and Baidu, an API key is required. You have to obtain a key yourself by following these steps:

Youdao

  1. Register at https://ai.youdao.com/
  2. Get an API key and an API secret from Application Manager
  3. Copy the key to configuration dialog

Baidu

  1. Register at http://api.fanyi.baidu.com/
  2. Get an API key and an API secret from Consoles
  3. Copy the key to configuration dialog

Usage

A list of all language codes you can find here.

Specify source and target language

Syntax: <sourcelang>-<targetlang> <searchterm>

en-de house will translate house into german (de)

Use default source language

Syntax: <targetlang> <searchterm>

Default source language: English (en) Alternative source language: German (de)

de socceren-de soccer en blaude-en blau fr houseen-fr house