This IntelliJ/Android Studio plugin automatically adds localization to your Android project by translating strings.xml resources to a target language. It supports multiple translation providers including OpenAI (ChatGPT), Gemini, Grok, Google Translate, and Microsoft Translator.
- Multi-Service Support: Choose from OpenAI, Gemini, Grok, Google Translate, or Microsoft Translator.
- Selective Translation: View all strings in your project and select exactly which ones to translate.
- Context-Aware: Provide optional context or glossary rules (e.g., "Maintain capitalization for app names") to guide LLM-based translations.
- Secure: API keys are handled securely at runtime and not stored in code.
- Open the project in IntelliJ IDEA or Android Studio.
- Open the Gradle tool window.
- Run the task
Tasks > intellij > buildPlugin. - The generated plugin file (
android-localization-extension-1.0-SNAPSHOT.zip) will be located inbuild/distributions/.
- Open Android Studio.
- Go to Settings/Preferences > Plugins.
- Click the Gear icon and select Install Plugin from Disk....
- Select the
.zipfile generated in the previous step. - Restart Android Studio.
- Open your Android project.
- Navigate to Tools > Translate Android Strings in the main menu.
- In the dialog:
- Translation Service: Select your preferred provider (e.g., Gemini).
- API Key: Enter your valid API key for the selected service.
- Target Language: Enter the target language code (e.g.,
esfor Spanish,frfor French). - Context / Glossary: (Optional) Enter any specific instructions for the translator.
- Select strings: Check the boxes next to the strings you want to translate in the table.
- Click OK.
- The plugin will process the translations in the background and generate/update the corresponding
values-<lang>/strings.xmlfile.
- Go to the Google Cloud Console.
- Create a new project or select an existing one.
- Navigate to APIs & Services > Library.
- Search for "Cloud Translation API" and enable it.
- Go to APIs & Services > Credentials.
- Click Create Credentials > API Key.
- Copy the generated key.
- Note: You may need to set up a billing account, though there is a free tier.
- Go to platform.openai.com.
- Sign up or log in.
- Navigate to API Keys and create a new secret key.
- Go to Google AI Studio.
- Click Get API key.
- Create a key in a new or existing Google Cloud project.
- Go to the Azure Portal.
- Create a resource for "Translator".
- Go to the resource's Keys and Endpoint section to find your key.
- Go to the xAI Console.
- Create an API key.
If you find this plugin helpful, consider supporting its development: