{"id":26260289,"url":"https://github.com/voothi/ftca","last_synced_at":"2026-05-12T04:33:37.202Z","repository":{"id":282299282,"uuid":"947409195","full_name":"voothi/ftca","owner":"voothi","description":"Flexible Text Copy Adapter (FTCA) is a utility that connects language reading programs (like Lute) with local dictionaries (like GoldenDict) via the clipboard, enabling offline word translation.","archived":false,"fork":false,"pushed_at":"2025-03-13T19:56:12.000Z","size":18,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-13T20:37:37.226Z","etag":null,"topics":["anki","chrome","clipboard","dictionary","goldendict","language-learning","learning-use-texts","learning-with-texts","lingq","linguacafe","lute","lwt","python","readlang","self-hosting","sentence-mining","spaced-repetition","translation","vocabsieve","vocabtracker"],"latest_commit_sha":null,"homepage":"","language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/voothi.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-03-12T16:35:03.000Z","updated_at":"2025-03-13T19:56:16.000Z","dependencies_parsed_at":"2025-03-13T20:47:52.847Z","dependency_job_id":null,"html_url":"https://github.com/voothi/ftca","commit_stats":null,"previous_names":["voothi/ftca"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/voothi%2Fftca","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/voothi%2Fftca/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/voothi%2Fftca/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/voothi%2Fftca/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/voothi","download_url":"https://codeload.github.com/voothi/ftca/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243495496,"owners_count":20299923,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["anki","chrome","clipboard","dictionary","goldendict","language-learning","learning-use-texts","learning-with-texts","lingq","linguacafe","lute","lwt","python","readlang","self-hosting","sentence-mining","spaced-repetition","translation","vocabsieve","vocabtracker"],"created_at":"2025-03-13T23:14:29.970Z","updated_at":"2026-05-12T04:33:37.185Z","avatar_url":"https://github.com/voothi.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Flexible Text Copy Adapter (FTCA)\n\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n[![Python 3.x](https://img.shields.io/badge/python-3.x-blue.svg)](https://www.python.org/)\n[![Platform](https://img.shields.io/badge/platform-windows%20%7C%20linux%20%7C%20macos-lightgrey)](https://github.com/yourusername/ftca)\n\n\u003cimg width=\"407\" alt=\"{2793AAE1-85B1-4A0C-9D16-D1161511C907}\" src=\"https://github.com/user-attachments/assets/7798a69e-956c-4fdd-9f79-72f56b82332a\" /\u003e\n\n## Table of Contents\n\n- [Flexible Text Copy Adapter (FTCA)](#flexible-text-copy-adapter-ftca)\n  - [Table of Contents](#table-of-contents)\n  - [Overview](#overview)\n    - [What is it?](#what-is-it)\n    - [Who is it for?](#who-is-it-for)\n    - [What problem does this program solve?](#what-problem-does-this-program-solve)\n    - [How does it work?](#how-does-it-work)\n    - [What are the advantages?](#what-are-the-advantages)\n    - [What inspired it?](#what-inspired-it)\n  - [Getting Started](#getting-started)\n    - [What are the system environment prerequisites?](#what-are-the-system-environment-prerequisites)\n    - [How to get started?](#how-to-get-started)\n    - [How to check functionality?](#how-to-check-functionality)\n  - [Configuration \\\u0026 Usage](#configuration--usage)\n    - [URL Parameters](#url-parameters)\n    - [How to configure in the Lute v3 web interface?](#how-to-configure-in-the-lute-v3-web-interface)\n    - [How to use in GoldenDict (Single-line text)?](#how-to-use-in-goldendict-single-line-text)\n      - [Setup:](#setup)\n    - [How to use with multi-line text in GoldenDict?](#how-to-use-with-multi-line-text-in-goldendict)\n      - [Setup:](#setup-1)\n    - [How to allow Clipboard Read Access (Chrome)?](#how-to-allow-clipboard-read-access-chrome)\n    - [How to use Dark Mode or Dark Theme?](#how-to-use-dark-mode-or-dark-theme)\n  - [Technical Details](#technical-details)\n    - [What are the technical features?](#what-are-the-technical-features)\n    - [In what environment was it tested?](#in-what-environment-was-it-tested)\n    - [What about the security of my buffer data?](#what-about-the-security-of-my-buffer-data)\n  - [Troubleshooting](#troubleshooting)\n    - [Why doesn't it work?](#why-doesnt-it-work)\n  - [Legal \\\u0026 Misc](#legal--misc)\n    - [Kardenwort Ecosystem](#kardenwort-ecosystem)\n    - [License](#license)\n    - [Author's Disclaimer](#authors-disclaimer)\n    - [Stars](#stars)\n\n---\n\n## Overview\n\n### What is it?\nThis 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.\n\nIn my case, it helps to easily connect local programs Lute (LWT) and GoldenDict for the ability to work locally, without an internet connection and automatically translate and view selected words from the Lute reading program in the GoldenDict-ng dictionary program.\n\n- Selecting several words and automatically translating using the GoldenDict-ng option \"Enable Scanning\".\n\u003cimg width=\"960\" alt=\"{B42AB080-9EC6-4A3F-957C-98BB38748F5F}\" src=\"https://github.com/user-attachments/assets/20c9bdfa-5f25-49b7-9eca-084304e94ba8\" /\u003e\n\n- 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.\n\u003cimg width=\"960\" alt=\"{72069897-3D0F-426E-82BC-4FB5A598F76D}\" src=\"https://github.com/user-attachments/assets/8b884fbe-0db1-4e4c-b47d-bec144fcc17a\" /\u003e\n\n[Back to Top](#table-of-contents)\n\n### Who is it for?\nIn general:\n- Studying languages and mastering convenient tools for working with large texts.\n\nIn technical terms:\n- 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.\n- Users of GoldenDict.\n\n[Back to Top](#table-of-contents)\n\n### What problem does this program solve?\nA utility for solving the problem of translating individual words in [Lute v3](https://github.com/LuteOrg/lute-v3).\n\n[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)\n\n[Back to Top](#table-of-contents)\n\n### How does it work?\nhttps://github.com/user-attachments/assets/4ae740ae-c729-4405-b80a-7b225c7641b1\n\n[Back to Top](#table-of-contents)\n\n### What are the advantages?\n- **Versatility**. Can be integrated into [Lute](https://github.com/LuteOrg/lute-v3) and similar programs where interaction with dictionaries is done through HTTP requests.\n- **Offline operation**. Allows for an offline workflow between reading software and a local dictionary like GoldenDict-ng.\n- **Multi-line text preservation**. Reliably handles text with line breaks from applications like GoldenDict, which is not possible with direct command-line calls.\n- **Minimalism**. Minimal software dependencies.\n- **Cross-platform compatibility**. Works wherever a Python interpreter and a browser can run.\n- **Easy integration**. Can be easily included in an existing set of tools.\n\n[Back to Top](#table-of-contents)\n\n### What inspired it?\nI 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.\n\n[Back to Top](#table-of-contents)\n\n## Getting Started\n\n### What are the system environment prerequisites?\n- Python 3.x.\n- Chrome or a browser that supports the Modern Clipboard API.\n\n[Back to Top](#table-of-contents)\n\n### How to get started?\n- 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).\n\n- Check that the Python interpreter is installed on your system.\n\n- Run.\nYou can run the `ftca-start.cmd` script if you have Windows.  \nYou can also simply run the command `python ftca.py` directly from the terminal.\nThe web server will start.  \nDo not close the terminal window until you have finished working with the utility. Closing the window will terminate the web server.\n\n- **Go to the address in your browser to test the functionality.**\nSee the \"URL Parameters\" and \"How to check functionality?\" sections below for examples.\n\n- Provide permission for the page to use the clipboard.\n\n[Back to Top](#table-of-contents)\n\n### How to check functionality?\nRun the `ftca.py` server.\n\nOpen one of the links below in your browser.  \n\n- **Option 1 (Simple text, default size)**\nhttp://127.0.0.1:5010/?s=test%20test\n\n- **Option 2 (With clipboard copy)**\nhttp://127.0.0.1:5010/?clipboard=true\u0026s=test\n\n- **Option 3 (With custom height)**\nhttp://127.0.0.1:5010/?s=This%20is%20a%20test%20in%20a%20taller%20box\u0026rows=10\n\nThe 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.\n\n[Back to Top](#table-of-contents)\n\n## Configuration \u0026 Usage\n\n### URL Parameters\nThe utility's behavior is controlled by parameters in the URL:\n\n- **`s`**: The text content to display in the text area. The text should be standard URL-encoded.\n  - *Example:* `s=Hello%20World`\n\n- **`s_b64`**: The text content, encoded in Base64. This is the required method for reliably passing multi-line text from external programs.\n  - *Example:* `s_b64=SGVsbG8KV29ybGQ=` (for \"Hello\\nWorld\")\n\n- **`clipboard=true`**: If this parameter is present, the script will automatically attempt to copy the content of the text area to the system clipboard upon loading.\n\n- **`multiline=true`**: This flag must be used in conjunction with `s_b64` to ensure the server decodes and displays the Base64 content.\n\n- **`rows`**: An integer that sets the initial height (number of visible lines) of the text area.\n  - *Example:* `rows=15`\n  - *Default:* If not specified, the height defaults to `4` lines.\n\n[Back to Top](#table-of-contents)\n\n### How to configure in the Lute v3 web interface?\nSettings — Languages — [Your Language] — Edit  \nDictionaries — Add dictionary  \n- **Type**: Terms\n- **Open in**: Pop-up window\n- **URI**: `http://127.0.0.1:5010/?clipboard=true\u0026rows=8\u0026s=[LUTE]`\n- **Is active?**: `true`\n\n*(Note: You can adjust the `rows=8` value to your preferred initial height.)*\n\n[Back to Top](#table-of-contents)\n\n### How to use in GoldenDict (Single-line text)?\nThis 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.\n\nThis is ideal for single words or short phrases without line breaks.\n\n\u003cimg width=\"960\" alt=\"{F8846A14-2782-4FBE-A3EC-040F8E5EEF45}\" src=\"https://github.com/user-attachments/assets/bebdc522-bb85-4cf3-8bf4-1794eb7b64f7\" /\u003e\n\n#### Setup:\nGo to `GoldenDict-ng Main Window — Dictionaries — Sources — Programs` and add a new entry. You can optionally add the `\u0026rows=...` parameter to control the initial size of the text area.\n\n```\n[x] Enabled\nType: Audio (or Html)\nName: FTCA\nCommand Line: \"C:\\Program Files\\Google\\Chrome\\Application\\chrome.exe\" http://127.0.0.1:5010/?clipboard=true\u0026rows=8\u0026s=\"%GDWORD%\"\n```\n\u003cimg width=\"960\" alt=\"{56ED9E95-983C-4660-A92A-3EA1E0E91033}\" src=\"https://github.com/user-attachments/assets/25328302-f275-4130-892a-0f8b657489fb\" /\u003e\n\n[Back to Top](#table-of-contents)\n\n### How to use with multi-line text in GoldenDict?\nWhen passing long text with line breaks from GoldenDict, the standard command-line method will fail and merge everything into a single line.\n\nTo preserve line breaks, we must use the included `launcher.py` helper script. It safely encodes the text using Base64 before launching the browser. Additionally, it automatically sets the text area height to **20 rows** (`rows=20`) for better viewing of multi-line content.\n\n#### Setup:\nGo to `GoldenDict-ng Main Window — Dictionaries — Sources — Programs` and use the following command line structure:\n\n```\ncmd /c \"C:\\path\\to\\your\\python.exe\" \"C:\\path\\to\\your\\ftca\\folder\\launcher.py\" \"%GDWORD%\"\n```\n\nYou **must** replace the placeholder paths with the actual full paths on your system.\n\n- **`\"C:\\path\\to\\your\\python.exe\"`**: The full path to your Python interpreter.\n  *(Example: `\"C:\\Users\\YourUser\\AppData\\Local\\Programs\\Python\\Python312\\python.exe\"`)*\n- **`\"C:\\path\\to\\your\\ftca\\folder\\launcher.py\"`**: The full path to the `launcher.py` script.\n  *(Example: `\"D:\\MyTools\\ftca\\launcher.py\"`)*\n\n**Example of a complete command:**\n```\ncmd /c \"C:\\Users\\User\\AppData\\Local\\Programs\\Python\\Python312\\python.exe\" \"D:\\MyTools\\ftca\\launcher.py\" \"%GDWORD%\"\n```\n\u003cimg width=\"960\" alt=\"{2A58A109-50DB-47F8-AB31-EC481A71A823}\" src=\"https://github.com/user-attachments/assets/cf4e736a-25b5-4e6a-9805-798a4379cd50\" /\u003e\n\n[Back to Top](#table-of-contents)\n\n### How to allow Clipboard Read Access (Chrome)?\nThe script uses the Modern Clipboard API, which requires you to grant the page permission to interact with the clipboard.\n\n\u003cimg width=\"407\" alt=\"{2793AAE1-85B1-4A0C-9D16-D1161511C907}\" src=\"https://github.com/user-attachments/assets/8b0186e3-1476-46c3-afa5-f80ebb59581a\" /\u003e\n\n[Back to Top](#table-of-contents)\n\n### How to use Dark Mode or Dark Theme?\nIf 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.\n\n\u003cimg width=\"960\" alt=\"image\" src=\"https://github.com/user-attachments/assets/c4aabcf3-aead-41b9-bfa4-5582591a4a48\" /\u003e\n\n[Back to Top](#table-of-contents)\n\n## Technical Details\n\n### What are the technical features?\nThe 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.\n\n[Back to Top](#table-of-contents)\n\n### In what environment was it tested?\n- Windows 11.\n- Python 3.12.7.\n- Chrome Version 122.0.6261.95 (Official Build) (64-bit).\n- LUTE: Learning Using Texts v3, Version: 3.10.1.\n- GoldenDict-ng 24.04.12-alpha.20240412.000451.\n\n[Back to Top](#table-of-contents)\n\n### What about the security of my buffer data?\nThis 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.\n\n[Back to Top](#table-of-contents)\n\n## Troubleshooting\n\n### Why doesn't it work?\n- Ensure no other application is using port `5010`.\n- 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`.\n- 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.\n\n[Back to Top](#table-of-contents)\n\n## Legal \u0026 Misc\n\n### Kardenwort Ecosystem\n\nThis project is part of the **[Kardenwort](https://github.com/kardenwort)** environment, designed to create a focused and efficient learning ecosystem.\n\n[Back to Top](#table-of-contents)\n\n### License\nMIT License.\n\n[Back to Top](#table-of-contents)\n\n### Author's Disclaimer\nThe 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.\n\n[Back to Top](#table-of-contents)\n\n### Stars\nIf you find this utility helpful, please consider starring the repository to support the developer's efforts.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvoothi%2Fftca","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvoothi%2Fftca","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvoothi%2Fftca/lists"}