<p align="center">
    <div align="center"><img src="https://github.com/daylenjeez/deepl-alfred/blob/main/img/deepl-logo.svg" width=120  /></div>
    <h2 align="center">DeepL Alfred</h2>
    <div align="center">High-quality translation based on DeepL, supports automatic language recognition and accurate translation of long sentences;</div>
    <div align="center"><a href="README.md">中文</a> | <strong>English</strong></div>
</p>

## Install
```bash
  npm i -g deepl-alfred
```

## Examples

<p align="center">
  <span align="left"><img src="https://github.com/daylenjeez/deepl-alfred/blob/main/img/zh-en.png" width="48%"  /></span>
  <span align="right"><img src="https://github.com/daylenjeez/deepl-alfred/blob/main/img/en-zh.png" width="48%" /></span>
</p>

## Features
**Language Recognition**: Automatically recognize the input language for translation.               
**Copy on Enter**: After translation, click ↩︎ `Enter` to copy the translation result.                
**View Details**: After translation, click ⌘`` Command`` + ↩︎ ``Enter`` to navigate to [deepl.com](https://deepl.com) to see more translations and pronunciations, etc.

## Configuration
- ``auth_key``: Your ``api key`` obtained from DeepL; [Apply here](https://www.deepl.com/zh/account/summary/generate-new-api-key).
- ``preferred``: Your two frequently used languages, separated by a comma for bidirectional translation support. For example, if you frequently use Chinese and American English, you can input `zh,en-US` here; (⚠️ Please configure ``en`` as ``en-US`` or ``en-GB``).



## Language Configuration
| Configuration | Language |
| ---- | ---- |
| en-GB | English (British) |
| en-US | English (American) |
| zh | Chinese (Simplified) |
| ru | Russian |
| ja | Japanese |
| fr | French |
| ko | Korean |
| it | Italian |

[More Language Configuration](https://www.deepl.com/zh/docs-api/translate-text/translate-text)





