doc: updates

* use repology.org to replace manually created linux package list [0]
* update debian/ubuntu dependencies (delete outdated fedora one)
* update all build doc to qt6
* add cmake flags info
* merge all build instructions into one
* add more ocr examples
* add links and fix dictionary formats info
* misc
This commit is contained in:
shenleban tongying 2023-07-05 22:20:43 -04:00
parent 223d945f95
commit 65ebdf0e4c
No known key found for this signature in database
18 changed files with 348 additions and 373 deletions

View file

@ -227,7 +227,7 @@ jobs:
Linux users can use AppImages.
macOs users can use `.dmg` installer.
macOS users can use `.dmg` installer.
`6.5.1-GoldenDict.exe_windows-2019_20230701.zip` means built with Qt6.5.1, windows/msvc-2019 at 20230701 as a zip archive.

View file

@ -226,7 +226,7 @@ jobs:
Linux users can use AppImages.
macOs users can use `.dmg` installer.
macOS users can use `.dmg` installer.
`6.5.1-GoldenDict.exe_windows-2019_20230701.zip` means built with Qt6.5.1, windows/msvc-2019 at 20230701 as a zip archive.

View file

@ -203,7 +203,7 @@ jobs:
Linux users can use AppImages.
macOs users can use `.dmg` installer.
macOS users can use `.dmg` installer.
`6.5.1-GoldenDict.exe_windows-2019_20230701.zip` means built with Qt6.5.1, windows/msvc-2019 at 20230701 as a zip archive.

View file

@ -185,7 +185,7 @@ jobs:
Linux users can use AppImages.
macOs users can use `.dmg` installer.
macOS users can use `.dmg` installer.
`6.5.1-GoldenDict.exe_windows-2019_20230701.zip` means built with Qt6.5.1, windows/msvc-2019 at 20230701 as a zip archive.

View file

@ -257,7 +257,7 @@ jobs:
Linux users can use AppImages.
macOs users can use `.dmg` installer.
macOS users can use `.dmg` installer.
`6.5.1-GoldenDict.exe_windows-2019_20230701.zip` means built with Qt6.5.1, windows/msvc-2019 at 20230701 as a zip archive.

View file

@ -229,7 +229,7 @@ jobs:
Linux users can use AppImages.
macOs users can use `.dmg` installer.
macOS users can use `.dmg` installer.
`6.5.1-GoldenDict.exe_windows-2019_20230701.zip` means built with Qt6.5.1, windows/msvc-2019 at 20230701 as a zip archive.

View file

@ -1,6 +1,5 @@
cmake_minimum_required(VERSION 3.25) # ubuntu 23.04 Fedora 36
# Experimental Cmake build only supposed to be used by dev
# Qt6.4+ only
option(WITH_FFMPEG_PLAYER "Enable support for FFMPEG player" ON)

201
README.md
View file

@ -29,36 +29,7 @@ dictionaries.
## Installation
### Downloads
* [Latest stable version](https://github.com/xiaoyifang/goldendict/releases/latest)
* [Daily pre-release builds](https://github.com/xiaoyifang/goldendict/releases).
Both Qt5 and Qt6 builds are provided.
## Windows
Choose either
* `****-installer.exe ` for traditional installer experience
* `****.zip` for simply unzip and run experience
If Qt's version is not changed, you can also download a single `goldendict.exe` and drop it into previous installation's folder.
## Linux
* `.Appimage` can be used in any recent linux distros.
* [Debian packages](https://tracker.debian.org/pkg/goldendict-webengine) are available in Debian 12 or later.
* [Ubuntu packages](https://launchpad.net/ubuntu/+source/goldendict-webengine) are available in Ubuntu 23.04 or later.
* Archlinux can use [goldendict-ng-git](https://aur.archlinux.org/packages/goldendict-ng-git). Built binary is also availiable from [archlinuxcn's repo](https://github.com/archlinuxcn/repo/tree/master/archlinuxcn/goldendict-ng-git).
* [Gentoo package from PG_Overlay](https://gitlab.com/Perfect_Gentleman/PG_Overlay/-/blob/master/app-text/goldendict/goldendict-9999-r6.ebuild)
* openSUSE ships an old version of this fork.
> Help wanted to package this GoldenDict for linux distros.
## macOS
One of the `.dmg` installers.
<https://xiaoyifang.github.io/goldendict-ng/install/>
## Help GoldenDict's Development
@ -72,174 +43,7 @@ To start development, check out [developer guide](https://xiaoyifang.github.io/g
## Build from source
### Dependencies
* C++17 compiler
* Qt 5.15 or latest QT version 6.X
* Various libraries on Linux, see below
* On Mac and Windows all the libraries are included in the repository
* Qt Creator is recommended for development
Steps below are using qt5, and you may use qt6 by replacing `5` with `6`.
#### Ubuntu
```
sudo apt-get install git pkg-config build-essential qt5-qmake \
libvorbis-dev zlib1g-dev libhunspell-dev x11proto-record-dev \
libxtst-dev liblzo2-dev libbz2-dev \
libavutil-dev libavformat-dev libeb16-dev \
libqt5svg5-dev libqt5x11extras5-dev qttools5-dev \
qttools5-dev-tools qtmultimedia5-dev libqt5multimedia5-plugins libqt5webchannel5-dev qtwebengine5-dev \
libqt5texttospeech5-dev
```
#### Fedora 35
```
sudo dnf install git pkg-config libzstd-devel opencc-devel xz-devel xz-lzma-compat\
libvorbis-devel zlib-devel hunspell-devel lzo-devel bzip2-devel \
ffmpeg-devel eb-devel qt5-qtx11extras-devel libXtst-devel \
libxkbcommon-devel qt5-qtbase qt5-qttools qt5-qtsvg-devl qt5-qtwebengine-devel qt5-qtmultimedia-devel
```
### Build steps
Clone this repository:
```
git clone https://github.com/xiaoyifang/goldendict-ng.git
```
#### Linux build
```
cd goldendict-ng && qmake-qt5 && make
```
#### macOS build
```
brew install qt # or use official offline installer
qmake CONFIG+=release CONFIG+=zim_support CONFIG+=chinese_conversion_support QMAKE_APPLE_DEVICE_ARCHS="x86_64 arm64"
make
make install
```
#### Windows build
the source code has offered precompile x64 windows libs on winlibs/lib/msvc. you can build your own version either.
To build with Visual Studio.
check this [how to build with visual studio](howto/how%20to%20build%20and%20debug%20with%20VS2019.md)
Alternatively, you might want to load `goldendict.pro` file from within Qt Creator.
### Build Configurations
**Notice**: All additional configs for `qmake` that must be combined in one of pass config options to `qmake`:
```
qmake-qt5 "CONFIG+=release" "CONFIG+=zim_support" "CONFIG+=chinese_conversion_support"
```
To ensure the changes applied, you may want to use `make clean` before `make`.
#### Building with Chinese conversion support
To add Chinese conversion support you need at first install libopencc-dev package, then pass `"CONFIG+=chinese_conversion_support"` to `qmake`.
```
sudo apt-get install libopencc-dev
```
#### Building with Zim dictionaries support
To add Zim and Slob formats support you need at first install lzma-dev and zstd-dev packages, then pass `"CONFIG+=zim_support"` to `qmake`
```
sudo apt-get install liblzma-dev libzstd-dev libzim-dev
```
**Note**: Some linux distros do not support latest zim version, so you need to compile from latest source.
On Windows, you can use vcpkg to compile the libzim
```
vcpkg install libzim:x64-windows
```
and copy the corresponding(debug/release) library to the `winlibs/lib` folder. the zim's `include` directory to the `winlibs/include` directory.
#### Building without Epwing format support
If you have problem building with libeb-dev package, you can pass
`"CONFIG+=no_epwing_support"` to `qmake` in order to disable Epwing format support
#### Building without internal audio players
If you have problem building with FFmpeg (for example, very old linux distro), you can pass
`"CONFIG+=no_ffmpeg_player"` to `qmake` in order to disable FFmpeg internal audio player back end.
If you have problem building with Qt5 Multimedia or experience GStreamer run-time errors (for example, Ubuntu 14.04), you can pass
`"CONFIG+=no_qtmultimedia_player"` to `qmake` in order to disable Qt Multimedia internal audio player back end.
#### Building with xapian
build xapian from source, download and extract the xapian-core source code.
```
./configure
make
make install
```
On Windows, `vcpkg install xapian:x64-windows` and copy the libs/dlls into the `winlibs`
A precompiled version of xapian lib has provided in winlibs.
On Linux, install libxapian-dev package using package manager.
On Mac, use homebrew to install xapian `brew install xapian`
Goldendict-ng has used xapian as the default and the only one fulltext engine.
#### use iconv (recommend to enable)
use `CONFIG+=use_iconv` to enable this feature. when enabled ,iconv will be used to convert encoding other than the QTextCodec(which will be deprecated in future Qt version)
```
qmake "CONFIG+=use_iconv"
```
when enabled ,iconv should be installed on the platform at the same time.
#### use breakpad
use `CONFIG+=use_breakpad` to enable this crash dump. when enabled [breakpad](https://chromium.googlesource.com/breakpad/breakpad/+/master/docs), goldendict will generate a crash dump alongside with Goldendict in the `crash` directory.
on Windows:
`vcpkg install breakpad:x64-windows-release` and copy the installed packages into `thirdparty/breakpad` directory.
with a structure like this:
```
├─breakpad
│ ├─include
│ │ ├─client
│ │ │ └─windows
│ │ │ ├─common
│ │ │ ├─crash_generation
│ │ │ ├─handler
│ │ │ └─sender
│ │ ├─common
│ │ │ └─windows
│ │ └─google_breakpad
│ │ ├─common
│ │ └─processor
│ └─lib
```
on Mac/Linux:
[vcpkg](https://techviewleo.com/install-vcpkg-c-library-manager-on-linux-macos-windows/) can also be used or you can just install breakpad from source or use precompiled packages.
Then enable google breakpad like this with qmake:
```
qmake "CONFIG+=use_breakpad"
```
<https://xiaoyifang.github.io/goldendict-ng/howto/build_from_source/>
## Support
@ -247,6 +51,7 @@ Bug reporting: [GoldenDict issue tracker](https://github.com/xiaoyifang/goldendi
General discussions: [discussions](https://github.com/xiaoyifang/goldendict-ng/discussions)
## License
This project is licensed under the <b>GNU GPLv3+</b> license, a copy of which can be found in the `LICENSE.txt` file.

View file

@ -4,12 +4,10 @@ If you know some C++ and optionally some Qt, you can start to modify GoldenDict
* Install Qt and QtCreator
* (On Linux, install dependencies)
* Load `goldendict.pro`
* Load `goldendict.pro` or `CMakeLists.txt`
* Modify some code
* Hit the `Run`.
A CMake build script is also provided `CMakeLists.txt` is provided which can be used directly in other IDEs like CLion or Visual Studio 2022.
## Coding Standards
Please follow [C++ Core Guidelines](https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines) and write modern C++ code.

View file

@ -2,21 +2,22 @@ Popular dictionary formats are all supported.
## Local Dictionaries Sources
* MDict dictionaries (.mdx/.mdd)
* StarDict dictionaries (.ifo/.dict./.idx/.syn)
* DSL dictionaries (ABBYY Lingvo source files .dsl(.dz))
* [MDict](https://www.mdict.cn/) dictionaries (.mdx/.mdd)
* [StarDict](http://www.huzheng.org/stardict/) dictionaries (.ifo/.dict./.idx/.syn)
* [DSL](https://lingvoboard.ru/store/html/DSLReference_HTML/index.html) dictionaries (ABBYY Lingvo source files .dsl(.dz))
* [Xdxf](https://github.com/soshial/xdxf_makedict) dictionaries (.xdxf(.dz))
* [Zim](https://wiki.openzim.org/wiki/OpenZIM) dictionaries (.zim)
* [Slob (Aard 2)](https://aarddict.org/) dictionaries (.slob)
* DictD dictionaries (.index/.dict(.dz))
* Epwing dictionaries
* Babylon dictionaries (.BGL), complete with images and resources
* Aard Dictionary dictionaries (.aar)
* [DictD](https://en.wikipedia.org/wiki/DICT#Dict_file_format) dictionaries (.index/.dict(.dz))
* [Epwing](<https://ja.wikipedia.org/wiki/EPWING>) dictionaries
* Aard Dictionary dictionaries, outdated predecessor of Slob (.aar)
* [SDictionary](http://swaj.net/sdict/index.html) dictionaries (.dct)
* Babylon source files (.gls(.dz))
* [Babylon glossary builder](https://www.babylon-software.com/glossary-builder/) source files (.gls(.dz))
* Babylon dictionaries, complete support with images and resources (.BGL)
* ABBYY Lingvo sound archives (.lsa/.dat)
* Sound files in separate folders
* Zips sound packs (.zips)
* Sound files in separate folders. File names are used as word
* Zipped sound pack. Sound files zipped, but with extension changed from .zip to (.zips)
## Network Sources
@ -27,8 +28,24 @@ Popular dictionary formats are all supported.
## Other Sources
* Programs: Any External programs that can output text
* System Text-to-speech engines
**Programs**
Any external apps can be added by setting a launch command. The `%GDWORD%` will be replaced by word from search line. If command line don't contains such template the word will be fed into standard input stream in 8-bit current locale encoding.
| Type | Notes |
|--|--|
| Audio| Application play sound. A sound icon will be provided as article, click it will trigger the program. |
| Text | Application output some plain text in 8-bit current locale encoding into standard output stream. This text will be shown as separate article. |
| Html | Application output some html code into standard output stream. This code will be shown as separate article. |
| Prefix | Application output some word list into standard output stream. This list will be added in common matches list.|
**System Text-to-speech engines**
Its capability is provided via Qt Speech.
On Windows & macOS, the system provides sounds.
On Linux, speech-dispatcher and flite are the backends.
## Additional info

View file

@ -1,75 +0,0 @@
# Current Situation
GoldenDict did offer a functionality to translate the word under cursor(when scan popup been enabled) on Windows.
the technique used there is old and can not work crossplatform .
with the help of another great tool [Capture2Text](https://sourceforge.net/projects/capture2text/) ,GoldenDict can work with ocr seamlessly.
# Note
Capture2Text has offered Windows precompiled executable files.I have ported it to Linux https://github.com/xiaoyifang/Capture2Text
Thanks to:
- [Capture2Text Linux Port](https://github.com/GSam/Capture2Text )
- [another on nixos](https://github.com/sikmir/nur-packages/blob/7c876e3fb20160781207a8f652fb052647e6da0d/pkgs/misc/capture2text/default.nix) from [sikmir](https://github.com/goldendict/goldendict/issues/1445#issuecomment-1022972220)
# Download release or compile by yourself
https://github.com/xiaoyifang/Capture2Text/releases
# Configuration on Windows
after installation of both software.
configure the Capture2Text ,see screenshots below.
## configure external `Call Executable` path (Windows for example)
`path\GoldenDict.exe "${capture}"`
![image](https://user-images.githubusercontent.com/105986/151507994-97ab732d-686a-47b1-b950-3b2db076ef4c.png)
## configure hotkey
I only left three of them .
![image](https://user-images.githubusercontent.com/105986/151481239-16cbb733-746c-425d-bc6c-2bb5e5a158c5.png)
## configure `First word only`
without this configuration ,it will capture the last word of
![image](https://user-images.githubusercontent.com/105986/151481312-4e9bc457-6667-4e80-95bd-6f2ad58c37e1.png)
## Use it
place the cursor on the word (can be on the image ),press
- Win+W to capture the first word.
![image](https://user-images.githubusercontent.com/105986/151481735-6c1c7fc1-715f-4f5c-a98c-7452099b9709.png)
- Win+Q select rectangle.
![image](https://user-images.githubusercontent.com/105986/151489148-6fb09787-8d27-4c55-92bb-b385e23ed859.png)
result:
![image](https://user-images.githubusercontent.com/105986/151489807-71231884-75bf-45e7-9bfa-b5242be1b189.png)
## use Capture2Text on Linxu
### download and build the capture2text
https://github.com/xiaoyifang/Capture2Text
![2022-01-30 15-54-35屏幕截图](https://user-images.githubusercontent.com/105986/151691526-f28cc053-f6e0-4099-b677-f7a4657aa9fc.png)
### settings
![2022-01-30 15-54-35屏幕截图1](https://user-images.githubusercontent.com/105986/151691583-eda3e059-a77f-4476-a5a5-18d34463005e.png)
![image](https://user-images.githubusercontent.com/105986/151694194-7f0048fc-5649-46b3-940f-d4d5d10968b7.png)
### start capture
`Ctrl+Shift+Q`
![image](https://user-images.githubusercontent.com/105986/151691692-955caf26-e828-4ffe-a630-b17b66b8a955.png)
### end capture
press `Ctrl+Shift+Q` again.

View file

@ -0,0 +1,217 @@
## Dependencies
* C++17 compiler
* Latest QT6
* Various libraries for Linux & macOS, see below
* On Windows all the libraries are included in the repository
For debian/ubuntu, those packages are needed
```shell
libavformat-dev libavutil-dev libbz2-dev libeb16-dev libhunspell-dev \
liblzma-dev liblzo2-dev libopencc-dev libvorbis-dev \
libx11-dev libxtst-dev libzim-dev libzstd-dev qt6-5compat-dev \
qt6-base-dev qt6-multimedia-dev qt6-speech-dev qt6-svg-dev \
qt6-tools-dev qt6-tools-dev-tools qt6-webchannel-dev \
qt6-webengine-dev x11proto-record-dev zlib1g-dev
```
In other words, those libraries
* Qt6 (with webengine)
* ffmpeg
* libzim
* xapian
* hunspell
* opencc
* libeb
* libvorbis
* x11 (linux only)
And a few compression libraries:
* xz (lzma)
* bzip2
* lzo2
* zlib
* zstd
## CMake Build
```shell
cd goldendict-ng && mkdir build_dir
# config step
cmake -S . -B build_dir \
--install-prefix=/usr/local/ \
-DCMAKE_BUILD_TYPE=Release
# actual build
cmake --build build_dir --parallel 7
cmake --install ./build_dir/
```
### Feature flags
Append `-D{flag_names}=ON/OFF` to cmake's config step
Available flags:
* `WITH_FFMPEG_PLAYER` "Enable support for FFMPEG player"
* `WITH_EPWING_SUPPORT` "Enable epwing support"
* `WITH_XAPIAN` "enable Xapian support"
* `WITH_ZIM` "enable zim support"
* `USE_SYSTEM_FMT` "use system fmt instead of bundled one"
* `USE_SYSTEM_TOML` "use system toml++ instead of bundled one"
### Windows
Install Qt6(msvc) through the standard installer
Pass those parameters to cmake, the path should be changed to your actual installation paths
```
-DCMAKE_PREFIX_PATH=F:\Qt\6.4.1\msvc2019_64
```
Use`windeployqt.exe {your_build_dir}/goldendict.exe` which will copy the qt related `.dll` and other necessary files automatically.
Due to the `winlibs` are built on Release mode, there are troubles to build GoldenDict on Debug mode.
### macOS
Similar to Linux build, but need `macdeployqt ./goldendict.app` to copy necessary dependencies to the app bundle.
## Qmake
```shell
git clone https://github.com/xiaoyifang/goldendict-ng.git
```
### Build Steps
**Notice**: All additional configs for `qmake` that must be combined in one of pass config options to `qmake`:
```shell
qmake6 "CONFIG+=release"
make
```
For ARM macOS, `QMAKE_APPLE_DEVICE_ARCHS="arm64"` should be passed to qmake.
#### Building with Chinese conversion support
To add Chinese conversion support you need at first install libopencc-dev package, then pass `"CONFIG+=chinese_conversion_support"` to `qmake`.
```
sudo apt-get install libopencc-dev
```
#### Building with Zim dictionaries support
To add Zim and Slob formats support you need at first install lzma-dev and zstd-dev packages, then pass `"CONFIG+=zim_support"` to `qmake`
```
sudo apt-get install liblzma-dev libzstd-dev libzim-dev
```
**Note**: Some linux distros do not support latest zim version, so you need to compile from latest source.
On Windows, you can use vcpkg to compile the libzim
```
vcpkg install libzim:x64-windows
```
and copy the corresponding(debug/release) library to the `winlibs/lib` folder. the zim's `include` directory to the `winlibs/include` directory.
#### Building without Epwing format support
If you have problem building with libeb-dev package, you can pass
`"CONFIG+=no_epwing_support"` to `qmake` in order to disable Epwing format support
#### Building without internal audio players
If you have problem building with FFmpeg (for example, very old linux distro), you can pass
`"CONFIG+=no_ffmpeg_player"` to `qmake` in order to disable FFmpeg internal audio player back end.
If you have problem building with Qt5 Multimedia or experience GStreamer run-time errors (for example, Ubuntu 14.04), you can pass
`"CONFIG+=no_qtmultimedia_player"` to `qmake` in order to disable Qt Multimedia internal audio player back end.
#### Building with xapian
build xapian from source, download and extract the xapian-core source code.
```
./configure
make
make install
```
On Windows, `vcpkg install xapian:x64-windows` and copy the libs/dlls into the `winlibs`
A precompiled version of xapian lib has provided in winlibs.
On Linux, install libxapian-dev package using package manager.
On Mac, use homebrew to install xapian `brew install xapian`
Goldendict-ng has used xapian as the default and the only one fulltext engine.
#### use iconv (recommend to enable)
use `CONFIG+=use_iconv` to enable this feature. when enabled ,iconv will be used to convert encoding other than the QTextCodec(which will be deprecated in future Qt version)
```
qmake "CONFIG+=use_iconv"
```
when enabled ,iconv should be installed on the platform at the same time.
#### use breakpad
use `CONFIG+=use_breakpad` to enable this crash dump. when enabled [breakpad](https://chromium.googlesource.com/breakpad/breakpad/+/master/docs), goldendict will generate a crash dump alongside with Goldendict in the `crash` directory.
on Windows:
`vcpkg install breakpad:x64-windows-release` and copy the installed packages into `thirdparty/breakpad` directory.
with a structure like this:
```
├─breakpad
│ ├─include
│ │ ├─client
│ │ │ └─windows
│ │ │ ├─common
│ │ │ ├─crash_generation
│ │ │ ├─handler
│ │ │ └─sender
│ │ ├─common
│ │ │ └─windows
│ │ └─google_breakpad
│ │ ├─common
│ │ └─processor
│ └─lib
```
on Mac/Linux:
[vcpkg](https://techviewleo.com/install-vcpkg-c-library-manager-on-linux-macos-windows/) can also be used or you can just install breakpad from source or use precompiled packages.
Then enable google breakpad like this with qmake:
```
qmake "CONFIG+=use_breakpad"
```
### Build with VS2019
Install `QT tool for VS` from VS extension
#### steps:
- configure qt path
toolbar Extensions=>Qt VS Tools=>Options=>versions.
add qt installation folder
- Open pro project file directly throughttoolbar Extensions=>Qt VS Tools=>Open Qt Project file(.pro)
ref:
[1](https://blog.csdn.net/qq_43493715/article/details/109839046)
#### build
after successfully build,in the target folder(where goldendict.exe resides) ,run windeployqt which copy all the necessary files to this folder.
and copy other missing dlls to this folder. you can click the exe to verify the application can run .
after alll this ,you can debug the application normally.

View file

@ -1,26 +0,0 @@
# prerequisite:
+ [VS2019 ](https://visualstudio.microsoft.com/zh-hans/vs/)
- QT
- QT tool for VS(installed from VS extension)
# steps:
- configure qt path
toolbar Extensions=>Qt VS Tools=>Options=>versions.
add qt installation folder
- Open pro project file directly throughttoolbar Extensions=>Qt VS Tools=>Open Qt Project file(.pro)
ref:
[1](https://blog.csdn.net/qq_43493715/article/details/109839046)
# build
# debug
after successfully build,in the target folder(where goldendict.exe resides) ,run windeployqt which copy all the necessary files to this folder.
and copy other missing dlls to this folder. you can click the exe to verify the application can run .
after alll this ,you can debug the application normally.

View file

@ -1,38 +0,0 @@
# Linux
```shell
cmake -S . -B build_dir \
--install-prefix=/usr/local/ \
-G Ninja \
-DCMAKE_BUILD_TYPE=Release
cmake --build build_dir --parallel 7
cmake --install ./build_dir/
```
# macOS
Install necessary dependencies
```shell
brew install pkg-config qt@6 bzip2 zlib \
hunspell opencc libvorbis ffmpeg
```
Use standard CMake build commands, then use `macdeployqt ./goldendict.app` to copy necessary dependencies to the app bundle.
# Windows
## Steps
Install Qt6(msvc) through the standard installer
Pass those parameters to cmake, the path should be changed to your actual installation paths
```
-DCMAKE_PREFIX_PATH=F:\Qt\6.4.1\msvc2019_64
```
Use`windeployqt.exe {your_build_dir}/goldendict.exe` which will copy the qt related `.dll` and other necessary files automatically.
Due to the `winlibs` are built on Release mode, there are troubles to build GoldenDict on Debug mode.

80
website/docs/howto/ocr.md Normal file
View file

@ -0,0 +1,80 @@
## Current Situation
GoldenDict offered a functionality to translate the word under cursor on Windows in the past, but the technique used there is old and does not work crossplatformly.
However, any OCR program that allow you to set "after capturing action" can be easily used in conjunction with GoldenDict.
A few examples are provided below, but there are many options:
## Capture2Text
Capture2Text can call executable after capturing, and you can set the executable to GoldenDict.
Detailed usage document: [Capture2Text](https://capture2text.sourceforge.net/)
For example, change the Output action `Call Executable` to `path_to_the_GD_executable\GoldenDict.exe "${capture}"`
Then press <kbd>Win+Q</kbd> and select a region. After capturing a word, Capture2Text will forward the word to GoldenDict. If GoldenDict's scanpopup is enabled, it will show up.
![image](https://user-images.githubusercontent.com/105986/151507994-97ab732d-686a-47b1-b950-3b2db076ef4c.png)
The hotkeys can be configured:
![image](https://user-images.githubusercontent.com/105986/151481239-16cbb733-746c-425d-bc6c-2bb5e5a158c5.png)
Capture2Text can also obtain word near cursor without selecting a region via the "Forward Text Line Capture" by pressing <kdb> Win+W </kbd>
you may want to enable "First word only" so that only a single word would be captured
![image](https://user-images.githubusercontent.com/105986/151481312-4e9bc457-6667-4e80-95bd-6f2ad58c37e1.png)
### Use Capture2Text on Linux
Capture2Text does not have Linux version, but I have ported it to Linux <https://github.com/xiaoyifang/Capture2Text> thanks to [Capture2Text Linux Port](https://github.com/GSam/Capture2Text ) and
[sikmir](https://github.com/goldendict/goldendict/issues/1445#issuecomment-1022972220).
![2022-01-30 15-54-35屏幕截图](https://user-images.githubusercontent.com/105986/151691526-f28cc053-f6e0-4099-b677-f7a4657aa9fc.png)
## Shortcuts.app & Apple's OCR
Enable the Clipboard monitoring of GoldenDict, then create a "Shorcut" that will interactively take screnshot and change the clipboard.
![image](https://github.com/xiaoyifang/goldendict-ng/assets/20123683/3933141b-9f06-4829-8135-c69514111971)
You may also add additional capiblities like only getting the first word
![image](https://github.com/xiaoyifang/goldendict-ng/assets/20123683/d8eab075-1c4b-4e82-9515-eafd9df75489)
## Tesseract via command line
On Linux, you can combine command line screenshot then pass the output image to Tesseract then pass the text result to `goldendict`
Example with spectacle (KDE) and grim (wayland/wlroots)
```
#!/usr/bin/env bash
set -e
case $DESKTOP_SESSION in
sway)
grim -g "$(slurp)" /tmp/tmp.just_random_name.png
;;
plasmawayland | plasma)
spectacle --region --nonotify --background \
--output /tmp/tmp.just_random_name.png
;;
*)
echo "Failed to know desktop type"
exit 1
;;
esac
# note that tesseract will apppend .txt to output file
tesseract /tmp/tmp.just_random_name.png /tmp/tmp.just_random_name --oem 1 -l eng
goldendict "$(cat /tmp/tmp.just_random_name.txt)"
rm /tmp/tmp.just_random_name.png
rm /tmp/tmp.just_random_name.txt
```

View file

@ -1,3 +0,0 @@
暂时没有中文文档 😅
如果想翻译文档,请到 github 上开个 issue 讨论一下:)

View file

@ -1,3 +1,7 @@
<a href="https://repology.org/project/goldendict-ng/versions">
<img src="https://repology.org/badge/vertical-allrepos/goldendict-ng.svg" alt="Packaging status" align="right">
</a>
## Download
* [Latest stable version](https://github.com/xiaoyifang/goldendict/releases/latest)
@ -5,6 +9,7 @@
Both Qt5 and Qt6 builds are provided.
## Windows
Choose either
@ -17,13 +22,10 @@ If Qt's version is not changed, you can also download a single `goldendict.exe`
## Linux
* `.Appimage` can be used in any recent linux distros.
* [Debian packages](https://tracker.debian.org/pkg/goldendict-webengine) are available in Debian 12 or later.
* [Ubuntu packages](https://launchpad.net/ubuntu/+source/goldendict-webengine) are available in Ubuntu 23.04 or later.
* Archlinux can use [goldendict-ng-git](https://aur.archlinux.org/packages/goldendict-ng-git). Built binary is also availiable from [archlinuxcn's repo](https://github.com/archlinuxcn/repo/tree/master/archlinuxcn/goldendict-ng-git).
* See the right side for available packages in various linux distros.
* In Debian 12 and Ubuntu 23.04, `goldendict-webengine` is available (For later versions it is `goldendict-ng`).
* Pre-built binary is also available from [archlinuxcn's repo](https://github.com/archlinuxcn/repo/tree/master/archlinuxcn/goldendict-ng-git).
* [Gentoo package from PG_Overlay](https://gitlab.com/Perfect_Gentleman/PG_Overlay/-/blob/master/app-text/goldendict/goldendict-9999-r6.ebuild)
* openSUSE ships an old version of this fork.
!!! Help "Please package this GoldenDict for your linux distros!"
## macOS

View file

@ -1,5 +1,6 @@
site_name: GoldenDict-NG
site_description: Goldendict-ng is a dictionary 是一个可以用在 Windows Linux 和 mac 上的字典程序
site_description: GoldenDict-ng is a open source, cross platform, multi formats, feature rich dictionary 是一个开源跨平台支持各种格式的字典程序
site_url: https://xiaoyifang.github.io/goldendict-ng/
theme:
name: material
@ -42,17 +43,15 @@ nav:
- Portable Mode: topic_portablemode.md
- Custom transliteration: topic_transliteration.md
- Customize Dictionary Name: custom_dictionary_name.md
- OCR Integration: howto/How to use ocr together with GoldenDict.md
- OCR Integration: howto/ocr.md
- Report Bugs & Feedbacks: feedbacks.md
- Contributor Guides:
- Developer: developer.md
- How to:
- Build and debug with VS2019: howto/how to build and debug with VS2019.md
- Compile with cmake: howto/how to compile with cmake.md
- Build from source: howto/build_from_source.md
- Customize the opencc: howto/how to customize the opencc.md
- Qt version and github action: howto/how to find out the latest qt version and module in github qt action.md
- Use .clang-format: howto/how to use .clang-format to format the code.md
- Breadpad crash analysis: howto/how to use breadpad crash analysis.md
- Build ffmpeg on Windows: howto/how to build ffmpeg for visual studio.md
- How to update the crowdin.ts file: howto/how to update crowdin.ts file.md
- 中文文档: index_cn.md