diff --git a/info.plist b/info.plist index 1556ff1..6a619df 100644 --- a/info.plist +++ b/info.plist @@ -4,8 +4,6 @@ bundleid dev.nikitadev.translate - category - Tools connections 106F3E8A-2E39-4271-926D-A914AB923F97 @@ -74,37 +72,6 @@ version 3 - - config - - action - 0 - argument - 1 - focusedappvariable - - focusedappvariablename - - hotkey - 0 - hotmod - 0 - hotstring - - leftcursor - - modsmode - 0 - relatedAppsMode - 0 - - type - alfred.workflow.trigger.hotkey - uid - D2D5C5DA-1EAE-4512-B453-DEB6657BA96B - version - 2 - config @@ -154,6 +121,35 @@ version 3 + + config + + action + 0 + argument + 1 + focusedappvariable + + focusedappvariablename + + hotkey + 0 + hotmod + 0 + leftcursor + + modsmode + 0 + relatedAppsMode + 0 + + type + alfred.workflow.trigger.hotkey + uid + D2D5C5DA-1EAE-4512-B453-DEB6657BA96B + version + 2 + config @@ -179,7 +175,7 @@ Translate words or sentences to another language via the `t` keyword. ![preview](images/preview.png) ![preview2](images/preview2.png) -↩: Copy translate to the clipboard. +↩: Copy translate to the clipboard. ⇧ + ↩: Paste translate to active app. By default, translate any language to Russian, setup your language in the **workflow settings**. uidata @@ -187,9 +183,9 @@ By default, translate any language to Russian, setup your language in the **work 106F3E8A-2E39-4271-926D-A914AB923F97 xpos - 300 + 255 ypos - 210 + 150 3FBBE375-C914-4AC3-9A98-31E268F25295 @@ -201,16 +197,16 @@ By default, translate any language to Russian, setup your language in the **work 651FC5D3-99B6-45E2-A896-01E2A7D3393C xpos - 525 + 520 ypos - 95 + 125 D2D5C5DA-1EAE-4512-B453-DEB6657BA96B xpos - 60 + 75 ypos - 195 + 160 userconfigurationconfig @@ -223,110 +219,1094 @@ By default, translate any language to Russian, setup your language in the **work pairs - English - en + Afrikaans + af + + + Albanian + sq + + + Amharic + am Arabic ar - Chinese - zh + Armenian + hy - French - fr + Assamese + as - German - de + Aymara + ay - Italian - it + Azerbaijani + az - Japanese - jp + Bambara + bm - Korean - ko + Basque + eu - Portuguese - pt + Belarusian + be - Russian - ru + Bengali + bn - Spanish - es + Bhojpuri + bho + + + Bosnian + bs + + + Bulgarian + bg + + + Catalan + ca + + + Cebuano + ceb + + + Chinese (Simplified) + zh-CN + + + Chinese (Traditional) + zh-TW + + + Corsican + co + + + Croatian + hr + + + Czech + cs + + + Danish + da + + + Dhivehi + dv + + + Dogri + doi + + + Dutch + nl - - - description - Target language into which the text will be translated - label - Target language - type - popupbutton - variable - output_language - - - config - - default - en - pairs - English en - Arabic - ar + Esperanto + eo + + + Estonian + et + + + Ewe + ee + + + Filipino (Tagalog) + fil - Chinese - zh + Finnish + fi French fr + + Frisian + fy + + + Galician + gl + + + Georgian + ka + German de + + Greek + el + + + Guarani + gn + + + Gujarati + gu + + + Haitian Creole + ht + + + Hausa + ha + + + Hawaiian + haw + + + Hebrew + he + + + Hindi + hi + + + Hmong + hmn + + + Hungarian + hu + + + Icelandic + is + + + Igbo + ig + + + Ilocano + ilo + + + Indonesian + id + + + Irish + ga + Italian it Japanese - jp + ja + + + Javanese + jv + + + Kannada + kn + + + Kazakh + kk + + + Khmer + km + + + Kinyarwanda + rw + + + Konkani + gom Korean ko - Portuguese + Krio + kri + + + Kurdish + ku + + + Kurdish (Sorani) + ckb + + + Kyrgyz + ky + + + Lao + lo + + + Latin + la + + + Latvian + lv + + + Lingala + ln + + + Lithuanian + lt + + + Luganda + lg + + + Luxembourgish + lb + + + Macedonian + mk + + + Maithili + mai + + + Malagasy + mg + + + Malay + ms + + + Malayalam + ml + + + Maltese + mt + + + Maori + mi + + + Marathi + mr + + + Meiteilon (Manipuri) + mni-Mtei + + + Mizo + lus + + + Mongolian + mn + + + Myanmar (Burmese) + my + + + Nepali + ne + + + Norwegian + no + + + Nyanja (Chichewa) + ny + + + Odia (Oriya) + or + + + Oromo + om + + + Pashto + ps + + + Persian + fa + + + Polish + pl + + + Portuguese (Portugal, Brazil) pt + + Punjabi + pa + + + Quechua + qu + + + Romanian + ro + Russian ru - Spanish - es + Samoan + sm + + + Sanskrit + sa + + + Scots Gaelic + gd + + + Sepedi + nso + + + Serbian + sr + + + Sesotho + st + + + Shona + sn + + + Sindhi + sd + + + Sinhala (Sinhalese) + si + + + Slovak + sk + + + Slovenian + sl + + + Somali + so + + + Spanish + es + + + Sundanese + su + + + Swahili + sw + + + Swedish + sv + + + Tagalog (Filipino) + tl + + + Tajik + tg + + + Tamil + ta + + + Tatar + tt + + + Telugu + te + + + Thai + th + + + Tigrinya + ti + + + Tsonga + ts + + + Turkish + tr + + + Turkmen + tk + + + Twi (Akan) + ak + + + Ukrainian + uk + + + Urdu + ur + + + Uyghur + ug + + + Uzbek + uz + + + Vietnamese + vi + + + Welsh + cy + + + Xhosa + xh + + + Yiddish + yi + + + Yoruba + yo + + + Zulu + zu + + + + description + Target language into which the text will be translated + label + Target language + type + popupbutton + variable + output_language + + + config + + default + en + pairs + + + Afrikaans + af + + + Albanian + sq + + + Amharic + am + + + Arabic + ar + + + Armenian + hy + + + Assamese + as + + + Aymara + ay + + + Azerbaijani + az + + + Bambara + bm + + + Basque + eu + + + Belarusian + be + + + Bengali + bn + + + Bhojpuri + bho + + + Bosnian + bs + + + Bulgarian + bg + + + Catalan + ca + + + Cebuano + ceb + + + Chinese (Simplified) + zh-CN + + + Chinese (Traditional) + zh-TW + + + Corsican + co + + + Croatian + hr + + + Czech + cs + + + Danish + da + + + Dhivehi + dv + + + Dogri + doi + + + Dutch + nl + + + English + en + + + Esperanto + eo + + + Estonian + et + + + Ewe + ee + + + Filipino (Tagalog) + fil + + + Finnish + fi + + + French + fr + + + Frisian + fy + + + Galician + gl + + + Georgian + ka + + + German + de + + + Greek + el + + + Guarani + gn + + + Gujarati + gu + + + Haitian Creole + ht + + + Hausa + ha + + + Hawaiian + haw + + + Hebrew + he + + + Hindi + hi + + + Hmong + hmn + + + Hungarian + hu + + + Icelandic + is + + + Igbo + ig + + + Ilocano + ilo + + + Indonesian + id + + + Irish + ga + + + Italian + it + + + Japanese + ja + + + Javanese + jv + + + Kannada + kn + + + Kazakh + kk + + + Khmer + km + + + Kinyarwanda + rw + + + Konkani + gom + + + Korean + ko + + + Krio + kri + + + Kurdish + ku + + + Kurdish (Sorani) + ckb + + + Kyrgyz + ky + + + Lao + lo + + + Latin + la + + + Latvian + lv + + + Lingala + ln + + + Lithuanian + lt + + + Luganda + lg + + + Luxembourgish + lb + + + Macedonian + mk + + + Maithili + mai + + + Malagasy + mg + + + Malay + ms + + + Malayalam + ml + + + Maltese + mt + + + Maori + mi + + + Marathi + mr + + + Meiteilon (Manipuri) + mni-Mtei + + + Mizo + lus + + + Mongolian + mn + + + Myanmar (Burmese) + my + + + Nepali + ne + + + Norwegian + no + + + Nyanja (Chichewa) + ny + + + Odia (Oriya) + or + + + Oromo + om + + + Pashto + ps + + + Persian + fa + + + Polish + pl + + + Portuguese (Portugal, Brazil) + pt + + + Punjabi + pa + + + Quechua + qu + + + Romanian + ro + + + Russian + ru + + + Samoan + sm + + + Sanskrit + sa + + + Scots Gaelic + gd + + + Sepedi + nso + + + Serbian + sr + + + Sesotho + st + + + Shona + sn + + + Sindhi + sd + + + Sinhala (Sinhalese) + si + + + Slovak + sk + + + Slovenian + sl + + + Somali + so + + + Spanish + es + + + Sundanese + su + + + Swahili + sw + + + Swedish + sv + + + Tagalog (Filipino) + tl + + + Tajik + tg + + + Tamil + ta + + + Tatar + tt + + + Telugu + te + + + Thai + th + + + Tigrinya + ti + + + Tsonga + ts + + + Turkish + tr + + + Turkmen + tk + + + Twi (Akan) + ak + + + Ukrainian + uk + + + Urdu + ur + + + Uyghur + ug + + + Uzbek + uz + + + Vietnamese + vi + + + Welsh + cy + + + Xhosa + xh + + + Yiddish + yi + + + Yoruba + yo + + + Zulu + zu diff --git a/main.py b/main.py index c6696e5..1abbb20 100644 --- a/main.py +++ b/main.py @@ -18,19 +18,143 @@ class Translate: """ languages = { - "en", + "af", + "sq", + "am", "ar", - "zh", + "hy", + "as", + "ay", + "az", + "bm", + "eu", + "be", + "bn", + "bho", + "bs", + "bg", + "ca", + "ceb", + "zh-CN", + "zh-TW", + "co", + "hr", + "cs", + "da", + "dv", + "doi", + "nl", + "en", + "eo", + "et", + "ee", + "fil", + "fi", "fr", + "fy", + "gl", + "ka", "de", + "el", + "gn", + "gu", + "ht", + "ha", + "haw", + "he", + "hi", + "hmn", + "hu", + "is", + "ig", + "ilo", + "id", + "ga", "it", - "jp", + "ja", + "jv", + "kn", + "kk", + "km", + "rw", + "gom", "ko", + "kri", + "ku", + "ckb", + "ky", + "lo", + "la", + "lv", + "ln", + "lt", + "lg", + "lb", + "mk", + "mai", + "mg", + "ms", + "ml", + "mt", + "mi", + "mr", + "mni-Mtei", + "lus", + "mn", + "my", + "ne", + "no", + "ny", + "or", + "om", + "ps", + "fa", + "pl", "pt", + "pa", + "qu", + "ro", "ru", - "es" + "sm", + "sa", + "gd", + "nso", + "sr", + "st", + "sn", + "sd", + "si", + "sk", + "sl", + "so", + "es", + "su", + "sw", + "sv", + "tl", + "tg", + "ta", + "tt", + "te", + "th", + "ti", + "ts", + "tr", + "tk", + "ak", + "uk", + "ur", + "ug", + "uz", + "vi", + "cy", + "xh", + "yi", + "yo", + "zu", } + user_agent = [ "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.45 Safari/537.36", "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.110 Safari/537.36",