X.com Advanced Translator (Powered by Google Gemini)
Tired of the basic, often inaccurate X.com translator? This script replaces it with the powerful Google Gemini AI, giving you superior, context-aware translations.
Its main feature is the ability to translate any tweet. The script intelligently adds a translate button to every post, even where X.com doesn't provide one, and gives you full control over the translation process through a seamless, native-looking UI.
Installation & Configuration
Follow these steps to get the script running.
Step 1: Install a Userscript Manager
You need a userscript manager to use this script. If you don't have one, please install one of these:
- Tampermonkey (Recommended, for Chrome, Firefox, Edge, Safari)
- Violentmonkey
Step 2: Get a Google Gemini API Key
The script requires a personal API key to work.
- Go to Google AI Studio.
- Click "Create API key in new project".
- Copy the generated key. It will look something like
AIzaSy....
- Important: Treat this key like a password! Do not share it publicly.
Step 3: Configure the Script
Once the script is installed, find any tweet and look for the new translate button.
- Click the ⚙️ icon next to the "Translate post" button.
- The settings modal will appear.
- Paste your Gemini API Key into the
API Key field.
- (Optional) If you are using a local proxy (like an LLM gateway), you can change the
API Host. For direct access to Google's API, use https://generativelanguage.googleapis.com.
- Click "Save".