Search Docs…

Search Docs…

Guide

Generate Translations

Generate Translations

Generating translations with lang-source-cli is simple and efficient. Follow this guide to get started.

Preparing JSON files

Ensure your translation source files are named with two-character language codes (e.g., en.json, fr.json). These files should contain the key-value pairs for the text you want to translate.

Example en.json:

{
  "greeting": "Hello",
  "farewell": "Goodbye"
}

Place these files in your project directory before running the tool.

Using the CLI Tool

Run the following command to generate translations:

Alternatively, use the short version:

The CLI will:

  1. Process the source files in your project.

  2. Use the Gemini API to translate the text into supported languages.

  3. Save the translated files in your output directory.

For example, if you have en.json as the source, the tool will generate files like fr.json (French), es.json (Spanish), etc., based on the supported languages.

Supported Languages

lang-source-cli supports a variety of languages, including English (en), Japanese (ja), Korean (ko), and more. For the full list, refer to the Supported Languages section.

Start streamlining your localization process today with lang-source-cli!