You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-[Flexible Text Copy Adapter (FTCA)](#flexible-text-copy-adapter-ftca)
11
+
-[Table of Contents](#table-of-contents)
12
+
-[What is it?](#what-is-it)
13
+
-[Who is it for?](#who-is-it-for)
14
+
-[What problem does this program solve?](#what-problem-does-this-program-solve)
15
+
-[How does it work?](#how-does-it-work)
16
+
-[How to get started?](#how-to-get-started)
17
+
-[URL Parameters](#url-parameters)
18
+
-[How to use in GoldenDict (Single-line text)?](#how-to-use-in-goldendict-single-line-text)
19
+
-[Setup:](#setup)
20
+
-[How to use with multi-line text in GoldenDict?](#how-to-use-with-multi-line-text-in-goldendict)
21
+
-[Setup:](#setup-1)
22
+
-[What are the advantages?](#what-are-the-advantages)
23
+
-[What inspired it?](#what-inspired-it)
24
+
-[How to use Dark Mode or Dark Theme?](#how-to-use-dark-mode-or-dark-theme)
25
+
-[What are the technical features?](#what-are-the-technical-features)
26
+
-[What are the system environment prerequisites?](#what-are-the-system-environment-prerequisites)
27
+
-[In what environment was it tested?](#in-what-environment-was-it-tested)
28
+
-[How to configure in the Lute v3 web interface?](#how-to-configure-in-the-lute-v3-web-interface)
29
+
-[How to allow Clipboard Read Access (Chrome)?](#how-to-allow-clipboard-read-access-chrome)
30
+
-[How to check functionality?](#how-to-check-functionality)
31
+
-[What about the security of my buffer data?](#what-about-the-security-of-my-buffer-data)
32
+
-[Why doesn't it work?](#why-doesnt-it-work)
33
+
-[Kardenwort Ecosystem](#kardenwort-ecosystem)
34
+
-[License](#license)
35
+
-[Author's Disclaimer](#authors-disclaimer)
36
+
-[Stars](#stars)
37
+
4
38
## What is it?
5
39
This is a small utility that serves as an adapter, allowing to establish communication between a class of programs for assistance in reading in a foreign language and a local dictionary or translator, through the system clipboard.
6
40
@@ -12,6 +46,8 @@ In my case, it helps to easily connect local programs Lute (LWT) and GoldenDict
12
46
- Working with words. Copying the selected using Ctrl+C manually. The ability to select a separate morpheme of a word in the interface of the utility window.
- Studying languages and mastering convenient tools for working with large texts.
@@ -20,14 +56,20 @@ In technical terms:
20
56
- Users of [Lute v3](https://github.com/LuteOrg/lute-v3) and similar programs for reading and translating selected portions of text, such as LWT, Readlang.org. Primarily aimed at use in local environments, without mandatory internet connectivity.
21
57
- Users of GoldenDict.
22
58
59
+
[Back to Top](#table-of-contents)
60
+
23
61
## What problem does this program solve?
24
62
A utility for solving the problem of translating individual words in [Lute v3](https://github.com/LuteOrg/lute-v3).
25
63
26
64
[Issue #593 — Revision of the logic of copying a word and substring of text from the main panel](https://github.com/LuteOrg/lute-v3/issues/593)
- Download. You can perform a clone or visit the Releases page. The project consists of three main files: `ftca.py` (the server), `index.html` (the web page), and `launcher.py` (a helper script for multi-line support in GoldenDict).
33
75
@@ -44,6 +86,8 @@ See the "URL Parameters" and "How to check functionality?" sections below for ex
44
86
45
87
- Provide permission for the page to use the clipboard.
46
88
89
+
[Back to Top](#table-of-contents)
90
+
47
91
## URL Parameters
48
92
The utility's behavior is controlled by parameters in the URL:
49
93
@@ -61,6 +105,8 @@ The utility's behavior is controlled by parameters in the URL:
61
105
-*Example:*`rows=15`
62
106
-*Default:* If not specified, the height defaults to `4` lines.
63
107
108
+
[Back to Top](#table-of-contents)
109
+
64
110
## How to use in GoldenDict (Single-line text)?
65
111
This utility can be used not only with Lute but also within GoldenDict as a "Program" dictionary. This allows you to send the current search term to a new browser tab for easier editing or further processing.
-**Versatility**. Can be integrated into [Lute](https://github.com/LuteOrg/lute-v3) and similar programs where interaction with dictionaries is done through HTTP requests.
109
159
-**Offline operation**. Allows for an offline workflow between reading software and a local dictionary like GoldenDict-ng.
-**Cross-platform compatibility**. Works wherever a Python interpreter and a browser can run.
113
163
-**Easy integration**. Can be easily included in an existing set of tools.
114
164
165
+
[Back to Top](#table-of-contents)
166
+
115
167
## What inspired it?
116
168
I accidentally discovered that when making a request like `https://m.dict.cc/deutsch-russisch/test.html`, the input field on the page loads with the search term already selected (as if by Ctrl+A). This JavaScript-powered feature allows for immediate copying to the clipboard, which inspired the core functionality of FTCA.
117
169
170
+
[Back to Top](#table-of-contents)
171
+
118
172
## How to use Dark Mode or Dark Theme?
119
173
If you use a browser extension like [Dark Reader](https://github.com/darkreader/darkreader), you can enable it for the FTCA page. Simply open a link like `http://127.0.0.1:5010/?s=test` and activate the plugin for this site.
The utility runs a lightweight, dependency-free HTTP server using Python's standard library. It serves a single HTML/JS page that acts as the adapter. For multi-line text, a helper script uses Base64 encoding to ensure data integrity during transmission via the command line.
125
181
182
+
[Back to Top](#table-of-contents)
183
+
126
184
## What are the system environment prerequisites?
127
185
- Python 3.x.
128
186
- Chrome or a browser that supports the Modern Clipboard API.
129
187
188
+
[Back to Top](#table-of-contents)
189
+
130
190
## In what environment was it tested?
131
191
- Windows 11.
132
192
- Python 3.12.7.
133
193
- Chrome Version 122.0.6261.95 (Official Build) (64-bit).
The page should load with your text in the input field, fully selected. If `clipboard=true` is used and permission is granted, the text will also be automatically copied to your clipboard. For multi-line tests, use the GoldenDict setup described above.
167
233
234
+
[Back to Top](#table-of-contents)
235
+
168
236
## What about the security of my buffer data?
169
237
This utility does not transmit your data to the internet. It operates locally on your PC, transmitting data between applications via the loopback network interface (`127.0.0.1`). While it doesn't store data on disk, it is processed in RAM. Assess your own risks when working with sensitive information. It is strongly recommended not to expose this server to any address other than the loopback address.
170
238
239
+
[Back to Top](#table-of-contents)
240
+
171
241
## Why doesn't it work?
172
242
- Ensure no other application is using port `5010`.
173
243
- Make sure you have only one instance of the `ftca.py` script running. Check your system's process manager for `python` processes related to `ftca`.
174
244
- If using the multi-line method, double-check that the paths to `python.exe` and `launcher.py` in your GoldenDict command are correct and enclosed in double quotes.
175
245
246
+
[Back to Top](#table-of-contents)
247
+
248
+
## Kardenwort Ecosystem
249
+
250
+
This project is part of the **[Kardenwort](https://github.com/kardenwort)** environment, designed to create a focused and efficient learning ecosystem.
251
+
252
+
[Back to Top](#table-of-contents)
253
+
176
254
## License
177
255
MIT License.
178
256
257
+
[Back to Top](#table-of-contents)
258
+
179
259
## Author's Disclaimer
180
260
The software is provided "as is" without any warranties. The author is not responsible for any damages or issues arising from the use of this software. Users are advised to use it at their own risk.
181
261
262
+
[Back to Top](#table-of-contents)
263
+
182
264
## Stars
183
-
If you find this utility helpful, please consider starring the repository to support the developer's efforts.
265
+
If you find this utility helpful, please consider starring the repository to support the developer's efforts.
0 commit comments