├── .gitignore ├── Makefile ├── src ├── icon.png ├── load.sh ├── input.sh ├── view.sh ├── switch.sh ├── translate.sh └── info.plist ├── screenshot ├── 1.gif ├── 2.gif ├── 3.gif ├── 2020-07-13_10.55.02.png ├── 2020-07-13_14.15.45.png ├── 790CEFA3-2145-48EB-969F-D77EE3837DCD.png ├── 996450EF-DA8F-4499-AB21-34925F9BB3BA.png ├── ADC592D1-13C8-4981-BB53-3AC7A791EC1C.png ├── CA161D10-6685-4D2C-AF51-9D8F9DE6C28A.png └── DC3E49BD-05A0-448D-BC87-D5708230AC77.png ├── README_JA.md └── README.md /.gitignore: -------------------------------------------------------------------------------- 1 | quick-translate.alfredworkflow -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | build: 2 | cd src; zip -r ../quick-translate.alfredworkflow * -------------------------------------------------------------------------------- /src/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nkmr-jp/alfred-quick-translate/HEAD/src/icon.png -------------------------------------------------------------------------------- /screenshot/1.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nkmr-jp/alfred-quick-translate/HEAD/screenshot/1.gif -------------------------------------------------------------------------------- /screenshot/2.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nkmr-jp/alfred-quick-translate/HEAD/screenshot/2.gif -------------------------------------------------------------------------------- /screenshot/3.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nkmr-jp/alfred-quick-translate/HEAD/screenshot/3.gif -------------------------------------------------------------------------------- /screenshot/2020-07-13_10.55.02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nkmr-jp/alfred-quick-translate/HEAD/screenshot/2020-07-13_10.55.02.png -------------------------------------------------------------------------------- /screenshot/2020-07-13_14.15.45.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nkmr-jp/alfred-quick-translate/HEAD/screenshot/2020-07-13_14.15.45.png -------------------------------------------------------------------------------- /screenshot/790CEFA3-2145-48EB-969F-D77EE3837DCD.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nkmr-jp/alfred-quick-translate/HEAD/screenshot/790CEFA3-2145-48EB-969F-D77EE3837DCD.png -------------------------------------------------------------------------------- /screenshot/996450EF-DA8F-4499-AB21-34925F9BB3BA.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nkmr-jp/alfred-quick-translate/HEAD/screenshot/996450EF-DA8F-4499-AB21-34925F9BB3BA.png -------------------------------------------------------------------------------- /screenshot/ADC592D1-13C8-4981-BB53-3AC7A791EC1C.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nkmr-jp/alfred-quick-translate/HEAD/screenshot/ADC592D1-13C8-4981-BB53-3AC7A791EC1C.png -------------------------------------------------------------------------------- /screenshot/CA161D10-6685-4D2C-AF51-9D8F9DE6C28A.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nkmr-jp/alfred-quick-translate/HEAD/screenshot/CA161D10-6685-4D2C-AF51-9D8F9DE6C28A.png -------------------------------------------------------------------------------- /screenshot/DC3E49BD-05A0-448D-BC87-D5708230AC77.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nkmr-jp/alfred-quick-translate/HEAD/screenshot/DC3E49BD-05A0-448D-BC87-D5708230AC77.png -------------------------------------------------------------------------------- /src/load.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | tmp_file=/tmp/quick_translate_tmp 3 | langs=($(echo "$foreign_lang" | tr ',' '\n')) 4 | 5 | if [ -e $tmp_file ]; then 6 | current=$(cat $tmp_file) 7 | else 8 | current="${langs[0]}" 9 | fi 10 | echo -n "$current" -------------------------------------------------------------------------------- /src/input.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # shellcheck disable=SC2154 3 | input=$(echo "$input" | tr '\n' ';') 4 | input=${input// /} 5 | input=${input//\. /. ;} 6 | input=${input//\。/。;} 7 | 8 | if [[ $input =~ 。 ]]; then 9 | input=${input//;;/;} 10 | fi 11 | 12 | # // comment e.g. golang 13 | input=${input//;\/\/ / } 14 | input=${input//\/\/ /} 15 | 16 | # # comment e.g. python 17 | input=${input//;\# / } 18 | input=${input//\# /} 19 | 20 | echo -n "$input" 21 | -------------------------------------------------------------------------------- /src/view.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # shellcheck disable=SC2154 3 | 4 | view_input=$input 5 | view_output=$output 6 | 7 | if [[ $input =~ 。 ]]; then 8 | view_input=$(echo -n "$input" | fold -w 80) 9 | fi 10 | if [[ $output =~ 。 ]]; then 11 | view_output=$(echo -n "$output" | fold -w 80) 12 | fi 13 | 14 | if [[ "$view" == "output_only" ]]; then 15 | echo -n "$view_input" 16 | else 17 | echo "-- INPUT --" 18 | echo -n "$view_input" 19 | echo "" 20 | echo "" 21 | echo "-- OUTPUT --" 22 | echo -n "$view_output" 23 | fi 24 | -------------------------------------------------------------------------------- /src/switch.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | tmp_file=/tmp/quick_translate_tmp 3 | langs=($(echo "$foreign_lang" | tr ',' '\n')) 4 | 5 | if [ -e $tmp_file ]; then 6 | current=$(cat $tmp_file) 7 | flg=0 8 | for ((i = 0; i <= ${#langs[@]}; i++)); do 9 | if [[ "$current" == "${langs[$i]}" ]]; then 10 | if [ -z ${langs[$i + 1]} ]; then 11 | current=${langs[0]} 12 | else 13 | current=${langs[$i + 1]} 14 | fi 15 | flg=1 16 | break 17 | fi 18 | done 19 | if [[ $flg -eq 0 ]]; then 20 | current=${langs[0]} 21 | fi 22 | else 23 | current="${langs[0]}" 24 | fi 25 | 26 | echo "$current" > $tmp_file 27 | 28 | output="" 29 | for ((i = 0; i < ${#langs[@]}; i++)); do 30 | if [[ "$current" == "${langs[$i]}" ]]; then 31 | output="$output [ ${langs[$i]} ]" 32 | else 33 | output="$output ${langs[$i]}" 34 | fi 35 | done 36 | 37 | echo -n "$output" -------------------------------------------------------------------------------- /src/translate.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # shellcheck disable=SC2154 3 | # shellcheck disable=SC2086 4 | # shellcheck disable=SC2001 5 | 6 | PATH=$PATH:/usr/local/bin:/opt/homebrew/bin 7 | engines=('google') 8 | input=$1 9 | trans="" 10 | lf=$'\\\x0A' 11 | 12 | if [[ "$lang" == "${native_lang}2${foreign_lang}" ]]; then 13 | from=$native_lang 14 | to=$foreign_lang 15 | else 16 | from=$foreign_lang 17 | to=$native_lang 18 | fi 19 | 20 | set_trans() { 21 | if [[ "${engines[*]}" =~ $engine ]]; then 22 | input=$(echo -n "$input" | sed 's/;/'"$lf"'/g') 23 | trans=$(trans "$from:$to" --engine "$engine" -b "$input") 24 | elif [[ $engine == "deepl" ]]; then 25 | if [[ $deepl_api_url == "pro" ]]; then 26 | api_url=https://api.deepl.com/v2/translate 27 | else 28 | api_url=https://api-free.deepl.com/v2/translate 29 | fi 30 | local from_upper to_upper 31 | from_upper=$(echo "$from" | tr '[:lower:]' '[:upper:]') 32 | to_upper=$(echo "$to" | tr '[:lower:]' '[:upper:]') 33 | 34 | # Split input to multiple sentences. 35 | # Because DeepL API cannot translate overly long sentences. 36 | IFS=';' 37 | set -- $input 38 | trans=$( 39 | curl -s "$api_url" \ 40 | -d auth_key="$deepl_api_key" \ 41 | -d "text=$1" \ 42 | -d "text=$2" \ 43 | -d "text=$3" \ 44 | -d "text=$4" \ 45 | -d "text=$5" \ 46 | -d "text=$6" \ 47 | -d "text=$7" \ 48 | -d "text=$8" \ 49 | -d "text=$9" \ 50 | -d "text=${10}" \ 51 | -d "text=${11}" \ 52 | -d "text=${12}" \ 53 | -d "text=${13}" \ 54 | -d "text=${14}" \ 55 | -d "text=${15}" \ 56 | -d "text=${16}" \ 57 | -d "text=${17}" \ 58 | -d "text=${18}" \ 59 | -d "text=${19}" \ 60 | -d "text=${20}" \ 61 | -d "target_lang=$to_upper" \ 62 | -d "source_lang=$from_upper"\ 63 | ) 64 | trans=$(echo "$trans" | jq -r .translations[].text) 65 | if [ -n "${21}" ]; then 66 | trans="$trans $lf ...too large volumes of text." 67 | fi 68 | else 69 | echo -n "'$engine' is unsupported engine" 70 | exit 71 | fi 72 | } 73 | 74 | run() { 75 | set_trans 76 | echo -n "$trans" 77 | } 78 | 79 | filter() { 80 | set_trans 81 | cat < 4 | 5 | 6 | 7 | - [Alfred Quick Translate](#alfred-quick-translate) 8 | - [機能](#機能) 9 | - [インストール](#インストール) 10 | - [言語と翻訳エンジンの設定](#言語と翻訳エンジンの設定) 11 | - [DeepL翻訳を使う場合](#deepl翻訳を使う場合) 12 | - [Hotkeyの設定](#hotkeyの設定) 13 | - [使い方](#使い方) 14 | - [サクッと翻訳したい](#サクッと翻訳したい) 15 | - [翻訳してGoogleで検索したい](#翻訳してgoogleで検索したい) 16 | - [テキストを選択して翻訳したい](#テキストを選択して翻訳したい) 17 | 18 | 19 | 20 | 21 | # Alfred Quick Translate 22 | - [Alfred 4](https://www.alfredapp.com/) 対応の翻訳ワークフローです。(※有料のPowerpack が必要です。) 23 | - [translate-shell](https://github.com/soimort/translate-shell) を使っています。 24 | - iconは[iconfinder](https://www.iconfinder.com/icons/1249992/google_media_network_search_social_icon#size=128)で探しました。 25 | - 翻訳エンジンを選択できます。 26 | - Google(デフォルト), DeepL 27 | - ※ DeepLを使う場合は [DeepL API](https://www.deepl.com/pro#developer) に登録してキーを取得する必要があります。 28 | - 翻訳する言語を選択できるようになりました 29 | - 言語コード([Google](https://github.com/soimort/translate-shell/wiki/Languages), [DeepL](https://www.deepl.com/docs-api/translating-text/)) 30 | 31 | 32 | ## 機能 33 | 翻訳してテキストを貼り付け 34 | 35 | 36 | 37 | 翻訳してそのまま検索 38 | 39 | 40 | 41 | テキストを選択して翻訳 42 | 43 | 44 | 45 | 翻訳したログの自動保存 (`~/translate_log2.yml`) 46 | 47 | 48 | 49 | ログファイルはYamlなのでyqコマンドでパース出来ます。 50 | 51 | ```sh 52 | $ brew install python-yq 53 | $ cat ~/translate2_log.yml | yq . 54 | ``` 55 | 56 | 57 | 58 | 59 | 60 | クリップボードにも自動で保存
61 | Alfredのクリップボード機能を使うと履歴を検索できるので便利です。 62 | 63 | 64 | 65 | どの機能を使っても、翻訳前、翻訳後のテキストはログファイルとクリップボードの両方に自動で保存されます。 66 | 67 | ## インストール 68 | 69 | 1: [Alfred](https://www.alfredapp.com/) をインストールし、Powerpackを購入してライセンス認証。 70 | 71 | 2: 各種コマンドをインストール 72 | 73 | ```shell 74 | brew install translate-shell jq coreutils curl 75 | ``` 76 | 77 | 3: [releases](https://github.com/nkmr-jp/alfred-quick-translate/releases)から`quick-translate.alfredworkflow` をダウンロード 78 | 79 | 80 | 81 | 4: ダウンロードした `quick-translate.alfredworkflow` をクリックして開くとAlfredが起動するので`import`をクリック。 82 | 83 | 84 | 85 | ## 言語と翻訳エンジンの設定 86 | ワークフローをインストール後、右上のアイコンをクリックすると設定画面が開きます。この画面で翻訳エンジンや言語を選択できます。 87 | 設定については左側の `About the Workflow` を参考にしてください。 88 | 89 | 90 | 91 | ### DeepL翻訳を使う場合 92 | 1. [DeepL API](https://www.deepl.com/pro#developer)に登録してのAPIキーを取得してください。 93 | 2. `engine`に`deepl`と入力して`deepl_api_key`に取得したキーを入力してください。 94 | 95 | 96 | ## Hotkeyの設定 97 | AlfredのPreferencesのWorkflowsからQuick Translateを開くと、このように各機能のHotkeyが設定できます。
98 | 初期の状態ではHotkeyは空白ですのでお好みのキーを割り当てて使ってください。 99 | 上から順に 100 | 101 | - ランチャーを起動して母国語(native_lang)から翻訳対象言語(translate_lang)に翻訳する(From Native Language) 102 | - ランチャーを起動して翻訳対象言語から母国語に翻訳する(To Native Language) 103 | - 選択したテキストを母国語から翻訳対象言語に翻訳する(From Native Language) 104 | - 選択したテキストを翻訳対象言語から母国語に翻訳する(To Native Language) 105 | 106 | となります。 107 | 108 | 109 | 110 | 111 | ## 使い方 112 | ### サクッと翻訳したい 113 | Hotkeyの設定で割り当てたキーで翻訳ランチャーを起動します。
114 | 文字を入力するとリアルタイムで翻訳されます。
115 | `Enter` を押すと、翻訳結果をエディタなどに貼り付けられます。 116 | 117 | 118 | 119 | 120 | ### 翻訳してGoogleで検索したい 121 | Hotkeyの設定で割り当てたキーで翻訳ランチャーを起動します。
122 | 翻訳ランチャーでテキストを入力後
123 | `cmd + Enter` で翻訳後のテキストでググれます。 124 | 125 | 126 | 127 | 128 | ### テキストを選択して翻訳したい 129 | 130 | 翻訳したいテキストを選択して、Hotkeyに割り当てたキーを入力します。 131 | 132 | 133 | 134 | ブラウザだとGoogle翻訳が使えますが、ソースコード上のコメントやチャットのメッセージなどをすぐ翻訳したいときにも使えて便利です。 135 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | [English](README.md) | [日本語](README_JA.md) 2 | 3 | 4 | 5 | 6 | 7 | - [Alfred Quick Translate](#alfred-quick-translate) 8 | - [Features](#features) 9 | - [Install](#install) 10 | - [Language and translation engine settings](#language-and-translation-engine-settings) 11 | - [When using DeepL](#when-using-deepl) 12 | - [Hotkey settings.](#hotkey-settings) 13 | - [Usage](#usage) 14 | - [When you want a quick translation](#when-you-want-a-quick-translation) 15 | - [When you want to translate and search on Google](#when-you-want-to-translate-and-search-on-google) 16 | - [When you want to select and translate text](#when-you-want-to-select-and-translate-text) 17 | 18 | 19 | 20 | 21 | # Alfred Quick Translate 22 | - Translations for [Alfred 5](https://www.alfredapp.com/) Workflow. (*Powerpack is required.) 23 | - This workflow uses [translate-shell](https://github.com/soimort/translate-shell). 24 | - Icon is [iconfinder](https://www.iconfinder.com/icons/1249992/google_media_network_search_social_icon#size=128). 25 | - You can choose a translation engine. 26 | - Google(default), DeepL 27 | - If you use DeepL, you need to register with [DeepL API](https://www.deepl.com/pro#developer) to get the key. 28 | - You can now choose which language to translate into 29 | - Language code ([Google](https://github.com/soimort/translate-shell/wiki/Languages), [DeepL](https://www.deepl.com/docs-api/translating-text/)) 30 | 31 | 32 | ## Features 33 | Translate and paste the text 34 | 35 | 36 | 37 | Translate and search directly 38 | 39 | 40 | 41 | Selecting and translating text 42 | 43 | 44 | 45 | Automatic saving of translated logs (`~/translate_log2.yml`) 46 | 47 | 48 | 49 | Since the log file is in Yaml, you can parse it with the yq command. 50 | 51 | ```sh 52 | $ brew install python-yq 53 | $ cat ~/translate2_log.yml | yq . 54 | ``` 55 | 56 | 57 | 58 | Automatically saves to the clipboard as well.
59 | The clipboard feature of Alfred is useful for searching the history. 60 | 61 | 62 | 63 | No matter which features you use, the pre- and post-translation texts are stored in the log file, and it automatically saved the clipboard both. 64 | 65 | ## Install 66 | 67 | 1: Install [Alfred](https://www.alfredapp.com/), buy Powerpack and activate it. 68 | 69 | 2: Installing various commands 70 | 71 | ```shell 72 | brew install translate-shell jq coreutils curl 73 | ``` 74 | 75 | 3: Download `quick-translate.alfredworkflow` from [releases](https://github.com/nkmr-jp/alfred-quick-translate/releases) 76 | 77 | 78 | 79 | 4: Click on the downloaded `quick-translate.alfredworkflow` to open it and click on `import` to launch Alfred. 80 | 81 | 82 | 83 | ## Language and translation engine settings 84 | After installing the workflow, click on the icon in the upper right corner to open the configuration screen. This screen allows you to select a translation engine and language. See `About the Workflow` on the left for more configuration information. 85 | 86 | 87 | 88 | 89 | ### When using DeepL 90 | 1. Register with [DeepL API](https://www.deepl.com/pro#developer) to get the API key. 91 | 2. Type `deepl` in the `engine` and Enter the API key in the `deepl_api_key`. 92 | 93 | ## Hotkey settings. 94 | From Workflows in Alfred's Preferences When you open `Quick Translate`, you can set a hotkey for each feature like this. 95 | Initially, Hotkey is blank, so you can assign a key of your choice and use it 96 | 97 | 98 | 99 | 100 | ## Usage 101 | ### When you want a quick translation 102 | Launch the translation launcher with the key you assigned in the Hotkey settings. As you type in the text, it translates in real-time. 103 | You can press `Enter` to paste the translation into an editor. 104 | 105 | 106 | 107 | 108 | ### When you want to translate and search on Google 109 | 110 | Launch the translation launcher with the key you assigned in the Hotkey settings. 111 | After typing the text in the translation launcher, 112 | You can Google the translated text with `cmd + Enter`. 113 | 114 | 115 | 116 | 117 | ### When you want to select and translate text 118 | Select the text you want to translate and enter the key you assigned to Hotkey. 119 | 120 | 121 | 122 | When in the browser, you can use Google Translate. 123 | But if you use Alfred Quick Transrate, when you want to read comments on the source code of not the native language, and useful when you want to translate chat messages and so on immediately. 124 | 125 | -------------------------------------------------------------------------------- /src/info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | bundleid 6 | alfred-quick-translate 7 | connections 8 | 9 | 09E1E8B9-E7A2-4D97-9E82-3233172F0A91 10 | 11 | 12 | destinationuid 13 | AFF4720E-B980-42D2-88D7-3C8F5AE2BB15 14 | modifiers 15 | 0 16 | modifiersubtext 17 | 18 | vitoclose 19 | 20 | 21 | 22 | 1B5E2D56-7237-4203-9373-8DE982B0E0D1 23 | 24 | 25 | destinationuid 26 | 4359C129-900A-4B45-AC1C-7810C9C534BF 27 | modifiers 28 | 524288 29 | modifiersubtext 30 | Copy to clipboard 31 | vitoclose 32 | 33 | 34 | 35 | destinationuid 36 | F402F3A5-63BB-4F74-BD15-8123558EB3F6 37 | modifiers 38 | 0 39 | modifiersubtext 40 | 41 | vitoclose 42 | 43 | 44 | 45 | destinationuid 46 | D1AD1096-41AD-4668-BD57-C890F9DDAE65 47 | modifiers 48 | 1048576 49 | modifiersubtext 50 | Search in google ( lang: {var:native_lang} ) 51 | vitoclose 52 | 53 | 54 | 55 | 1F011D4E-0137-4930-AEB4-155AC561026D 56 | 57 | 58 | destinationuid 59 | 228A2A60-7056-4984-9639-D5658BAC1D9E 60 | modifiers 61 | 1048576 62 | modifiersubtext 63 | Search in google ( lang: {var:foreign_lang} ) 64 | vitoclose 65 | 66 | 67 | 68 | destinationuid 69 | 4359C129-900A-4B45-AC1C-7810C9C534BF 70 | modifiers 71 | 524288 72 | modifiersubtext 73 | Copy to clipboard 74 | vitoclose 75 | 76 | 77 | 78 | destinationuid 79 | F402F3A5-63BB-4F74-BD15-8123558EB3F6 80 | modifiers 81 | 0 82 | modifiersubtext 83 | 84 | vitoclose 85 | 86 | 87 | 88 | 228A2A60-7056-4984-9639-D5658BAC1D9E 89 | 90 | 91 | destinationuid 92 | 4359C129-900A-4B45-AC1C-7810C9C534BF 93 | modifiers 94 | 0 95 | modifiersubtext 96 | 97 | vitoclose 98 | 99 | 100 | 101 | 22C5CD97-ADE8-453E-B0A4-F00654CDD445 102 | 103 | 104 | destinationuid 105 | 7F3DC3DA-AF5C-4973-A542-1D8813FE0D32 106 | modifiers 107 | 0 108 | modifiersubtext 109 | 110 | vitoclose 111 | 112 | 113 | 114 | 25D8F3FB-6532-413B-8F14-D94A12D0FE8C 115 | 116 | 117 | destinationuid 118 | 1F011D4E-0137-4930-AEB4-155AC561026D 119 | modifiers 120 | 0 121 | modifiersubtext 122 | 123 | vitoclose 124 | 125 | 126 | 127 | 297B243E-50AC-45B0-A068-60AE7719FD0A 128 | 129 | 130 | destinationuid 131 | 7C80F7AC-1408-4C03-8627-5CA0904D9253 132 | modifiers 133 | 0 134 | modifiersubtext 135 | 136 | vitoclose 137 | 138 | 139 | 140 | 2DB33E9B-FD0F-4716-9D9E-A996C59BB398 141 | 142 | 143 | destinationuid 144 | 7F83014B-812A-457B-9DBB-FA56CC2F8EDE 145 | modifiers 146 | 0 147 | modifiersubtext 148 | 149 | vitoclose 150 | 151 | 152 | 153 | 2EE8AAFA-5132-4C9B-9A3B-5C05F5C093D6 154 | 155 | 156 | destinationuid 157 | 25D8F3FB-6532-413B-8F14-D94A12D0FE8C 158 | modifiers 159 | 0 160 | modifiersubtext 161 | 162 | vitoclose 163 | 164 | 165 | 166 | 2F9CA794-B73D-4681-91F7-C085DB042D1D 167 | 168 | 169 | destinationuid 170 | 3E246508-69FA-46F0-85C0-8FB59BBC7ADD 171 | modifiers 172 | 0 173 | modifiersubtext 174 | 175 | vitoclose 176 | 177 | 178 | 179 | 31600DAD-FC8B-4AFC-BFF1-F74DE9B316DE 180 | 181 | 182 | destinationuid 183 | 737238EF-AFCC-43D3-A087-80FDE8BCAE50 184 | modifiers 185 | 0 186 | modifiersubtext 187 | 188 | vitoclose 189 | 190 | 191 | 192 | 3246C05F-EAD0-4C1A-A58F-880C7672A28D 193 | 194 | 195 | destinationuid 196 | A788A69B-39BF-44EA-BB2E-C37D184B0665 197 | modifiers 198 | 0 199 | modifiersubtext 200 | 201 | vitoclose 202 | 203 | 204 | 205 | 3529227E-21E4-41D1-8E3E-AB6455398B8B 206 | 207 | 208 | destinationuid 209 | 3E1442AF-52EA-4020-804C-8129EF2A7C12 210 | modifiers 211 | 0 212 | modifiersubtext 213 | 214 | vitoclose 215 | 216 | 217 | 218 | 3E1442AF-52EA-4020-804C-8129EF2A7C12 219 | 220 | 221 | destinationuid 222 | 915AC19E-ED7A-4F29-845E-60F49638FA85 223 | modifiers 224 | 0 225 | modifiersubtext 226 | 227 | vitoclose 228 | 229 | 230 | 231 | 3E246508-69FA-46F0-85C0-8FB59BBC7ADD 232 | 233 | 234 | destinationuid 235 | 2EE8AAFA-5132-4C9B-9A3B-5C05F5C093D6 236 | modifiers 237 | 0 238 | modifiersubtext 239 | 240 | vitoclose 241 | 242 | 243 | 244 | 4359C129-900A-4B45-AC1C-7810C9C534BF 245 | 246 | 247 | destinationuid 248 | AC6BCD9F-E6CA-4C4A-9E87-621B88DA8678 249 | modifiers 250 | 0 251 | modifiersubtext 252 | 253 | vitoclose 254 | 255 | 256 | 257 | 61A4C79E-8CF2-42F6-AF5F-F6DEA01EB52C 258 | 259 | 260 | destinationuid 261 | 09E1E8B9-E7A2-4D97-9E82-3233172F0A91 262 | modifiers 263 | 0 264 | modifiersubtext 265 | 266 | vitoclose 267 | 268 | 269 | 270 | 682D1F7F-6C57-4135-9C80-2947256E73AB 271 | 272 | 273 | destinationuid 274 | E4D2CA9E-A247-4F1E-A561-1B408624D312 275 | modifiers 276 | 0 277 | modifiersubtext 278 | 279 | vitoclose 280 | 281 | 282 | 283 | 737238EF-AFCC-43D3-A087-80FDE8BCAE50 284 | 285 | 286 | destinationuid 287 | 75BC4038-771A-4194-B655-75CB4722E86A 288 | modifiers 289 | 0 290 | modifiersubtext 291 | 292 | vitoclose 293 | 294 | 295 | 296 | 73C23B5B-061C-4090-B041-6CC93E3CE5C7 297 | 298 | 299 | destinationuid 300 | DB0C4C7C-5CD8-4314-9F5A-6A78F447BD66 301 | modifiers 302 | 0 303 | modifiersubtext 304 | 305 | vitoclose 306 | 307 | 308 | 309 | 75BC4038-771A-4194-B655-75CB4722E86A 310 | 311 | 312 | destinationuid 313 | 297B243E-50AC-45B0-A068-60AE7719FD0A 314 | modifiers 315 | 0 316 | modifiersubtext 317 | 318 | vitoclose 319 | 320 | 321 | 322 | 7C80F7AC-1408-4C03-8627-5CA0904D9253 323 | 324 | 325 | destinationuid 326 | 85DB4F11-AF27-459E-8D1A-982820923EE1 327 | modifiers 328 | 0 329 | modifiersubtext 330 | 331 | vitoclose 332 | 333 | 334 | 335 | 7F3DC3DA-AF5C-4973-A542-1D8813FE0D32 336 | 337 | 338 | destinationuid 339 | BBA75C58-EE9D-4A56-AB81-6B589EA6B13E 340 | modifiers 341 | 0 342 | modifiersubtext 343 | 344 | vitoclose 345 | 346 | 347 | 348 | 7F83014B-812A-457B-9DBB-FA56CC2F8EDE 349 | 350 | 351 | destinationuid 352 | 682D1F7F-6C57-4135-9C80-2947256E73AB 353 | modifiers 354 | 0 355 | modifiersubtext 356 | 357 | vitoclose 358 | 359 | 360 | 361 | 808FF62C-FBD1-4D96-92F4-9D660A899A51 362 | 363 | 364 | destinationuid 365 | 97671326-8FC7-4638-9AD8-37EE1F5B35FC 366 | modifiers 367 | 0 368 | modifiersubtext 369 | 370 | vitoclose 371 | 372 | 373 | 374 | 85DB4F11-AF27-459E-8D1A-982820923EE1 375 | 376 | 377 | destinationuid 378 | 99F41E36-7F5C-41AD-8220-0A5C955C3DE7 379 | modifiers 380 | 0 381 | modifiersubtext 382 | 383 | vitoclose 384 | 385 | 386 | 387 | 915AC19E-ED7A-4F29-845E-60F49638FA85 388 | 389 | 390 | destinationuid 391 | F59E4CBD-56FB-4E8C-A916-7B2657BD8B26 392 | modifiers 393 | 0 394 | modifiersubtext 395 | 396 | vitoclose 397 | 398 | 399 | 400 | 97671326-8FC7-4638-9AD8-37EE1F5B35FC 401 | 402 | 403 | destinationuid 404 | B12F6DB7-05E8-4DA6-8ECA-E77EB6B5FE43 405 | modifiers 406 | 0 407 | modifiersubtext 408 | 409 | vitoclose 410 | 411 | 412 | 413 | 99F41E36-7F5C-41AD-8220-0A5C955C3DE7 414 | 415 | 416 | destinationuid 417 | D3DB04C0-F3BF-481E-BAEE-AA58D7A8A67A 418 | modifiers 419 | 0 420 | modifiersubtext 421 | 422 | vitoclose 423 | 424 | 425 | 426 | 9AF84FF3-6752-4951-81F4-C5F8E7C8FB23 427 | 428 | 429 | destinationuid 430 | 73C23B5B-061C-4090-B041-6CC93E3CE5C7 431 | modifiers 432 | 0 433 | modifiersubtext 434 | 435 | vitoclose 436 | 437 | 438 | 439 | A788A69B-39BF-44EA-BB2E-C37D184B0665 440 | 441 | 442 | destinationuid 443 | 31600DAD-FC8B-4AFC-BFF1-F74DE9B316DE 444 | modifiers 445 | 0 446 | modifiersubtext 447 | 448 | vitoclose 449 | 450 | 451 | 452 | AC6BCD9F-E6CA-4C4A-9E87-621B88DA8678 453 | 454 | 455 | destinationuid 456 | 97671326-8FC7-4638-9AD8-37EE1F5B35FC 457 | modifiers 458 | 0 459 | modifiersubtext 460 | 461 | vitoclose 462 | 463 | 464 | 465 | AFF4720E-B980-42D2-88D7-3C8F5AE2BB15 466 | 467 | 468 | destinationuid 469 | 3246C05F-EAD0-4C1A-A58F-880C7672A28D 470 | modifiers 471 | 0 472 | modifiersubtext 473 | 474 | vitoclose 475 | 476 | 477 | 478 | B12F6DB7-05E8-4DA6-8ECA-E77EB6B5FE43 479 | 480 | 481 | destinationuid 482 | 66DF7C80-DC96-4716-965B-FD3631B87BE6 483 | modifiers 484 | 0 485 | modifiersubtext 486 | 487 | vitoclose 488 | 489 | 490 | 491 | B40D456F-72CD-4ABD-912B-A90E6BE38292 492 | 493 | 494 | destinationuid 495 | FB05B7A1-B907-4F8D-A64A-7B9FAE8E9F16 496 | modifiers 497 | 0 498 | modifiersubtext 499 | 500 | vitoclose 501 | 502 | 503 | 504 | BBA75C58-EE9D-4A56-AB81-6B589EA6B13E 505 | 506 | 507 | destinationuid 508 | 61A4C79E-8CF2-42F6-AF5F-F6DEA01EB52C 509 | modifiers 510 | 0 511 | modifiersubtext 512 | 513 | vitoclose 514 | 515 | 516 | 517 | D1AD1096-41AD-4668-BD57-C890F9DDAE65 518 | 519 | 520 | destinationuid 521 | 4359C129-900A-4B45-AC1C-7810C9C534BF 522 | modifiers 523 | 0 524 | modifiersubtext 525 | 526 | vitoclose 527 | 528 | 529 | 530 | D3D26BCE-9E67-4E1D-BDA5-3CF34C3155BD 531 | 532 | 533 | destinationuid 534 | DFA97F43-A312-45FA-9206-762301F7CE72 535 | modifiers 536 | 0 537 | modifiersubtext 538 | 539 | vitoclose 540 | 541 | 542 | 543 | D3DB04C0-F3BF-481E-BAEE-AA58D7A8A67A 544 | 545 | 546 | destinationuid 547 | 808FF62C-FBD1-4D96-92F4-9D660A899A51 548 | modifiers 549 | 0 550 | modifiersubtext 551 | 552 | vitoclose 553 | 554 | 555 | 556 | DB0C4C7C-5CD8-4314-9F5A-6A78F447BD66 557 | 558 | 559 | destinationuid 560 | AFF4720E-B980-42D2-88D7-3C8F5AE2BB15 561 | modifiers 562 | 0 563 | modifiersubtext 564 | 565 | vitoclose 566 | 567 | 568 | 569 | DFA97F43-A312-45FA-9206-762301F7CE72 570 | 571 | 572 | destinationuid 573 | 22C5CD97-ADE8-453E-B0A4-F00654CDD445 574 | modifiers 575 | 0 576 | modifiersubtext 577 | 578 | vitoclose 579 | 580 | 581 | 582 | E4D2CA9E-A247-4F1E-A561-1B408624D312 583 | 584 | 585 | destinationuid 586 | 9AF84FF3-6752-4951-81F4-C5F8E7C8FB23 587 | modifiers 588 | 0 589 | modifiersubtext 590 | 591 | vitoclose 592 | 593 | 594 | 595 | F402F3A5-63BB-4F74-BD15-8123558EB3F6 596 | 597 | 598 | destinationuid 599 | 4359C129-900A-4B45-AC1C-7810C9C534BF 600 | modifiers 601 | 0 602 | modifiersubtext 603 | 604 | vitoclose 605 | 606 | 607 | 608 | F59E4CBD-56FB-4E8C-A916-7B2657BD8B26 609 | 610 | 611 | destinationuid 612 | 1B5E2D56-7237-4203-9373-8DE982B0E0D1 613 | modifiers 614 | 0 615 | modifiersubtext 616 | 617 | vitoclose 618 | 619 | 620 | 621 | FB05B7A1-B907-4F8D-A64A-7B9FAE8E9F16 622 | 623 | 624 | destinationuid 625 | 45048829-3C98-4B44-93AA-D34F7D88CD3B 626 | modifiers 627 | 0 628 | modifiersubtext 629 | 630 | vitoclose 631 | 632 | 633 | 634 | 635 | createdby 636 | nkmr-jp 637 | description 638 | You can: translate and paste text / translate and search / select and translate text / translation history Logging and copying to the clipboard; できること: 翻訳してテキストを貼り付け / 翻訳して検索 / テキストを選択して翻訳 / 翻訳履歴のログ保存とクリップボードへのコピー 639 | disabled 640 | 641 | name 642 | Quick Translate (v2.1.0) 643 | objects 644 | 645 | 646 | config 647 | 648 | concurrently 649 | 650 | escaping 651 | 102 652 | script 653 | PATH=$PATH:/usr/local/bin:/opt/homebrew/bin 654 | DATETIME=$(gdate "+%y%m%d_%H%M%S_%3N") 655 | echo -n ${DATETIME} 656 | scriptargtype 657 | 1 658 | scriptfile 659 | switch.sh 660 | type 661 | 8 662 | 663 | type 664 | alfred.workflow.action.script 665 | uid 666 | FB05B7A1-B907-4F8D-A64A-7B9FAE8E9F16 667 | version 668 | 2 669 | 670 | 671 | config 672 | 673 | alignment 674 | 2 675 | backgroundcolor 676 | 677 | fadespeed 678 | 0 679 | fillmode 680 | 0 681 | font 682 | System 683 | ignoredynamicplaceholders 684 | 685 | largetypetext 686 | ........................................... 687 | foreign language setting 688 | 689 | {query} 690 | 691 | ........................................... 692 | textcolor 693 | 694 | wrapat 695 | 50 696 | 697 | type 698 | alfred.workflow.output.largetype 699 | uid 700 | 45048829-3C98-4B44-93AA-D34F7D88CD3B 701 | version 702 | 3 703 | 704 | 705 | config 706 | 707 | action 708 | 0 709 | argument 710 | 0 711 | focusedappvariable 712 | 713 | focusedappvariablename 714 | 715 | hotkey 716 | 8 717 | hotmod 718 | 524288 719 | hotstring 720 | C 721 | leftcursor 722 | 723 | modsmode 724 | 0 725 | relatedAppsMode 726 | 0 727 | 728 | type 729 | alfred.workflow.trigger.hotkey 730 | uid 731 | B40D456F-72CD-4ABD-912B-A90E6BE38292 732 | version 733 | 2 734 | 735 | 736 | config 737 | 738 | concurrently 739 | 740 | escaping 741 | 102 742 | script 743 | #!/bin/bash 744 | tmp_file=/tmp/quick_translate_tmp 745 | langs=($(echo "$foreign_lang" | tr ',' '\n')) 746 | 747 | if [ -e $tmp_file ]; then 748 | current=$(cat $tmp_file) 749 | else 750 | current="${langs[0]}" 751 | fi 752 | echo -n "$current" 753 | scriptargtype 754 | 1 755 | scriptfile 756 | load.sh 757 | type 758 | 8 759 | 760 | type 761 | alfred.workflow.action.script 762 | uid 763 | 3E246508-69FA-46F0-85C0-8FB59BBC7ADD 764 | version 765 | 2 766 | 767 | 768 | config 769 | 770 | alfredfiltersresults 771 | 772 | alfredfiltersresultsmatchmode 773 | 0 774 | argumenttreatemptyqueryasnil 775 | 776 | argumenttrimmode 777 | 0 778 | argumenttype 779 | 0 780 | escaping 781 | 102 782 | queuedelaycustom 783 | 3 784 | queuedelayimmediatelyinitially 785 | 786 | queuedelaymode 787 | 0 788 | queuemode 789 | 1 790 | runningsubtext 791 | Translating... 792 | script 793 | PATH=$PATH:/usr/local/bin:/opt/homebrew/bin 794 | TRANS=`trans -b "{query}"` 795 | 796 | cat << EOB 797 | { 798 | "variables": { 799 | "input": "{query}", 800 | "output": "${TRANS}", 801 | "prefix": "ja2en" 802 | }, 803 | "items": [ 804 | { 805 | "uid": "eg1", 806 | "title": "${TRANS}", 807 | "subtitle": "{query}", 808 | "arg": "${TRANS}" 809 | } 810 | ] 811 | } 812 | EOB 813 | scriptargtype 814 | 1 815 | scriptfile 816 | translate.sh 817 | subtext 818 | {var:native_lang} → {var:foreign_lang} ( engine: {var:engine} ) 819 | title 820 | Quick Translate 821 | type 822 | 8 823 | withspace 824 | 825 | 826 | type 827 | alfred.workflow.input.scriptfilter 828 | uid 829 | 1F011D4E-0137-4930-AEB4-155AC561026D 830 | version 831 | 3 832 | 833 | 834 | config 835 | 836 | concurrently 837 | 838 | escaping 839 | 102 840 | script 841 | echo -n "" 842 | scriptargtype 843 | 1 844 | scriptfile 845 | 846 | type 847 | 0 848 | 849 | type 850 | alfred.workflow.action.script 851 | uid 852 | 25D8F3FB-6532-413B-8F14-D94A12D0FE8C 853 | version 854 | 2 855 | 856 | 857 | config 858 | 859 | action 860 | 0 861 | argument 862 | 0 863 | focusedappvariable 864 | 865 | focusedappvariablename 866 | 867 | hotkey 868 | 1 869 | hotmod 870 | 524288 871 | hotstring 872 | S 873 | leftcursor 874 | 875 | modsmode 876 | 0 877 | relatedAppsMode 878 | 0 879 | 880 | type 881 | alfred.workflow.trigger.hotkey 882 | uid 883 | 2F9CA794-B73D-4681-91F7-C085DB042D1D 884 | version 885 | 2 886 | 887 | 888 | config 889 | 890 | browser 891 | 892 | spaces 893 | 894 | url 895 | https://www.google.com/search?q={var:output}&hl={var:foreign_lang} 896 | utf8 897 | 898 | 899 | type 900 | alfred.workflow.action.openurl 901 | uid 902 | 228A2A60-7056-4984-9639-D5658BAC1D9E 903 | version 904 | 1 905 | 906 | 907 | config 908 | 909 | argument 910 | {query} 911 | passthroughargument 912 | 913 | variables 914 | 915 | foreign_lang 916 | {query} 917 | lang 918 | {var:native_lang}2{query} 919 | script_type 920 | filter 921 | 922 | 923 | type 924 | alfred.workflow.utility.argument 925 | uid 926 | 2EE8AAFA-5132-4C9B-9A3B-5C05F5C093D6 927 | version 928 | 1 929 | 930 | 931 | config 932 | 933 | adduuid 934 | 935 | allowemptyfiles 936 | 937 | createintermediatefolders 938 | 939 | filename 940 | {var:log_file} 941 | filetext 942 | {var:key}: 943 | engine: "{var:engine}" 944 | in: "{var:input}" 945 | out: "{var:output}" 946 | ignoredynamicplaceholders 947 | 948 | relativepathmode 949 | 0 950 | type 951 | 2 952 | 953 | type 954 | alfred.workflow.output.writefile 955 | uid 956 | 66DF7C80-DC96-4716-965B-FD3631B87BE6 957 | version 958 | 1 959 | 960 | 961 | config 962 | 963 | autopaste 964 | 965 | clipboardtext 966 | 967 | ignoredynamicplaceholders 968 | 969 | transient 970 | 971 | 972 | type 973 | alfred.workflow.output.clipboard 974 | uid 975 | F402F3A5-63BB-4F74-BD15-8123558EB3F6 976 | version 977 | 3 978 | 979 | 980 | config 981 | 982 | concurrently 983 | 984 | escaping 985 | 102 986 | script 987 | PATH=$PATH:/usr/local/bin:/opt/homebrew/bin 988 | DATETIME=$(gdate "+%y%m%d_%H%M%S_%3N") 989 | echo -n ${DATETIME} 990 | scriptargtype 991 | 1 992 | scriptfile 993 | 994 | type 995 | 0 996 | 997 | type 998 | alfred.workflow.action.script 999 | uid 1000 | 97671326-8FC7-4638-9AD8-37EE1F5B35FC 1001 | version 1002 | 2 1003 | 1004 | 1005 | config 1006 | 1007 | autopaste 1008 | 1009 | clipboardtext 1010 | {var:input} 1011 | ignoredynamicplaceholders 1012 | 1013 | transient 1014 | 1015 | 1016 | type 1017 | alfred.workflow.output.clipboard 1018 | uid 1019 | 4359C129-900A-4B45-AC1C-7810C9C534BF 1020 | version 1021 | 3 1022 | 1023 | 1024 | config 1025 | 1026 | autopaste 1027 | 1028 | clipboardtext 1029 | {var:output} 1030 | ignoredynamicplaceholders 1031 | 1032 | transient 1033 | 1034 | 1035 | type 1036 | alfred.workflow.output.clipboard 1037 | uid 1038 | AC6BCD9F-E6CA-4C4A-9E87-621B88DA8678 1039 | version 1040 | 3 1041 | 1042 | 1043 | config 1044 | 1045 | argument 1046 | {query} 1047 | passthroughargument 1048 | 1049 | variables 1050 | 1051 | key 1052 | {var:lang}_{query} 1053 | 1054 | 1055 | type 1056 | alfred.workflow.utility.argument 1057 | uid 1058 | B12F6DB7-05E8-4DA6-8ECA-E77EB6B5FE43 1059 | version 1060 | 1 1061 | 1062 | 1063 | config 1064 | 1065 | browser 1066 | 1067 | spaces 1068 | 1069 | url 1070 | https://www.google.com/search?q={var:output}&hl={var:native_lang} 1071 | utf8 1072 | 1073 | 1074 | type 1075 | alfred.workflow.action.openurl 1076 | uid 1077 | D1AD1096-41AD-4668-BD57-C890F9DDAE65 1078 | version 1079 | 1 1080 | 1081 | 1082 | config 1083 | 1084 | action 1085 | 0 1086 | argument 1087 | 0 1088 | focusedappvariable 1089 | 1090 | focusedappvariablename 1091 | 1092 | hotkey 1093 | 1 1094 | hotmod 1095 | 1572864 1096 | hotstring 1097 | S 1098 | leftcursor 1099 | 1100 | modsmode 1101 | 0 1102 | relatedAppsMode 1103 | 0 1104 | 1105 | type 1106 | alfred.workflow.trigger.hotkey 1107 | uid 1108 | 3529227E-21E4-41D1-8E3E-AB6455398B8B 1109 | version 1110 | 2 1111 | 1112 | 1113 | config 1114 | 1115 | alfredfiltersresults 1116 | 1117 | alfredfiltersresultsmatchmode 1118 | 0 1119 | argumenttreatemptyqueryasnil 1120 | 1121 | argumenttrimmode 1122 | 0 1123 | argumenttype 1124 | 0 1125 | escaping 1126 | 102 1127 | queuedelaycustom 1128 | 3 1129 | queuedelayimmediatelyinitially 1130 | 1131 | queuedelaymode 1132 | 0 1133 | queuemode 1134 | 1 1135 | runningsubtext 1136 | Tlanslating... 1137 | script 1138 | PATH=$PATH:/usr/local/bin:/opt/homebrew/bin 1139 | TRANS=`trans :ja -b "{query}"` 1140 | 1141 | cat << EOB 1142 | { 1143 | "variables": { 1144 | "input": "{query}", 1145 | "output": "${TRANS}", 1146 | "prefix": "en2ja" 1147 | }, 1148 | "items": [ 1149 | { 1150 | "uid": "eg1", 1151 | "title": "${TRANS}", 1152 | "subtitle": "{query}", 1153 | "arg": "${TRANS}" 1154 | } 1155 | ] 1156 | } 1157 | EOB 1158 | scriptargtype 1159 | 1 1160 | scriptfile 1161 | translate.sh 1162 | subtext 1163 | {var:foreign_lang} → {var:native_lang} (engine: {var:engine}) 1164 | title 1165 | Quick Translate 1166 | type 1167 | 8 1168 | withspace 1169 | 1170 | 1171 | type 1172 | alfred.workflow.input.scriptfilter 1173 | uid 1174 | 1B5E2D56-7237-4203-9373-8DE982B0E0D1 1175 | version 1176 | 3 1177 | 1178 | 1179 | config 1180 | 1181 | concurrently 1182 | 1183 | escaping 1184 | 102 1185 | script 1186 | #!/bin/bash 1187 | tmp_file=/tmp/quick_translate_tmp 1188 | langs=($(echo "$foreign_lang" | tr ',' '\n')) 1189 | 1190 | if [ -e $tmp_file ]; then 1191 | current=$(cat $tmp_file) 1192 | else 1193 | current="${langs[0]}" 1194 | fi 1195 | echo -n "$current" 1196 | scriptargtype 1197 | 1 1198 | scriptfile 1199 | load.sh 1200 | type 1201 | 8 1202 | 1203 | type 1204 | alfred.workflow.action.script 1205 | uid 1206 | 3E1442AF-52EA-4020-804C-8129EF2A7C12 1207 | version 1208 | 2 1209 | 1210 | 1211 | config 1212 | 1213 | concurrently 1214 | 1215 | escaping 1216 | 102 1217 | script 1218 | echo -n "" 1219 | scriptargtype 1220 | 1 1221 | scriptfile 1222 | 1223 | type 1224 | 0 1225 | 1226 | type 1227 | alfred.workflow.action.script 1228 | uid 1229 | F59E4CBD-56FB-4E8C-A916-7B2657BD8B26 1230 | version 1231 | 2 1232 | 1233 | 1234 | config 1235 | 1236 | argument 1237 | {query} 1238 | passthroughargument 1239 | 1240 | variables 1241 | 1242 | foreign_lang 1243 | {query} 1244 | lang 1245 | {query}2{var:native_lang} 1246 | script_type 1247 | filter 1248 | 1249 | 1250 | type 1251 | alfred.workflow.utility.argument 1252 | uid 1253 | 915AC19E-ED7A-4F29-845E-60F49638FA85 1254 | version 1255 | 1 1256 | 1257 | 1258 | config 1259 | 1260 | action 1261 | 0 1262 | argument 1263 | 1 1264 | focusedappvariable 1265 | 1266 | focusedappvariablename 1267 | 1268 | hotkey 1269 | 7 1270 | hotmod 1271 | 1572864 1272 | hotstring 1273 | X 1274 | leftcursor 1275 | 1276 | modsmode 1277 | 0 1278 | relatedAppsMode 1279 | 0 1280 | 1281 | type 1282 | alfred.workflow.trigger.hotkey 1283 | uid 1284 | D3D26BCE-9E67-4E1D-BDA5-3CF34C3155BD 1285 | version 1286 | 2 1287 | 1288 | 1289 | config 1290 | 1291 | concurrently 1292 | 1293 | escaping 1294 | 102 1295 | script 1296 | #!/bin/bash 1297 | tmp_file=/tmp/quick_translate_tmp 1298 | langs=($(echo "$foreign_lang" | tr ',' '\n')) 1299 | 1300 | if [ -e $tmp_file ]; then 1301 | current=$(cat $tmp_file) 1302 | else 1303 | current="${langs[0]}" 1304 | fi 1305 | echo -n "$current" 1306 | scriptargtype 1307 | 1 1308 | scriptfile 1309 | load.sh 1310 | type 1311 | 8 1312 | 1313 | type 1314 | alfred.workflow.action.script 1315 | uid 1316 | 61A4C79E-8CF2-42F6-AF5F-F6DEA01EB52C 1317 | version 1318 | 2 1319 | 1320 | 1321 | config 1322 | 1323 | matchmode 1324 | 0 1325 | matchstring 1326 | " 1327 | replacestring 1328 | ' 1329 | 1330 | type 1331 | alfred.workflow.utility.replace 1332 | uid 1333 | 22C5CD97-ADE8-453E-B0A4-F00654CDD445 1334 | version 1335 | 2 1336 | 1337 | 1338 | config 1339 | 1340 | argument 1341 | {query} 1342 | passthroughargument 1343 | 1344 | variables 1345 | 1346 | foreign_lang 1347 | {query} 1348 | lang 1349 | {var:native_lang}2{query} 1350 | script_type 1351 | run 1352 | 1353 | 1354 | type 1355 | alfred.workflow.utility.argument 1356 | uid 1357 | 09E1E8B9-E7A2-4D97-9E82-3233172F0A91 1358 | version 1359 | 1 1360 | 1361 | 1362 | config 1363 | 1364 | argument 1365 | {query} 1366 | passthroughargument 1367 | 1368 | variables 1369 | 1370 | input 1371 | {query} 1372 | 1373 | 1374 | type 1375 | alfred.workflow.utility.argument 1376 | uid 1377 | BBA75C58-EE9D-4A56-AB81-6B589EA6B13E 1378 | version 1379 | 1 1380 | 1381 | 1382 | config 1383 | 1384 | matchmode 1385 | 0 1386 | matchstring 1387 | ; 1388 | replacestring 1389 | . 1390 | 1391 | type 1392 | alfred.workflow.utility.replace 1393 | uid 1394 | 7F3DC3DA-AF5C-4973-A542-1D8813FE0D32 1395 | version 1396 | 2 1397 | 1398 | 1399 | config 1400 | 1401 | matchmode 1402 | 1 1403 | matchstring 1404 | \t 1405 | regexcaseinsensitive 1406 | 1407 | regexmultiline 1408 | 1409 | replacestring 1410 | 1411 | 1412 | type 1413 | alfred.workflow.utility.replace 1414 | uid 1415 | DFA97F43-A312-45FA-9206-762301F7CE72 1416 | version 1417 | 2 1418 | 1419 | 1420 | config 1421 | 1422 | concurrently 1423 | 1424 | escaping 1425 | 102 1426 | script 1427 | PATH=$PATH:/usr/local/bin:/opt/homebrew/bin 1428 | trans=`trans :ja -b "{query}"` 1429 | echo -n $trans 1430 | scriptargtype 1431 | 1 1432 | scriptfile 1433 | translate.sh 1434 | type 1435 | 8 1436 | 1437 | type 1438 | alfred.workflow.action.script 1439 | uid 1440 | A788A69B-39BF-44EA-BB2E-C37D184B0665 1441 | version 1442 | 2 1443 | 1444 | 1445 | config 1446 | 1447 | concurrently 1448 | 1449 | escaping 1450 | 102 1451 | script 1452 | lf=$'\\\x0A' 1453 | input=$(echo "$input" | sed 's/\. /'". $lf"'/g') 1454 | input=$(echo "$input" | sed 's/\。/'"。$lf"'/g') 1455 | echo -n "$input" 1456 | scriptargtype 1457 | 1 1458 | scriptfile 1459 | input.sh 1460 | type 1461 | 8 1462 | 1463 | type 1464 | alfred.workflow.action.script 1465 | uid 1466 | AFF4720E-B980-42D2-88D7-3C8F5AE2BB15 1467 | version 1468 | 2 1469 | 1470 | 1471 | config 1472 | 1473 | concurrently 1474 | 1475 | escaping 1476 | 102 1477 | script 1478 | lf=$'\\\x0A' 1479 | input=$(echo "$input" | sed 's/;/'"$lf"'/g') 1480 | echo -n "$input" 1481 | scriptargtype 1482 | 1 1483 | scriptfile 1484 | 1485 | type 1486 | 0 1487 | 1488 | type 1489 | alfred.workflow.action.script 1490 | uid 1491 | 75BC4038-771A-4194-B655-75CB4722E86A 1492 | version 1493 | 2 1494 | 1495 | 1496 | config 1497 | 1498 | autopaste 1499 | 1500 | clipboardtext 1501 | {var:input} 1502 | ignoredynamicplaceholders 1503 | 1504 | transient 1505 | 1506 | 1507 | type 1508 | alfred.workflow.output.clipboard 1509 | uid 1510 | 7C80F7AC-1408-4C03-8627-5CA0904D9253 1511 | version 1512 | 3 1513 | 1514 | 1515 | config 1516 | 1517 | autopaste 1518 | 1519 | clipboardtext 1520 | {var:output} 1521 | ignoredynamicplaceholders 1522 | 1523 | transient 1524 | 1525 | 1526 | type 1527 | alfred.workflow.output.clipboard 1528 | uid 1529 | 85DB4F11-AF27-459E-8D1A-982820923EE1 1530 | version 1531 | 3 1532 | 1533 | 1534 | config 1535 | 1536 | concurrently 1537 | 1538 | escaping 1539 | 102 1540 | script 1541 | view_input=$input 1542 | view_output=$output 1543 | 1544 | if [[ $input == "*。*" ]]; then 1545 | view_input=$(echo -n "$input" | fold -w 80) 1546 | fi 1547 | if [[ $output == "*。*" ]]; then 1548 | view_output=$(echo -n "$output" | fold -w 80) 1549 | fi 1550 | 1551 | if [[ "$view" == "output_only" ]]; then 1552 | echo -n "$view_input" 1553 | else 1554 | echo "-- INPUT --" 1555 | echo -n "$view_input" 1556 | echo "" 1557 | echo "" 1558 | echo "-- OUTPUT --" 1559 | echo -n "$view_output" 1560 | fi 1561 | scriptargtype 1562 | 1 1563 | scriptfile 1564 | view.sh 1565 | type 1566 | 8 1567 | 1568 | type 1569 | alfred.workflow.action.script 1570 | uid 1571 | 99F41E36-7F5C-41AD-8220-0A5C955C3DE7 1572 | version 1573 | 2 1574 | 1575 | 1576 | config 1577 | 1578 | alignment 1579 | 0 1580 | backgroundcolor 1581 | 1582 | fadespeed 1583 | 0 1584 | fillmode 1585 | 0 1586 | font 1587 | 1588 | ignoredynamicplaceholders 1589 | 1590 | largetypetext 1591 | {query} 1592 | textcolor 1593 | 1594 | wrapat 1595 | 70 1596 | 1597 | type 1598 | alfred.workflow.output.largetype 1599 | uid 1600 | D3DB04C0-F3BF-481E-BAEE-AA58D7A8A67A 1601 | version 1602 | 3 1603 | 1604 | 1605 | config 1606 | 1607 | argument 1608 | {query} 1609 | passthroughargument 1610 | 1611 | variables 1612 | 1613 | input 1614 | {query} 1615 | 1616 | 1617 | type 1618 | alfred.workflow.utility.argument 1619 | uid 1620 | 297B243E-50AC-45B0-A068-60AE7719FD0A 1621 | version 1622 | 1 1623 | 1624 | 1625 | config 1626 | 1627 | argument 1628 | {query} 1629 | passthroughargument 1630 | 1631 | variables 1632 | 1633 | output 1634 | {query} 1635 | 1636 | 1637 | type 1638 | alfred.workflow.utility.argument 1639 | uid 1640 | 737238EF-AFCC-43D3-A087-80FDE8BCAE50 1641 | version 1642 | 1 1643 | 1644 | 1645 | config 1646 | 1647 | matchmode 1648 | 0 1649 | matchstring 1650 | " 1651 | replacestring 1652 | ' 1653 | 1654 | type 1655 | alfred.workflow.utility.replace 1656 | uid 1657 | 31600DAD-FC8B-4AFC-BFF1-F74DE9B316DE 1658 | version 1659 | 2 1660 | 1661 | 1662 | config 1663 | 1664 | argument 1665 | {var:input} 1666 | {var:output} 1667 | passthroughargument 1668 | 1669 | variables 1670 | 1671 | 1672 | 1673 | input 1674 | {var:input} 1675 | output 1676 | {var:output} 1677 | 1678 | 1679 | type 1680 | alfred.workflow.utility.argument 1681 | uid 1682 | 808FF62C-FBD1-4D96-92F4-9D660A899A51 1683 | version 1684 | 1 1685 | 1686 | 1687 | config 1688 | 1689 | argument 1690 | {query} 1691 | passthroughargument 1692 | 1693 | variables 1694 | 1695 | input 1696 | {query} 1697 | 1698 | 1699 | type 1700 | alfred.workflow.utility.argument 1701 | uid 1702 | 3246C05F-EAD0-4C1A-A58F-880C7672A28D 1703 | version 1704 | 1 1705 | 1706 | 1707 | config 1708 | 1709 | action 1710 | 0 1711 | argument 1712 | 1 1713 | focusedappvariable 1714 | 1715 | focusedappvariablename 1716 | 1717 | hotkey 1718 | 7 1719 | hotmod 1720 | 524288 1721 | hotstring 1722 | X 1723 | leftcursor 1724 | 1725 | modsmode 1726 | 0 1727 | relatedAppsMode 1728 | 0 1729 | 1730 | type 1731 | alfred.workflow.trigger.hotkey 1732 | uid 1733 | 2DB33E9B-FD0F-4716-9D9E-A996C59BB398 1734 | version 1735 | 2 1736 | 1737 | 1738 | config 1739 | 1740 | concurrently 1741 | 1742 | escaping 1743 | 102 1744 | script 1745 | #!/bin/bash 1746 | tmp_file=/tmp/quick_translate_tmp 1747 | langs=($(echo "$foreign_lang" | tr ',' '\n')) 1748 | 1749 | if [ -e $tmp_file ]; then 1750 | current=$(cat $tmp_file) 1751 | else 1752 | current="${langs[0]}" 1753 | fi 1754 | echo -n "$current" 1755 | scriptargtype 1756 | 1 1757 | scriptfile 1758 | load.sh 1759 | type 1760 | 8 1761 | 1762 | type 1763 | alfred.workflow.action.script 1764 | uid 1765 | 73C23B5B-061C-4090-B041-6CC93E3CE5C7 1766 | version 1767 | 2 1768 | 1769 | 1770 | config 1771 | 1772 | matchmode 1773 | 1 1774 | matchstring 1775 | \t 1776 | regexcaseinsensitive 1777 | 1778 | regexmultiline 1779 | 1780 | replacestring 1781 | 1782 | 1783 | type 1784 | alfred.workflow.utility.replace 1785 | uid 1786 | 7F83014B-812A-457B-9DBB-FA56CC2F8EDE 1787 | version 1788 | 2 1789 | 1790 | 1791 | config 1792 | 1793 | matchmode 1794 | 0 1795 | matchstring 1796 | " 1797 | replacestring 1798 | ' 1799 | 1800 | type 1801 | alfred.workflow.utility.replace 1802 | uid 1803 | 682D1F7F-6C57-4135-9C80-2947256E73AB 1804 | version 1805 | 2 1806 | 1807 | 1808 | config 1809 | 1810 | argument 1811 | {query} 1812 | passthroughargument 1813 | 1814 | variables 1815 | 1816 | input 1817 | {query} 1818 | 1819 | 1820 | type 1821 | alfred.workflow.utility.argument 1822 | uid 1823 | 9AF84FF3-6752-4951-81F4-C5F8E7C8FB23 1824 | version 1825 | 1 1826 | 1827 | 1828 | config 1829 | 1830 | argument 1831 | {query} 1832 | passthroughargument 1833 | 1834 | variables 1835 | 1836 | foreign_lang 1837 | {query} 1838 | lang 1839 | {query}2{var:native_lang} 1840 | script_type 1841 | run 1842 | 1843 | 1844 | type 1845 | alfred.workflow.utility.argument 1846 | uid 1847 | DB0C4C7C-5CD8-4314-9F5A-6A78F447BD66 1848 | version 1849 | 1 1850 | 1851 | 1852 | config 1853 | 1854 | matchmode 1855 | 0 1856 | matchstring 1857 | ; 1858 | replacestring 1859 | . 1860 | 1861 | type 1862 | alfred.workflow.utility.replace 1863 | uid 1864 | E4D2CA9E-A247-4F1E-A561-1B408624D312 1865 | version 1866 | 2 1867 | 1868 | 1869 | readme 1870 | Workflow Enviromnet Variables: 1871 | deepl_api_key: null(default) 1872 | deepl_api_url: free(default), pro 1873 | engine: google(default), deepl 1874 | log_file: ~/translate2_log.yml(default) 1875 | native_lang: ja(default) 1876 | foreign_lang: en(default) 1877 | (it can be switched by setting multiple.) 1878 | (example: en,zh ) 1879 | view: input_output(default), output_only 1880 | 1881 | Langage codes: 1882 | Please refer to the following sites for language codes. 1883 | 1884 | Google: 1885 | https://github.com/soimort/translate-shell/wiki/Languages 1886 | 1887 | DeepL: 1888 | https://www.deepl.com/docs-api/translating-text/ 1889 | Note: 1890 | if you want to use deepl 1891 | you have to regist "DeepL API Pro" or "DeepL API Free" 1892 | https://www.deepl.com/pro-api 1893 | uidata 1894 | 1895 | 09E1E8B9-E7A2-4D97-9E82-3233172F0A91 1896 | 1897 | xpos 1898 | 575 1899 | ypos 1900 | 730 1901 | 1902 | 1B5E2D56-7237-4203-9373-8DE982B0E0D1 1903 | 1904 | xpos 1905 | 585 1906 | ypos 1907 | 505 1908 | 1909 | 1F011D4E-0137-4930-AEB4-155AC561026D 1910 | 1911 | xpos 1912 | 585 1913 | ypos 1914 | 330 1915 | 1916 | 228A2A60-7056-4984-9639-D5658BAC1D9E 1917 | 1918 | xpos 1919 | 1015 1920 | ypos 1921 | 330 1922 | 1923 | 22C5CD97-ADE8-453E-B0A4-F00654CDD445 1924 | 1925 | xpos 1926 | 260 1927 | ypos 1928 | 730 1929 | 1930 | 25D8F3FB-6532-413B-8F14-D94A12D0FE8C 1931 | 1932 | xpos 1933 | 435 1934 | ypos 1935 | 330 1936 | 1937 | 297B243E-50AC-45B0-A068-60AE7719FD0A 1938 | 1939 | xpos 1940 | 1270 1941 | ypos 1942 | 820 1943 | 1944 | 2DB33E9B-FD0F-4716-9D9E-A996C59BB398 1945 | 1946 | note 1947 | Translate selected text 1948 | from foreign_lang to native_lang 1949 | xpos 1950 | 65 1951 | ypos 1952 | 885 1953 | 1954 | 2EE8AAFA-5132-4C9B-9A3B-5C05F5C093D6 1955 | 1956 | xpos 1957 | 365 1958 | ypos 1959 | 360 1960 | 1961 | 2F9CA794-B73D-4681-91F7-C085DB042D1D 1962 | 1963 | note 1964 | Translate in launcher from native_lang to foreign_lang 1965 | xpos 1966 | 70 1967 | ypos 1968 | 330 1969 | 1970 | 31600DAD-FC8B-4AFC-BFF1-F74DE9B316DE 1971 | 1972 | xpos 1973 | 1000 1974 | ypos 1975 | 820 1976 | 1977 | 3246C05F-EAD0-4C1A-A58F-880C7672A28D 1978 | 1979 | xpos 1980 | 795 1981 | ypos 1982 | 820 1983 | 1984 | 3529227E-21E4-41D1-8E3E-AB6455398B8B 1985 | 1986 | note 1987 | Translate in launcher from foreign_lang to native_lang 1988 | xpos 1989 | 65 1990 | ypos 1991 | 505 1992 | 1993 | 3E1442AF-52EA-4020-804C-8129EF2A7C12 1994 | 1995 | xpos 1996 | 215 1997 | ypos 1998 | 505 1999 | 2000 | 3E246508-69FA-46F0-85C0-8FB59BBC7ADD 2001 | 2002 | xpos 2003 | 215 2004 | ypos 2005 | 330 2006 | 2007 | 4359C129-900A-4B45-AC1C-7810C9C534BF 2008 | 2009 | xpos 2010 | 1205 2011 | ypos 2012 | 415 2013 | 2014 | 45048829-3C98-4B44-93AA-D34F7D88CD3B 2015 | 2016 | xpos 2017 | 360 2018 | ypos 2019 | 150 2020 | 2021 | 61A4C79E-8CF2-42F6-AF5F-F6DEA01EB52C 2022 | 2023 | xpos 2024 | 435 2025 | ypos 2026 | 700 2027 | 2028 | 66DF7C80-DC96-4716-965B-FD3631B87BE6 2029 | 2030 | xpos 2031 | 2235 2032 | ypos 2033 | 415 2034 | 2035 | 682D1F7F-6C57-4135-9C80-2947256E73AB 2036 | 2037 | xpos 2038 | 260 2039 | ypos 2040 | 915 2041 | 2042 | 737238EF-AFCC-43D3-A087-80FDE8BCAE50 2043 | 2044 | xpos 2045 | 1065 2046 | ypos 2047 | 820 2048 | 2049 | 73C23B5B-061C-4090-B041-6CC93E3CE5C7 2050 | 2051 | xpos 2052 | 435 2053 | ypos 2054 | 885 2055 | 2056 | 75BC4038-771A-4194-B655-75CB4722E86A 2057 | 2058 | xpos 2059 | 1130 2060 | ypos 2061 | 790 2062 | 2063 | 7C80F7AC-1408-4C03-8627-5CA0904D9253 2064 | 2065 | xpos 2066 | 1340 2067 | ypos 2068 | 790 2069 | 2070 | 7F3DC3DA-AF5C-4973-A542-1D8813FE0D32 2071 | 2072 | xpos 2073 | 315 2074 | ypos 2075 | 730 2076 | 2077 | 7F83014B-812A-457B-9DBB-FA56CC2F8EDE 2078 | 2079 | xpos 2080 | 205 2081 | ypos 2082 | 915 2083 | 2084 | 808FF62C-FBD1-4D96-92F4-9D660A899A51 2085 | 2086 | xpos 2087 | 1910 2088 | ypos 2089 | 820 2090 | 2091 | 85DB4F11-AF27-459E-8D1A-982820923EE1 2092 | 2093 | xpos 2094 | 1485 2095 | ypos 2096 | 790 2097 | 2098 | 915AC19E-ED7A-4F29-845E-60F49638FA85 2099 | 2100 | xpos 2101 | 365 2102 | ypos 2103 | 535 2104 | 2105 | 97671326-8FC7-4638-9AD8-37EE1F5B35FC 2106 | 2107 | note 2108 | DateTime 2109 | xpos 2110 | 2015 2111 | ypos 2112 | 415 2113 | 2114 | 99F41E36-7F5C-41AD-8220-0A5C955C3DE7 2115 | 2116 | note 2117 | View 2118 | xpos 2119 | 1625 2120 | ypos 2121 | 790 2122 | 2123 | 9AF84FF3-6752-4951-81F4-C5F8E7C8FB23 2124 | 2125 | xpos 2126 | 375 2127 | ypos 2128 | 915 2129 | 2130 | A788A69B-39BF-44EA-BB2E-C37D184B0665 2131 | 2132 | note 2133 | Translate 2134 | xpos 2135 | 855 2136 | ypos 2137 | 790 2138 | 2139 | AC6BCD9F-E6CA-4C4A-9E87-621B88DA8678 2140 | 2141 | xpos 2142 | 1355 2143 | ypos 2144 | 415 2145 | 2146 | AFF4720E-B980-42D2-88D7-3C8F5AE2BB15 2147 | 2148 | note 2149 | Input 2150 | xpos 2151 | 660 2152 | ypos 2153 | 790 2154 | 2155 | B12F6DB7-05E8-4DA6-8ECA-E77EB6B5FE43 2156 | 2157 | xpos 2158 | 2165 2159 | ypos 2160 | 445 2161 | 2162 | B40D456F-72CD-4ABD-912B-A90E6BE38292 2163 | 2164 | note 2165 | Switch foregin_lang 2166 | xpos 2167 | 70 2168 | ypos 2169 | 150 2170 | 2171 | BBA75C58-EE9D-4A56-AB81-6B589EA6B13E 2172 | 2173 | xpos 2174 | 375 2175 | ypos 2176 | 730 2177 | 2178 | D1AD1096-41AD-4668-BD57-C890F9DDAE65 2179 | 2180 | xpos 2181 | 1020 2182 | ypos 2183 | 500 2184 | 2185 | D3D26BCE-9E67-4E1D-BDA5-3CF34C3155BD 2186 | 2187 | note 2188 | Translate selected text from native_lang to foreign_lang 2189 | xpos 2190 | 65 2191 | ypos 2192 | 700 2193 | 2194 | D3DB04C0-F3BF-481E-BAEE-AA58D7A8A67A 2195 | 2196 | xpos 2197 | 1765 2198 | ypos 2199 | 790 2200 | 2201 | DB0C4C7C-5CD8-4314-9F5A-6A78F447BD66 2202 | 2203 | xpos 2204 | 575 2205 | ypos 2206 | 915 2207 | 2208 | DFA97F43-A312-45FA-9206-762301F7CE72 2209 | 2210 | xpos 2211 | 205 2212 | ypos 2213 | 730 2214 | 2215 | E4D2CA9E-A247-4F1E-A561-1B408624D312 2216 | 2217 | xpos 2218 | 315 2219 | ypos 2220 | 915 2221 | 2222 | F402F3A5-63BB-4F74-BD15-8123558EB3F6 2223 | 2224 | xpos 2225 | 770 2226 | ypos 2227 | 415 2228 | 2229 | F59E4CBD-56FB-4E8C-A916-7B2657BD8B26 2230 | 2231 | xpos 2232 | 435 2233 | ypos 2234 | 505 2235 | 2236 | FB05B7A1-B907-4F8D-A64A-7B9FAE8E9F16 2237 | 2238 | note 2239 | Switch 2240 | xpos 2241 | 215 2242 | ypos 2243 | 150 2244 | 2245 | 2246 | variables 2247 | 2248 | deepl_api_key 2249 | 2250 | deepl_api_url 2251 | free 2252 | engine 2253 | google 2254 | foreign_lang 2255 | en,zh 2256 | log_file 2257 | ~/translate2_log.yml 2258 | native_lang 2259 | ja 2260 | view 2261 | input_output 2262 | 2263 | variablesdontexport 2264 | 2265 | deepl_api_key 2266 | 2267 | version 2268 | 2.1.0 2269 | webaddress 2270 | https://github.com/nkmr-jp/alfred-quick-translate 2271 | 2272 | 2273 | --------------------------------------------------------------------------------