简体中文 | English
Website | GitHub | Issues | Reviews
Android localization plugin supporting multiple languages and translators. Developed based on IntelliJ Platform SDK, featuring a modular design and flexible translation service integration.
- Multiple translator support:
- Google Translate (Free and API versions)
- Microsoft Translator
- Baidu Translator
- Youdao Translator
- Alibaba Translator
- DeepL Translator (Free and Pro versions)
- OpenAI ChatGPT Translator
- ByteDance Translator
- Support for 100+ languages
- One-click generation of all translation files
- Support for skipping existing strings
- Support for excluding specific text
- Translation caching support
- Configurable translation interval
translate: Translation core module- Multiple translation service support
- Extensible translation interface
- Translation result caching
services: Service layer- Translation service management
- Resource file processing
- Configuration management
task: Task processing- Asynchronous translation tasks
- Progress management
- Cancellation support
action: User interaction- Menu items
- Dialogs
- Settings interface
config: Configuration management- Persistent storage
- Secure configuration
utils: Utility classes- Text processing
- File operations
- Common utilities
- Strategy Pattern: Translator implementation
- Singleton Pattern: Service classes
- Observer Pattern: Task callbacks
- Factory Pattern: Object creation
- Select
values/strings.xmlfile (or any resource file in the values directory) - Right-click and select "Translate to Other Languages"
- Check the languages you want to translate to
- Click OK to start translation
- Translator Settings
- Select default translator
- Configure API keys
- Set translation parameters
- Cache Settings
- Enable/disable cache
- Set cache size
- Configure cache strategy
- Performance Settings
- Translation interval
- Concurrent task count
- Timeout settings
- JDK 11+
- IntelliJ IDEA 2020.3+
- Gradle 7.0+
- Implement the
AbstractTranslatorinterface - Register using
@AutoServiceannotation - Implement necessary translation methods
- Add configuration support
# Build plugin
./gradlew build
# Run tests
./gradlew test
# Build release version
./gradlew buildPlugin-
Q: How to exclude text from translation?
A: You can use translatable or xliff:g tags. Example:
<string name="app_name" translatable="false">HelloAndroid</string> <string name="star_rating">Check out our 5<xliff:g id="star">\u2605</xliff:g></string> <string name="app_home_url">Visit us at <xliff:g id="application_homepage">https://github.com/Airsaid/AndroidLocalizePlugin</xliff:g></string> <string name="prod_name">Learn more at <xliff:g id="game_group">Muggle Game Studio</xliff:g></string>Note: Display in one line, no extra line breaks or spaces in between.
-
Q: Translation failure: java.net.HttpRetryException: cannot retry due to redirection, in streaming mode
A: If you're using the default translation engine (Google), try switching to another engine in the settings page and use your own account for translation. The default translation engine is not stable.
You can contribute and support this project by:
-
Star the project on GitHub
-
Report issues
-
Submit PRs
-
Share your ideas and suggestions
-
Share the plugin with your friends and colleagues
-
If you like this plugin, please consider donating to maintain the plugin and future updates:
Open Collective WeChat Pay Alipay
Thank you for your support!
Copyright 2018 Airsaid. https://github.com/airsaid
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.


