AI Localizator
AI Localizator is a Visual Studio Code extension designed to assist developers in translating text efficiently using AI-powered models and APIs.
Supported services
- Translation APIs
- Microsoft Translator
- Google Cloud Translator
- DeepL
- M2M-100 (CloudFlare)
- LLMs
- Anthropic (Claude 3.5 Sonnet, Claude 3.5 Haiku)
- OpenAI (GPT-4, GPT-4o)
- OpenAI Azure (GPT-4, GPT-4o)
Required Settings variables
Service |
Required variables |
Free tier |
Microsoft Translator |
apiEndpoint, apiKey, langTo |
Yes |
Google Cloud Translator |
apiEndpoint, apiKey, langTo |
Yes |
DeepL |
apiEndpoint, apiKey, langTo |
Yes |
M2M-100 (CloudFlare) |
apiEndpoint, apiKey, langFrom, langTo |
Yes |
Anthropic |
apiEndpoint, apiKey, modelName, modelVersion, maxTokens, prompt |
5 USD |
OpenAI |
apiEndpoint, apiKey, modelName, maxTokens, prompt |
No |
OpenAI Azure |
apiEndpoint, apiKey, maxTokens, prompt |
No |
To find Visual Studio Code extension settings, open Command Palette (Ctrl+Shift+P or Cmd+Shift+P on macOS), type Preferences: Open Settings (UI), then search for the Ai-localizator , or go to the Extensions view (Ctrl+Shift+X or Cmd+Shift+X ), find the extension, click the gear icon next to it, and select Extension Settings.
Settings examples
Microsoft Translator
- apiEndpoint -
https://api.cognitive.microsofttranslator.com/translate .
- apiKey - YOUR-API-KEY
- langTo - Specifies the target language for translation using ISO 639-1 codes (e.g.,
lt for Lithuanian).
Create Resource and get API key
Google Cloud Translate
- apiEndpoint -
https://translation.googleapis.com/language/translate/v2 .
- apiKey - YOUR-API-KEY
- langTo - Specifies the target language for translation using ISO 639-1 codes (e.g.,
lt for Lithuanian).
Get API key
DeepL
- apiEndpoint -
https://api-free.deepl.com/v2/translate or https://api.deepl.com/v2/translate .
- apiKey - YOUR-API-KEY
- langTo - Specifies the target language for translation using ISO 639-1 codes (e.g.,
lt for Lithuanian).
Get API key
M2M-100 (CloudFlare)
- apiEndpoint -
https://api.cloudflare.com/client/v4/accounts/*ACCOUNT-ID*/ai/run/@cf/meta/m2m100-1.2b .
- apiKey - YOUR-API-KEY
- langFrom - Specifies the source language for translation using ISO 639-1 codes (e.g.,
en for English).
- langTo - Specifies the target language for translation using ISO 639-1 codes (e.g.,
lt for Lithuanian).
Get Account ID and API token
Anthropic (Claude 3.5 Sonnet, Claude 3.5 Haiku)
- apiEndpoint -
https://api.anthropic.com/v1/messages .
- apiKey - YOUR-API-KEY
- modelName - Specifies the AI model (e.g.,
claude-3-5-sonnet-20241022 , claude-3-5-sonnet-20241023 ).
- modelVersion - Specifies the AI model (e.g.,
2023-06-01 ).
- maxTokens - Specifies the maximum number of tokens that the AI model can generate in its response (e.g.,
500 ).
- prompt - Provides instructions to the AI (e.g.,
Translate provided text into English ).
Get API key
OpenAI (GPT-4, GPT-4o)
- apiEndpoint -
https://api.openai.com/v1/chat/completions .
- apiKey - YOUR-API-KEY
- modelName - Specifies the OpenAI model (e.g.,
gpt-4 , gpt-4o ).
- maxTokens - Specifies the maximum number of tokens that the AI model can generate in its response (e.g.,
500 ).
- prompt - Provides instructions to the AI (e.g.,
Translate provided text into English ).
Get API key
OpenAI Azure (GPT-4, GPT-4o)
- apiEndpoint -
https://*ACCOUNT*.openai.azure.com/openai/deployments/*DEPLOYMENT*/chat/completions?api-version=*API-VERSION* .
- apiKey - YOUR-API-KEY
- maxTokens - Specifies the maximum number of tokens that the AI model can generate in its response (e.g.,
500 ).
- prompt - Provides instructions to the AI (e.g.,
Translate provided text into English ).
Create Resource and get API key
How to use it
After installation, open the Command Palette (Ctrl+Shift+P or Cmd+Shift+P on macOS), type Preferences: Open Settings (UI), and search for AI Localizator . Alternatively, go to the Extensions view (Ctrl+Shift+X or Cmd+Shift+X ), find the extension, click the gear icon next to it, and select Extension Settings.
Configure all settings based on the service provider you want to use.
Select the text you want to translate, right-click on it, and choose AI Localizator: Translate Text .
| |