GitHub Quick Translate

人民的勤务员
2025-03-20T01:11:39Z

Listen to the keyboard shortcut Ctrl + Q to translate text and replace the original text in the input field with the translation. Supports Issue and Pull Request pages.

简体中文 | English | 한국어 | Tiếng Việt | 繁體中文
👆️access GitHub Readme file on for a better experience。

GitHubView the serviceman’s scriptGithub:@ChinaGodMan
GreasyForkView the serviceman’s script
View the serviceman’s script on the current page

⭐If the script helps you,Can light up the stars to encourage⭐

Recommended use：

💡 Tip: The script manager and browser listed above do not represent all
The script runs normally in the following environment

GitHub shortcut key translation assistant

「 Listen to keyboard shortcut Ctrl + Q, which implements the function of translating text and replacing the translation results with the original text box. Supports Issue and pull request pages. 」

Download:Github | ⭐Greasy Fork

Update records

🛠️ GitHub Quick translation Update log

📅 2025.03.20.0728

New: •Initial version

GitHub Quick translation

This script listens to keyboard shortcuts Ctrl + Q，Implement the function of translating the selected text and replacing the translation results in the original text box。Translation has been called Google Translate API。

Function description

1. Shortcut key trigger：Press Ctrl + Q When the translation function is triggered。

2. Select text translation：Automatically detect selected text in the text box，and translate it into the target language。

3. Translation result replacement：Replace the translated text to the selected position in the original text box。

4. Support GitHub OnissuesandpullPagemarkdownTranslate information。

5. You can customize the translation language you need in the script,Translated by default in English。const translate = 'en'

Script logic

1. Listen to keyboard events，Determine whether it has been pressed Ctrl + Q。

2. If selected text is detected in the target text box：

Extract selected text。

Call Google Translate API Make a translation。

Replace the original selected text with translation results。

3. If the text is not selected or the target text box is not found，Prompt information will be output on the console。