Skip to content

glaumar/PopTranslate

Repository files navigation

简体中文

PopTranslate

PopTranslate is a translator running under wayland, which can translate the text selected by the mouse and display the result in a pop-up window (only Plasma Wayland is currently supported)

Why write yet another translator?

GoldenDict, Crow Translate and other translation software are very useful, but due to the wayland protocol restrictions, they cannot register global shortcut keys, and cannot read the clipboard and mouse position in the background (resulting in the inability to pop up a window near the mouse and translate)

Screenshots

Global Shortcuts

Meta + G to translate the text selected by the mouse

Meta + Ctrl + G recognizes and translates the text in the screenshot

Installation

Arch Linux (AUR)

paru -S poptranslate

Other (Flatpak)

Get flatpak package from release page

Dependencies

Flatpak Runtime and SDK

  • org.kde.Platform = "5.15-22.08"
  • org.kde.Sdk = "5.15-22.08"

Build

CMake

Build

cmake -B build -DCMAKE_INSTALL_PREFIX=/usr
cmake --build build --target poptranslate

Generate deb package

cd build && cpack -C CPackConfig.cmake

Flatpak

Install runtime and sdk

flatpak install org.kde.Platform/x86_64/5.15-22.08
flatpak install org.kde.Sdk/x86_64/5.15-22.08

Build

flatpak-builder build_flatpak  io.github.glaumar.PopTranslate.yml --force-clean

Generate flatpak package

flatpak build-export export build_flatpak

flatpak build-bundle export PopTranslate.flatpak io.github.glaumar.PopTranslate --runtime-repo=https://flathub.org/repo/flathub.flatpakrepo

Generate pacman package

git clone https://[email protected]/poptranslate.git 
cd poptranslate && makepkg -s