Skip to content

Commit

Permalink
#3 changed translation service
Browse files Browse the repository at this point in the history
  • Loading branch information
emregeldegul committed Nov 13, 2020
1 parent e5c81fe commit 70707b7
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 35 deletions.
18 changes: 2 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,26 +3,12 @@ Translate From The Clipboard (Simple Translate App From The Clipboard)

![TFC](images/tfc.png)

TFC listens to the clipboard and translates the copied words using Yandex Translate. It shows translations as notifications.
TFC listens to the clipboard and translates the copied words using Google Translate. It shows translations as notifications.

![TFC](images/tfcPicture.jpg)

# Setup
Firstly, take a Yandex Translate API key.

**Yandex Translate API:** https://tech.yandex.com/translate/doc/dg/concepts/about-docpage/

After taking the API key, create a config file as `.tfc.config.json` on **home** directory.

It should look like this:

```json
{
"key": "YandexTranslateKey",
"lang": "en-tr"
}
```
Ok. Now you can download and install the project.
Download and install the project.

```bash
~$ git clone https://github.com/emregeldegul/tfc && cd tfc
Expand Down
17 changes: 1 addition & 16 deletions tfc/__init__.py
Original file line number Diff line number Diff line change
@@ -1,25 +1,10 @@
import sys
from json import loads
from os.path import exists, expanduser, join

from .tfc import Translation




def main():
""" Entry point for cli. """
if not exists(join(expanduser("~"), '.tfc.config.json')):
print('TFC Could Not Find The Configuration File.')
exit(1)

with open(join(expanduser("~"), '.tfc.config.json'), 'r') as configFile:
config = loads(configFile.read())

print('TFC listens To Your Clipboard For Translation.')
print('='*50)

translation = Translation(config)
translation = Translation()
translation.start()

if __name__ == '__main__':
Expand Down
4 changes: 1 addition & 3 deletions tfc/tfc.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@
from xerox import paste

class Translation():
def __init__(self, config):
self.config = config

def __init__(self):
self.translate = Translator()
self.notify = Notify()

Expand Down

0 comments on commit 70707b7

Please sign in to comment.