AI Localization is a Visual Studio Code extension that automatically translates localization files into other languages using OpenAI API.
When developing software projects, that support multiple languages, texts and labels are stored inside separate files called localization files. Those files are typically in JSON format, as the majority of libraries and frameworks support that format. Each language has its own file with key/value pairs, where key represents a unique identifier used in code and value is the actual text.
As new functionalities being developed, developers add new entries into each file. That requires translated phrases for each supported language to be added into appropriate files. That can be tedious and error prone. For that reason, automating this process can be of significant help.
AI Localization helps developers by completely automating translation of localization files by using OpenAI API.
The extension adds two menu items that are available in JSON files:
By selecting the Translate All
option, the extension translates all phrases from the current localization file into all other available languages and updates the localization files. This option is useful when developers want to overwrite complete content of other files, but most often the Translate Missing
option is more useful. That option translates only phrases that are present in the currently opened file, but not in the other localization files.
This is a demo of the extension:
In either way, the extension determines which phrases need to be translated, the source language and what are the languages that phrases will be translated to.
Then phrases are sent to OpenAI API for translation using RAG technique. But, number of phrases can be very large and easily can exceed context of an LLM model. For that reason, phrases are separated into batches and sent to OpenAI in multiple requests.
Returned response is then parsed and inserted into appropriate JSON files.
The result is synchronized localization files with appropriate translations for all missing keys.
AI Localization extension automates process of translating localization files by using LLMs. Even if final translations need to be reviewed by humans, automated translations significantly speed up the process of updating localization files.
There are no datasets linked
There are no datasets linked