RealTime Translation
MultiLang supports real-time translation using external translation APIs. This allows you to automatically translate text that hasn’t been manually translated yet.Overview
RealTime translation uses external APIs to translate text on-the-fly. This is useful for:- Translating plugin messages that haven’t been manually translated
- Providing translations for new content automatically
- Supporting languages you haven’t manually added translations for
Choosing an API
You have two API options:- Google Translate API - Free but may not always work reliably
- Bing Microsoft Translator API - More reliable, requires a free API key
We personally suggest using Bing because Google may not work reliably.
However, both options are available.
Creating an API Key (Bing)
You only need an API key if you’re using Bing. Google doesn’t require an API key (but may be less reliable).Step 1: Subscribe to the API
Subscribe for a free API key at RapidAPI - Microsoft Translator.Step 2: Retrieve Your Key
After subscribing, retrieve your API key at RapidAPI Developer Dashboard.Visual Guide
Here’s a simple guide showing how to retrieve your API key:
Configuration
Once you have your API key (if using Bing), configure it in yourconfig.yml:
Configuration Options
enabled - Enable or disable real-time translation
api - Choose between "google" or "bing"
api-key - Your API key (only required for Bing)
cache - Enable or disable caching (highly recommended)
Should I Use Cache?
Yes, absolutely! Caching will significantly reduce delay and API usage. It
stores translated text so it doesn’t need to be translated again.
- Faster translation (instant for cached text)
- Reduced API usage
- Lower costs (if using paid API)
- Better performance
- First time a text is translated: API call is made, result is cached
- Subsequent times: Translation is retrieved from cache instantly
Database Size Management
My database size is too big. What should I do?
If your cache database becomes too large, you can clear it using:Regularly clearing the cache can help manage database size, but remember that
cleared translations will need to be translated again (using API calls).
Performance
Will it cause lag?
No, all translation tasks are executed asynchronously. This means they don’t block the main server thread. However:- There may be a slight delay before your message is sent (while translation is happening)
- If you use cache, this delay only happens the first time a text is translated
- Subsequent translations of the same text are instant (from cache)
API Quota Limits
What will happen when I reach my quota limit?
When you reach your API quota limit:- RealTime translation will be automatically disabled
- Manual translations will still work
- You’ll need to wait for quota reset or upgrade your API plan
If you find an API without quota limits, please suggest it on our Discord
server!
Best Practices
- Use caching - Always enable cache to improve performance and reduce API usage
- Monitor API usage - Keep an eye on your API usage to avoid hitting limits
- Combine with manual translations - Use real-time translation as a fallback, but manually translate common messages for better performance
- Clear cache periodically - If your database grows too large, clear the cache occasionally
- Use Bing for reliability - If possible, use Bing API for more reliable translations
Troubleshooting
Q: Translations aren’t workingA: Make sure:
- RealTime is enabled in config
- API is set correctly (“google” or “bing”)
- If using Bing, API key is correct
- You haven’t exceeded your API quota
A: Enable caching! The first translation may be slow, but cached translations are instant. Q: Database is too large
A: Use
/multilangadmin clearCache to clear the cache database.
Q: API quota exceededA: Wait for quota reset, upgrade your API plan, or switch to manual translations.
Example Configuration
Here’s a complete example configuration:Related Guides
- Configuration - General configuration guide
- Translating - Manual translation guide
Need Help?
Still need help? Join our Discord server
for support!