Metadata-Version: 2.1
Name: xtl-read-assistant
Version: 0.0.2
Summary: X as a third language reading assistant
Home-page: https://github.com/ffreemt/xtl-read-assistant
License: MIT
Keywords: mt,language,learning
Author: ffreemt
Requires-Python: >=3.6,<4.0
Classifier: Environment :: Console
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Dist: absl-py (>=0.9.0,<0.10.0)
Requires-Dist: deepl-tr-async (>=0.0.2,<0.0.3)
Requires-Dist: environs (>=7.3.1,<8.0.0)
Requires-Dist: janus (>=0.4.0,<0.5.0)
Requires-Dist: logzero (>=1.5.0,<2.0.0)
Requires-Dist: polyglot (>=16.7.4,<17.0.0)
Requires-Dist: pynput (>=1.6.8,<2.0.0)
Requires-Dist: pyperclip (>=1.7.0,<2.0.0)
Requires-Dist: python-dotenv (>=0.12.0,<0.13.0)
Project-URL: Repository, https://github.com/ffreemt/xtl-read-assistant
Description-Content-Type: text/markdown

# xtl-read-assistant ![build](https://github.com/ffreemt/xtl-read-assistant/workflows/build/badge.svg)[![codecov](https://codecov.io/gh/ffreemt/xtl-read-assistant/branch/master/graph/badge.svg)](https://codecov.io/gh/ffreemt/xtl-read-assistant)[![PyPI version](https://badge.fury.io/py/xtl-read-assistant.svg)](https://badge.fury.io/py/xtl-read-assistant)
x as a third language reading assistant tool

### Pre-installation of libicu

###### For Linux/OSX

E.g.
* Ubuntu: `sudo apt install libicu-dev`
* Centos: `yum install libicu`
* OSX: `brew install icu4c`

###### For Windows

Download and install the pyicu and pycld2 whl packages for your OS version from https://www.lfd.uci.edu/~gohlke/pythonlibs/#pyicu and https://www.lfd.uci.edu/~gohlke/pythonlibs/#pycld2

### Installation
```pip install xtl-read-assistant```

Validate installation
```
python -c "import xtl_read_assistant; print(xtl_read_assistant.__version__)"
# 0.0.2 or other version info
```
#### Patch `pyppeteer/connection.py`

The pyppeteer package does not work too well with websockets 7+. Either downgrade the websockets to 6 or manually perform the following patch.

Change site-packages\pyppeteer\connection.py  `line 44`  to:
`
            # self._url, max_size=None, loop=self._loop)
            self._url, max_size=None, loop=self._loop, ping_interval=None, ping_timeout=None)
`

### Usage

Run `read-assist.exe`; Copy text to the clipboard (`ctrl-c`); Activate hotkey (`ctrl-alt-g`)

The translated text is stored in the clipboard.

#### default setup: --mother-lang=zh --second-lang=en --third-lang=de
`read-assist`

`ctrl-alt-g`: to activate clipboard translation
`ctrl-alt-x`: to exit

#### other setup exmaple: --mother-lang=zh --second-lang=en --third-lang=fr

`read-assist --third-lang=fr`

