JSON Translate

JsonTranslate is a multilingual JSON translation tool designed for developers and content creators. It supports Google Translate, Azure, and DeepL(X) translation APIs to help with project internationalization and localization. Whether you are developing a multilingual website, app, or managing multilingual datasets, JsonTranslate offers a simple solution to easily translate JSON file content into multiple target languages.

Translation Modes

Global Translation

Global translation recursively traverses the entire JSON structure, translating all string values while preserving the original hierarchy and structure of the JSON.

Suitable for:

  • Translating all text in an entire JSON file
  • One-click translation without complex configurations

Specific Node

Using a JSONPath expression, you can precisely target one or more nodes and translate only the string content within those nodes. Multiple paths can be specified, separated by commas.

Suitable for:

  • JSON data with a clear hierarchy where only specific parts need translation
  • Reducing the translation scope for large JSON files to improve efficiency

Specific Key Names

In this mode, you can specify particular key names to translate. Two input methods are supported:

  • Simple Mode: Enter the key names to be translated directly in the input box, separated by commas (in either English or Chinese), and the program will translate the content of those keys.
  • Advanced Mode: Set the mapping between input and output keys using the key mapping component. The translation result will be written to a new field while keeping the original field unchanged.

Suitable for:

  • Translating only specific fields, such as title or description
  • Outputting translation results to different fields to avoid overwriting the original data

Notes:

  • Key names are case-sensitive
  • If the JSON contains arrays, avoid using pure numbers as key names to prevent them from being interpreted as indices
  • The number of input and output keys must match

Selective Translation

This mode is suitable for flat JSON structures. You can specify a starting node and the field names to be translated. The system will search from the specified node for target fields in all objects and translate them.

Configuration Options:

  • Starting Key (optional): Specify the key from which to begin the search, suitable for scenarios where key order matters
  • Fields to Translate: The specific field names to translate, separated by commas if there are multiple

Suitable for:

  • Translating only specific fields in a flat structure, such as the "message" field in logs or error messages
  • JSON files with simple structures where fields appear repeatedly but only need selective translation

i18n Mode

i18n mode is designed for multilingual scenarios, allowing the aggregation of multiple language fields within the original JSON structure. It is ideal for building translation files for multilingual websites or apps, or managing multilingual configurations under a unified structure.

How It Works

  • Uses the selected source language as the source field. For example, if the source language is zh, the source field is zh. If the source language is set to auto, the default source field is en.
  • Traverses all objects in the JSON that contain the source language field and adds a target language field (at the same level as the source field) for each object.
  • If the target language field already exists, translation is skipped to avoid overwriting existing content.
  • When both i18n mode and multilingual mode are enabled, the system generates a unified JSON structure that includes the source language and all target languages. This is especially useful for internationalization projects.

Example

{
  "title": {
    "en": "Settings"
  }
}

If the target languages are set to zh and fr, the translation result is:

{
  "title": {
    "en": "Settings",
    "zh": "设置",
    "fr": "Paramètres"
  }
}

Translation API

This tool supports 5 translation APIs and 5 LLM (large language model) interfaces, allowing users to choose the appropriate translation method based on their needs:

Comparison of Translation APIs

API Type Translation Quality Stability Suitable Scenarios Free Quota
DeepL(X) ★★★★★ ★★★★☆ Suitable for long texts; smoother translations 500,000 characters per month
Google Translate ★★★★☆ ★★★★★ Ideal for UI text and common phrases 500,000 characters per month
Azure Translate ★★★★☆ ★★★★★ Broadest language support 2,000,000 characters per month for the first 12 months
GTX API (Free) ★★★☆☆ ★★★☆☆ General text translation Free
GTX Web (Free) ★★★☆☆ ★★☆☆☆ Suitable for small-scale translation Free
  • DeepL: Ideal for long texts with smoother and more natural translations; however, it does not support web API calls and requires local or server-side proxy usage.
  • Google Translate: Offers stable translation quality, suitable for short sentences and UI text, and supports web API calls.
  • Azure Translate: Provides the widest range of language support, meeting diverse multilingual translation needs.
  • GTX API/Web: A free translation option suitable for small-scale use, though its stability is average.

For higher translation speed and quality, you can apply for an API Key from Google Translate, Azure Translate, or DeepL Translate. Refer to the related API application tutorial for the application process.

LLM Translation (AI Large Models)

This tool provides access to five mainstream AI large models (LLMs) or interfaces: OpenAI, DeepSeek, Siliconflow, Groq, and Custom LLM.

  • Use Cases: Ideal for handling content that requires high-level language understanding, such as literary works, technical documents, and multilingual materials.
  • Customizability: Supports custom system prompts and user prompts, allowing flexible adjustments to translation style and terminology preferences to better suit different scenarios.
  • Temperature Parameter: Controls the randomness of translation results. Higher values produce more creative outputs but may affect consistency and accuracy.

The Custom LLM option allows integration with third-party services or local inference platforms (such as ollama) by configuring the API endpoint and model name. For example, the default API endpoint for a local ollama setup is:

http://127.0.0.1:11434/v1/chat/completions

The default model used is llama3.2. For LM Studio, the local API endpoint is:

http://localhost:61234/v1/chat/completions

To achieve better translation quality, it is recommended to use qwen2.5-14b-instruct or a higher-performing model in the Custom LLM setup.

Language Support

In terms of multilingual translation capabilities, Google, Azure, and large language models (LLMs) support translation between hundreds of languages, while DeepL currently supports only 30 mainstream languages. Therefore, in terms of language coverage, DeepL is relatively weaker.

For a detailed list of supported languages, please refer to the official documentation:

Feature Description

Mapped Translation

When using the specified key name mode, you can switch between the single key mode and the mapped translation mode using the toggle button in the result area. In single key mode, the same node is used for both translation input and output. In mapped translation mode, however, translations involve different nodes—for example, the value of node A is translated to node B, and the value of node C is translated to node D.

Translation Cache

This tool introduces an optional local translation cache to improve translation efficiency and reduce resource consumption:

  • Cache rules: Each translation result is stored with a unique key formatted as source text_target language_source language_translation API_model settings.
  • Cache hit condition: The local cache result is used only when the parameters match exactly, ensuring accuracy.
  • Cache purpose: Avoid repeated translations, reduce API calls, and improve translation speed.

To disable the use of translation cache, you can uncheck "Use translation cache" or click "Clear translation cache" in the API settings.

Multilingual Translation

Supports translating the same file into multiple languages at once, which is especially suitable for international video content:

  • For example: Translate an English file simultaneously into Chinese, Japanese, German, and French for the convenience of global users.
  • Supports 35 mainstream languages and will continue to expand.

Usage Notice

When using this tool, please note the following:

  • DeepL support: Since the DeepL API does not support direct calls from the web, a server-side forwarding interface is provided solely for data transmission, and it will not collect user data. For better stability, users can also choose to deploy this interface themselves.

  • Using the DeepLX free interface may sometimes return null. Please wait a moment and try again, or use your own API KEY or deploy your own forwarding interface.

  • API Key security: This tool does not store your API key; all configuration data is saved in your local browser.

  • GTX Web interface: This interface places considerable load on the server, so it is recommended to enable it manually only when deploying locally. Please avoid using it in networks with a global proxy enabled to prevent translation errors.

JSON Key Names and Their Limitations

JSON data is stored as key-value pairs, where a "key" (also known as a "name") is a string that uniquely identifies a specific item or element in the data record, forming the basis for data retrieval and manipulation. JsonTranslate leverages the identifying function of JSON key names to achieve precise translation.

Below is an explanation of several key names in the example:

  • downvote.message: This is a nested key name. downvote is the key of the outer object, and message is a key within the downvote object.
  • 提示词.message: Here, 提示词 is a key that contains an object, which in turn has a key named message.
  • share.owner: This key contains a dot (.) and is treated as a single key rather than indicating a nested relationship. In this case, if you want to access the name within the share.owner object, you cannot use share.owner.name because it would be mistakenly interpreted as looking for a name key within an owner object. In reality, share.owner is a complete key name.
{
  "downvote": {
    "message": "Downvote"
  },
  "提示词": {
    "message": "prompt"
  },
  "share.owner": {
    "name": "rabbit"
  },
  "data": {
    "title": {
      "id": "001",
      "name": "cabbages"
    }
  },
  "content": [
    {
      "id": "001",
      "value": "Hello, cabbage."
    },
    {
      "id": "002",
      "value": "Hello, Radish."
    }
  ]
}

Currently, JsonTranslate cannot process JSON key names that contain a dot (.). This is because the dot in JSONPath is used to distinguish nested object keys, which can lead to keys with dots being misinterpreted as multiple levels of nested objects. To avoid this issue, it is recommended to use key names without dots.