Skip to content

Commit

Permalink
delete goo text
Browse files Browse the repository at this point in the history
  • Loading branch information
dazzleMesh committed May 28, 2023
1 parent 4a1eac0 commit a40ac1e
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 8 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Alfred workflow to translate texts
## Usage
Translate words or sentences to another language with Google Translate via the `t` keyword.
Translate words or sentences to another language via the `t` keyword.
![preview](images/preview.png)
![preview2](images/preview2.png)
↩: Copy translate to the clipboard.
Expand Down
4 changes: 1 addition & 3 deletions info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@
</array>
<key>readme</key>
<string># Usage
Translate words or sentences to another language with Google Translate via the `t` keyword.
Translate words or sentences to another language via the `t` keyword.
![preview](images/preview.png)
![preview2](images/preview2.png)
↩: Copy translate to the clipboard.
Expand Down Expand Up @@ -303,8 +303,6 @@ By default, translate any language to Russian, setup your language in the **work
<string>input_language</string>
</dict>
</array>
<key>variablesdontexport</key>
<array/>
<key>version</key>
<string>0.1.0</string>
<key>webaddress</key>
Expand Down
8 changes: 4 additions & 4 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
import os


class GoogleTranslate:
class Translate:
"""
Google Translate API
Translate API
Thanks to Telegram MacOS client for the idea
https://github.com/TelegramOrg/Telegram-macos-Swift/blob/67e4cf8de2f060ec8152ce68562c9489a6073534/packages/Translate/Sources/Translate/Translate.swift
Expand Down Expand Up @@ -97,10 +97,10 @@ def generate_worflow_output(translations: List[str]):
out_lang = os.environ["output_language"]
in_lang = os.environ["input_language"]

recognised_lang, translate = GoogleTranslate(
recognised_lang, translate = Translate(
out_lang).get_translation(' '.join(text_list))
if recognised_lang == out_lang:
_, translate = GoogleTranslate(
_, translate = Translate(
in_lang).get_translation(' '.join(text_list))

print(generate_worflow_output(translate))

0 comments on commit a40ac1e

Please sign in to comment.