{
  "id": "task_libraries:translation/javascript",
  "path": "/exapedia/javascript-translation-libraries",
  "template": {
    "id": "task_libraries",
    "version": 4
  },
  "title": "JavaScript translation libraries",
  "answer": [
    {
      "t": "text",
      "text": "JavaScript translation libraries convert text from one human language to another from Node.js, the browser, or React Native. A client sends each string to a hosted machine translation API and receives the translated text with its detected source language. These libraries let apps and AI agents serve content in a reader's own language."
    }
  ],
  "breadcrumb": [
    {
      "label": "Tools"
    },
    {
      "label": "JavaScript translation libraries"
    }
  ],
  "sections": [
    {
      "id": "libraries_popularity",
      "anchor": "popularity",
      "heading": "Popularity",
      "blocks": [
        {
          "b": "table",
          "columns": [
            "Library",
            "Monthly downloads",
            "Stars",
            "Last release",
            "License"
          ],
          "rows": [
            [
              [
                {
                  "t": "link",
                  "href": "#huggingface-transformers",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F122"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F123"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F131"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F126"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F124"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#google-cloud-translate",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F143"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F144"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F150"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F147"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F145"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#aws-sdk-client-translate",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F161"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F162"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F170"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F165"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F163"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#deepl",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F181"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F182"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F188"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F185"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F183"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#azure-rest-ai-translation-text",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F194"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F195"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F203"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F198"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F196"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#google-translate-api-x",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F210"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F211"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F219"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F214"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F212"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#bing-translate-api",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F231"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F232"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F240"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F235"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F233"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#translate",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F252"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F253"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F259"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F256"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F254"
                }
              ]
            ]
          ],
          "variant": "pop",
          "caption": [
            {
              "t": "text",
              "text": "Downloads: "
            },
            {
              "t": "text",
              "text": "npm"
            },
            {
              "t": "text",
              "text": ", last thirty days. Stars and releases: GitHub. Amber: no release in over a year."
            }
          ]
        }
      ],
      "note": [
        {
          "t": "link",
          "href": "#google-cloud-translate",
          "label": [
            {
              "t": "fact",
              "fact": "F1"
            }
          ]
        },
        {
          "t": "text",
          "text": " has the most monthly downloads among dedicated translation clients in this comparison, at "
        },
        {
          "t": "fact",
          "fact": "F144"
        },
        {
          "t": "text",
          "text": "."
        }
      ]
    },
    {
      "id": "libraries_capabilities",
      "anchor": "capabilities",
      "heading": "Capabilities",
      "blocks": [
        {
          "b": "table",
          "columns": [
            "Library",
            "Local model inference",
            "Document translation"
          ],
          "rows": [
            [
              [
                {
                  "t": "link",
                  "href": "#huggingface-transformers",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F122"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F132"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F133"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#google-cloud-translate",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F143"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F151"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F152"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#aws-sdk-client-translate",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F161"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F171"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F172"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#deepl",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F181"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F189"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F190"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#azure-rest-ai-translation-text",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F194"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F204"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F205"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#google-translate-api-x",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F210"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F220"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F221"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#bing-translate-api",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F231"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F241"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F242"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#translate",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F252"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F260"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F261"
                }
              ]
            ]
          ],
          "variant": "cap"
        }
      ]
    },
    {
      "id": "libraries_entries",
      "anchor": "libraries",
      "heading": "Libraries",
      "blocks": [
        {
          "b": "entry",
          "anchor": "huggingface-transformers",
          "name": [
            {
              "t": "fact",
              "fact": "F122"
            }
          ],
          "links": [
            {
              "label": "GitHub",
              "href": "https://github.com/huggingface/transformers.js"
            },
            {
              "label": "npm",
              "href": "https://www.npmjs.com/package/@huggingface/transformers"
            },
            {
              "label": "Docs",
              "href": "https://huggingface.co/docs/transformers.js/"
            }
          ],
          "what": [
            {
              "t": "fact",
              "fact": "F129"
            }
          ],
          "facts": [
            {
              "label": "Downloads / mo",
              "value": [
                {
                  "t": "fact",
                  "fact": "F123"
                }
              ]
            },
            {
              "label": "Stars",
              "value": [
                {
                  "t": "fact",
                  "fact": "F131"
                }
              ]
            },
            {
              "label": "Last release",
              "value": [
                {
                  "t": "fact",
                  "fact": "F125"
                }
              ]
            },
            {
              "label": "License",
              "value": [
                {
                  "t": "fact",
                  "fact": "F124"
                }
              ]
            },
            {
              "label": "Capabilities",
              "value": [
                {
                  "t": "link",
                  "href": "https://huggingface.co/docs/transformers.js/",
                  "label": [
                    {
                      "t": "text",
                      "text": "From the "
                    },
                    {
                      "t": "fact",
                      "fact": "F122"
                    },
                    {
                      "t": "text",
                      "text": " docs"
                    }
                  ]
                }
              ]
            }
          ],
          "pros": [],
          "cons": [],
          "tabs": [
            {
              "label": [
                {
                  "t": "fact",
                  "fact": "F141"
                }
              ],
              "stars": [
                {
                  "t": "fact",
                  "fact": "F142"
                }
              ],
              "usedBy": [
                {
                  "t": "link",
                  "href": "https://github.com/huggingface/transformers.js-examples",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F141"
                    }
                  ]
                },
                {
                  "t": "text",
                  "text": " "
                }
              ],
              "language": "javascript",
              "code": "async (event) => {\n  // Retrieve the translation pipeline. When called for the first time,\n  // this will load the pipeline and save it for future use.\n  const translator = await MyTranslationPipeline.getInstance((x) => {\n    // We also add a progress callback to the pipeline so that we can\n    // track model loading.\n    self.postMessage(x);\n  });\n\n  // Capture partial output as it streams from the pipeline\n  const streamer = new TextStreamer(translator.tokenizer, {\n    skip_prompt: true,\n    skip_special_tokens: true,\n    callback_function: function (text) {\n      self.postMessage({\n        status: \"update\",\n        output: text,\n      });\n    },\n  });\n\n  // Actually perform the translation\n  const output = await translator(event.data.text, {\n    tgt_lang: event.data.tgt_lang,\n    src_lang: event.data.src_lang,\n\n    // Allows for partial output\n    streamer,\n  });\n\n  // Send the output back to the main thread\n  self.postMessage({\n    status: \"complete\",\n    output,\n  });\n}\n",
              "prov": [
                {
                  "t": "link",
                  "href": "https://github.com/huggingface/transformers.js-examples/blob/204b0948e88cd2bdc046316e78b754359653caea/react-translator/src/worker.js#L23-L58",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F140"
                    }
                  ]
                }
              ],
              "more": [
                {
                  "t": "link",
                  "href": "https://dashboard.exa.ai/playground/search?q=%40huggingface/transformers%20GitHub%20projects",
                  "label": [
                    {
                      "t": "text",
                      "text": "More projects using "
                    },
                    {
                      "t": "fact",
                      "fact": "F122"
                    },
                    {
                      "t": "text",
                      "text": " →"
                    }
                  ]
                }
              ]
            },
            {
              "label": [
                {
                  "t": "text",
                  "text": "Quickstart"
                }
              ],
              "language": "javascript",
              "code": "import { pipeline } from '@huggingface/transformers';\n\nconst translator = await pipeline('translation', 'Xenova/nllb-200-distilled-600M');\nconst output = await translator('जीवन एक चॉकलेट बॉक्स की तरह है।', {\nsrc_lang: 'hin_Deva', // Hindi\ntgt_lang: 'fra_Latn', // French\n});\n// [{ translation_text: 'La vie est comme une boîte à chocolat.' }]\n",
              "prov": [
                {
                  "t": "text",
                  "text": "From "
                },
                {
                  "t": "link",
                  "href": "https://cdn.jsdelivr.net/npm/@huggingface/transformers@4.3.2/types/pipelines/translation.d.ts",
                  "label": [
                    {
                      "t": "text",
                      "text": "translation.d.ts"
                    }
                  ]
                }
              ]
            }
          ],
          "install": [
            {
              "t": "fact",
              "fact": "F127"
            }
          ]
        },
        {
          "b": "entry",
          "anchor": "google-cloud-translate",
          "name": [
            {
              "t": "fact",
              "fact": "F143"
            }
          ],
          "links": [
            {
              "label": "GitHub",
              "href": "https://github.com/googleapis/google-cloud-node"
            },
            {
              "label": "npm",
              "href": "https://www.npmjs.com/package/@google-cloud/translate"
            },
            {
              "label": "Docs",
              "href": "https://cloud.google.com/translate/docs/"
            }
          ],
          "what": [
            {
              "t": "fact",
              "fact": "F13"
            }
          ],
          "facts": [
            {
              "label": "Downloads / mo",
              "value": [
                {
                  "t": "fact",
                  "fact": "F144"
                }
              ]
            },
            {
              "label": "Stars",
              "value": [
                {
                  "t": "fact",
                  "fact": "F150"
                }
              ]
            },
            {
              "label": "Last release",
              "value": [
                {
                  "t": "fact",
                  "fact": "F146"
                }
              ]
            },
            {
              "label": "License",
              "value": [
                {
                  "t": "fact",
                  "fact": "F145"
                }
              ]
            },
            {
              "label": "Capabilities",
              "value": [
                {
                  "t": "link",
                  "href": "https://cloud.google.com/translate/docs/",
                  "label": [
                    {
                      "t": "text",
                      "text": "From the "
                    },
                    {
                      "t": "fact",
                      "fact": "F143"
                    },
                    {
                      "t": "text",
                      "text": " docs"
                    }
                  ]
                }
              ]
            }
          ],
          "pros": [
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F14"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F15"
                }
              ]
            },
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F16"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F17"
                }
              ]
            }
          ],
          "cons": [
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F18"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F19"
                }
              ]
            },
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F20"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F21"
                }
              ]
            }
          ],
          "tabs": [
            {
              "label": [
                {
                  "t": "fact",
                  "fact": "F159"
                }
              ],
              "stars": [
                {
                  "t": "fact",
                  "fact": "F160"
                }
              ],
              "usedBy": [
                {
                  "t": "link",
                  "href": "https://github.com/reZach/secure-electron-template",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F159"
                    }
                  ]
                },
                {
                  "t": "text",
                  "text": " "
                }
              ],
              "language": "javascript",
              "code": "async function updateTranslations() {\n\n  try {\n    const root = \"./app/localization/locales\";\n    const fromLanguage = \"en\";\n    \n    // Get valid languages from Google Translate API\n    let [googleLanguages] = await translate.getLanguages(); // ie. { code: \"en\", name: \"English\" }\n    googleLanguages = googleLanguages.map(gl => gl.code.replace(\"-\", \"_\"))\n\n    // Uncomment me to view the various languages Google can translate to/from\n    //console.log(googleLanguages);\n\n    // Get all language directories;\n    // https://stackoverflow.com/a/35759360/1837080\n    const getDirectories = p => readdirSync(p).filter(f => statSync(join(p, f)).isDirectory());\n    const languageDirectories = getDirectories(root).filter(d => googleLanguages.includes(d));    \n\n    // For each language, read in any missing translations\n    // and translate\n    for (const languageDirectory of languageDirectories) {\n\n      // Check to make sure each language has the proper files\n      try {\n        const languageRoot = `${root}/${languageDirectory}`;\n        const translationFile = `${languageRoot}/translation.json`;\n        const missingTranslationFile = `${languageRoot}/translation.missing.json`;\n\n        const translationExists = fs.existsSync(translationFile);\n        const translationMissingExists = fs.existsSync(missingTranslationFile);\n\n        if (translationExists && translationMissingExists) {\n\n          // Read in contents of files\n          const translations = JSON.parse(fs.readFileSync(translationFile, {\n            encoding: \"utf8\"\n          }));\n          const missing = JSON.parse(fs.readFileSync(missingTranslationFile, {\n            encoding: \"utf8\"\n          }));\n\n          // Only translate files with actual values\n          const missingKeys = Object.keys(missing);        \n          if (missingKeys.length > 0){\n\n            // Translate each of the missing keys to the target language\n            for (const missingKey of missingKeys){\n              const googleTranslation = await translate.translate(missingKey, {\n                from: fromLanguage,\n                to: languageDirectory\n              });\n\n              // Only set if a value is returned\n              if (googleTranslation.length > 0){\n                translations[missingKey] = googleTranslation[0];\n              }              \n            }\n  \n            // Write output back to file\n            fs.writeFileSync(translationFile, JSON.stringify(translations, null, 2));\n            fs.writeFileSync(missingTranslationFile, JSON.stringify({}, null, 2));\n  \n            console.log(`Successfully updated translations for ${languageDirectory}`);\n          } else {\n            console.log(`Skipped creating translations for ${languageDirectory}; none found!`);\n          }          \n        } else {\n\n          // Log if we failed\n          if (!translationExists) {\n            console.error(`Could not generate translations for language '${languageDirectory}' because ${translationFile} does not exist, skipping!`);\n          } else if (!translationMissingExists) {\n            console.error(`Could not generate translations for language '${languageDirectory}' because ${missingTranslationFile} does not exist, skipping!`);\n          }\n        }\n      } catch (error) {\n        console.error(\"Failed due to fatal error\");\n        console.error(error);\n      }\n    }\n  } catch (e) {\n    console.error(\"Failed due to fatal error\");\n    console.error(e);\n  }\n}\n",
              "prov": [
                {
                  "t": "link",
                  "href": "https://github.com/reZach/secure-electron-template/blob/d392b9895a1dda53c22bb675fa1b5b0f2c29d21a/app/localization/translateMissing.js#L49-L133",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F158"
                    }
                  ]
                }
              ],
              "more": [
                {
                  "t": "link",
                  "href": "https://dashboard.exa.ai/playground/search?q=Projects%20using%20%40google-cloud/translate%20for%20text%20translation&filters=%7B%22type%22%3A%20%22auto%22%2C%20%22numResults%22%3A%2010%2C%20%22includeDomains%22%3A%20%5B%22github.com%22%5D%7D",
                  "label": [
                    {
                      "t": "text",
                      "text": "More projects using "
                    },
                    {
                      "t": "fact",
                      "fact": "F143"
                    },
                    {
                      "t": "text",
                      "text": " →"
                    }
                  ]
                }
              ]
            },
            {
              "label": [
                {
                  "t": "text",
                  "text": "Quickstart"
                }
              ],
              "language": "javascript",
              "code": "const {Translate} = require('@google-cloud/translate').v2;\nconst translate = new Translate({projectId: 'YOUR_PROJECT_ID'});\n\nasync function main() {\n  const [translation] = await translate.translate('Hello, world!', 'ru');\n  console.log(translation);\n}\nmain();\n",
              "prov": [
                {
                  "t": "text",
                  "text": "From "
                },
                {
                  "t": "link",
                  "href": "https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-translate/samples/quickstart.js",
                  "label": [
                    {
                      "t": "text",
                      "text": "quickstart.js"
                    }
                  ]
                }
              ]
            }
          ],
          "install": [
            {
              "t": "fact",
              "fact": "F148"
            }
          ]
        },
        {
          "b": "entry",
          "anchor": "aws-sdk-client-translate",
          "name": [
            {
              "t": "fact",
              "fact": "F161"
            }
          ],
          "links": [
            {
              "label": "GitHub",
              "href": "https://github.com/aws/aws-sdk-js-v3"
            },
            {
              "label": "npm",
              "href": "https://www.npmjs.com/package/@aws-sdk/client-translate"
            },
            {
              "label": "Docs",
              "href": "https://docs.aws.amazon.com/translate/"
            }
          ],
          "what": [
            {
              "t": "fact",
              "fact": "F168"
            }
          ],
          "facts": [
            {
              "label": "Downloads / mo",
              "value": [
                {
                  "t": "fact",
                  "fact": "F162"
                }
              ]
            },
            {
              "label": "Stars",
              "value": [
                {
                  "t": "fact",
                  "fact": "F170"
                }
              ]
            },
            {
              "label": "Last release",
              "value": [
                {
                  "t": "fact",
                  "fact": "F164"
                }
              ]
            },
            {
              "label": "License",
              "value": [
                {
                  "t": "fact",
                  "fact": "F163"
                }
              ]
            },
            {
              "label": "Capabilities",
              "value": [
                {
                  "t": "link",
                  "href": "https://docs.aws.amazon.com/translate/",
                  "label": [
                    {
                      "t": "text",
                      "text": "From the "
                    },
                    {
                      "t": "fact",
                      "fact": "F161"
                    },
                    {
                      "t": "text",
                      "text": " docs"
                    }
                  ]
                }
              ]
            }
          ],
          "pros": [],
          "cons": [],
          "tabs": [
            {
              "label": [
                {
                  "t": "fact",
                  "fact": "F179"
                }
              ],
              "stars": [
                {
                  "t": "fact",
                  "fact": "F180"
                }
              ],
              "usedBy": [
                {
                  "t": "link",
                  "href": "https://github.com/aws-amplify/amplify-js",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F179"
                    }
                  ]
                },
                {
                  "t": "text",
                  "text": " "
                }
              ],
              "language": "javascript",
              "code": "protected async translateText(\n\tinput: TranslateTextInput,\n): Promise<TranslateTextOutput> {\n\tlogger.debug('Starting translation');\n\n\tconst { translateText = {} } =\n\t\tthis._resolveCtx().resourcesConfig.Predictions?.convert ?? {};\n\tassertValidationError(\n\t\t!!translateText.region,\n\t\tPredictionsValidationErrorCode.NoRegion,\n\t);\n\tconst { defaults = {}, region } = translateText;\n\n\tconst { credentials } = await this._resolveCtx().fetchAuthSession();\n\tassertValidationError(\n\t\t!!credentials,\n\t\tPredictionsValidationErrorCode.NoCredentials,\n\t);\n\n\tconst { sourceLanguage, targetLanguage } = defaults;\n\tconst sourceLanguageCode =\n\t\tinput.translateText?.source?.language ?? sourceLanguage;\n\tconst targetLanguageCode =\n\t\tinput.translateText?.targetLanguage ?? targetLanguage;\n\tassertValidationError(\n\t\t!!sourceLanguageCode,\n\t\tPredictionsValidationErrorCode.NoSourceLanguage,\n\t);\n\tassertValidationError(\n\t\t!!targetLanguageCode,\n\t\tPredictionsValidationErrorCode.NoTargetLanguage,\n\t);\n\n\tthis.translateClient = new TranslateClient({\n\t\tregion,\n\t\tcredentials,\n\t\tcustomUserAgent: getAmplifyUserAgentObject({\n\t\t\tcategory: Category.Predictions,\n\t\t\taction: PredictionsAction.Convert,\n\t\t}),\n\t});\n\tconst translateTextCommand = new TranslateTextCommand({\n\t\tSourceLanguageCode: sourceLanguageCode,\n\t\tTargetLanguageCode: targetLanguageCode,\n\t\tText: input.translateText?.source?.text,\n\t});\n\tconst data = await this.translateClient.send(translateTextCommand);\n\n\treturn {\n\t\ttext: data.TranslatedText,\n\t\tlanguage: data.TargetLanguageCode,\n\t} as TranslateTextOutput;\n}\n",
              "prov": [
                {
                  "t": "link",
                  "href": "https://github.com/aws-amplify/amplify-js/blob/9e01896b2f4346c10e980afe7bcd1d68207f7502/packages/predictions/src/providers/AmazonAIConvertPredictionsProvider.ts#L105-L157",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F178"
                    }
                  ]
                }
              ],
              "more": [
                {
                  "t": "link",
                  "href": "https://dashboard.exa.ai/playground/search?q=%40aws-sdk/client-translate%20GitHub%20projects",
                  "label": [
                    {
                      "t": "text",
                      "text": "More projects using "
                    },
                    {
                      "t": "fact",
                      "fact": "F161"
                    },
                    {
                      "t": "text",
                      "text": " →"
                    }
                  ]
                }
              ]
            },
            {
              "label": [
                {
                  "t": "text",
                  "text": "Quickstart"
                }
              ],
              "language": "javascript",
              "code": "import { TranslateClient, TranslateTextCommand } from \"@aws-sdk/client-translate\";\n\nconst client = new TranslateClient({ region: \"us-east-1\" });\nconst result = await client.send(new TranslateTextCommand({\n  Text: \"Hello, world!\",\n  SourceLanguageCode: \"en\",\n  TargetLanguageCode: \"es\",\n}));\nconsole.log(result.TranslatedText);\n",
              "prov": [
                {
                  "t": "text",
                  "text": "From "
                },
                {
                  "t": "link",
                  "href": "https://cdn.jsdelivr.net/npm/@aws-sdk/client-translate@3.1172.0/dist-types/commands/TranslateTextCommand.d.ts",
                  "label": [
                    {
                      "t": "text",
                      "text": "TranslateTextCommand.d.ts"
                    }
                  ]
                }
              ]
            }
          ],
          "install": [
            {
              "t": "fact",
              "fact": "F166"
            }
          ]
        },
        {
          "b": "entry",
          "anchor": "deepl",
          "name": [
            {
              "t": "fact",
              "fact": "F181"
            }
          ],
          "links": [
            {
              "label": "GitHub",
              "href": "https://github.com/DeepL/deepl-node"
            },
            {
              "label": "npm",
              "href": "https://www.npmjs.com/package/deepl-node"
            },
            {
              "label": "Docs",
              "href": "https://github.com/DeepLcom/deepl-node"
            }
          ],
          "what": [
            {
              "t": "fact",
              "fact": "F40"
            }
          ],
          "facts": [
            {
              "label": "Downloads / mo",
              "value": [
                {
                  "t": "fact",
                  "fact": "F182"
                }
              ]
            },
            {
              "label": "Stars",
              "value": [
                {
                  "t": "fact",
                  "fact": "F188"
                }
              ]
            },
            {
              "label": "Last release",
              "value": [
                {
                  "t": "fact",
                  "fact": "F184"
                }
              ]
            },
            {
              "label": "License",
              "value": [
                {
                  "t": "fact",
                  "fact": "F183"
                }
              ]
            },
            {
              "label": "Capabilities",
              "value": [
                {
                  "t": "link",
                  "href": "https://github.com/DeepLcom/deepl-node",
                  "label": [
                    {
                      "t": "text",
                      "text": "From the "
                    },
                    {
                      "t": "fact",
                      "fact": "F181"
                    },
                    {
                      "t": "text",
                      "text": " docs"
                    }
                  ]
                }
              ]
            }
          ],
          "pros": [
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F41"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F42"
                }
              ]
            },
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F43"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F44"
                }
              ]
            }
          ],
          "cons": [
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F45"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F46"
                }
              ]
            },
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F47"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F48"
                }
              ]
            }
          ],
          "tabs": [
            {
              "label": [
                {
                  "t": "text",
                  "text": "Quickstart"
                }
              ],
              "language": "javascript",
              "code": "import * as deepl from \"deepl-node\";\n\nconst client = new deepl.DeepLClient(process.env.DEEPL_AUTH_KEY);\nconst result = await client.translateText(\"Hello, world!\", null, \"fr\");\nconsole.log(result.text);\n",
              "prov": [
                {
                  "t": "text",
                  "text": "From "
                },
                {
                  "t": "link",
                  "href": "https://github.com/DeepL/deepl-node/blob/main/README.md",
                  "label": [
                    {
                      "t": "text",
                      "text": "README.md"
                    }
                  ]
                }
              ],
              "more": [
                {
                  "t": "link",
                  "href": "https://dashboard.exa.ai/playground/search?q=Projects%20using%20deepl-node%20for%20text%20translation&filters=%7B%22type%22%3A%20%22auto%22%2C%20%22numResults%22%3A%2010%2C%20%22includeDomains%22%3A%20%5B%22github.com%22%5D%7D",
                  "label": [
                    {
                      "t": "text",
                      "text": "Find projects using "
                    },
                    {
                      "t": "fact",
                      "fact": "F181"
                    },
                    {
                      "t": "text",
                      "text": " →"
                    }
                  ]
                }
              ]
            }
          ],
          "install": [
            {
              "t": "fact",
              "fact": "F186"
            }
          ]
        },
        {
          "b": "entry",
          "anchor": "azure-rest-ai-translation-text",
          "name": [
            {
              "t": "fact",
              "fact": "F194"
            }
          ],
          "links": [
            {
              "label": "GitHub",
              "href": "https://github.com/Azure/azure-sdk-for-js"
            },
            {
              "label": "npm",
              "href": "https://www.npmjs.com/package/@azure-rest/ai-translation-text"
            },
            {
              "label": "Docs",
              "href": "https://learn.microsoft.com/azure/ai-services/translator/"
            }
          ],
          "what": [
            {
              "t": "fact",
              "fact": "F201"
            }
          ],
          "facts": [
            {
              "label": "Downloads / mo",
              "value": [
                {
                  "t": "fact",
                  "fact": "F195"
                }
              ]
            },
            {
              "label": "Stars",
              "value": [
                {
                  "t": "fact",
                  "fact": "F203"
                }
              ]
            },
            {
              "label": "Last release",
              "value": [
                {
                  "t": "fact",
                  "fact": "F197"
                }
              ]
            },
            {
              "label": "License",
              "value": [
                {
                  "t": "fact",
                  "fact": "F196"
                }
              ]
            },
            {
              "label": "Capabilities",
              "value": [
                {
                  "t": "link",
                  "href": "https://learn.microsoft.com/azure/ai-services/translator/",
                  "label": [
                    {
                      "t": "text",
                      "text": "From the "
                    },
                    {
                      "t": "fact",
                      "fact": "F194"
                    },
                    {
                      "t": "text",
                      "text": " docs"
                    }
                  ]
                }
              ]
            }
          ],
          "pros": [],
          "cons": [],
          "tabs": [
            {
              "label": [
                {
                  "t": "text",
                  "text": "Quickstart"
                }
              ],
              "language": "typescript",
              "code": "import TextTranslationClient, {isUnexpected} from \"@azure-rest/ai-translation-text\";\nconst client = TextTranslationClient(\n  \"https://api.cognitive.microsofttranslator.com\",\n  {key: \"YOUR_SUBSCRIPTION_KEY\", region: \"westus\"},\n);\nconst response = await client.path(\"/translate\").post({\n  body: {inputs: [{\n    text: \"This is a test.\",\n    targets: [{language: \"cs\"}],\n    language: \"en\",\n  }]},\n});\nif (isUnexpected(response)) throw response.body.error;\nconsole.log(response.body.value[0]?.translations[0]?.text);\n",
              "prov": [
                {
                  "t": "text",
                  "text": "From "
                },
                {
                  "t": "link",
                  "href": "https://github.com/Azure/azure-sdk-for-js/blob/432eb180eca8490d9086033f1699b788473e4149/sdk/translation/ai-translation-text-rest/README.md",
                  "label": [
                    {
                      "t": "text",
                      "text": "README.md"
                    }
                  ]
                }
              ],
              "more": [
                {
                  "t": "link",
                  "href": "https://dashboard.exa.ai/playground/search?q=%40azure-rest/ai-translation-text%20GitHub%20projects",
                  "label": [
                    {
                      "t": "text",
                      "text": "Find projects using "
                    },
                    {
                      "t": "fact",
                      "fact": "F194"
                    },
                    {
                      "t": "text",
                      "text": " →"
                    }
                  ]
                }
              ]
            }
          ],
          "install": [
            {
              "t": "fact",
              "fact": "F199"
            }
          ]
        },
        {
          "b": "entry",
          "anchor": "google-translate-api-x",
          "name": [
            {
              "t": "fact",
              "fact": "F210"
            }
          ],
          "links": [
            {
              "label": "GitHub",
              "href": "https://github.com/AidanWelch/google-translate-api"
            },
            {
              "label": "npm",
              "href": "https://www.npmjs.com/package/google-translate-api-x"
            }
          ],
          "what": [
            {
              "t": "fact",
              "fact": "F217"
            }
          ],
          "facts": [
            {
              "label": "Downloads / mo",
              "value": [
                {
                  "t": "fact",
                  "fact": "F211"
                }
              ]
            },
            {
              "label": "Stars",
              "value": [
                {
                  "t": "fact",
                  "fact": "F219"
                }
              ]
            },
            {
              "label": "Last release",
              "value": [
                {
                  "t": "fact",
                  "fact": "F213"
                }
              ]
            },
            {
              "label": "License",
              "value": [
                {
                  "t": "fact",
                  "fact": "F212"
                }
              ]
            },
            {
              "label": "Capabilities",
              "value": [
                {
                  "t": "link",
                  "href": "https://github.com/AidanWelch/google-translate-api",
                  "label": [
                    {
                      "t": "text",
                      "text": "From the "
                    },
                    {
                      "t": "fact",
                      "fact": "F210"
                    },
                    {
                      "t": "text",
                      "text": " docs"
                    }
                  ]
                }
              ]
            }
          ],
          "pros": [],
          "cons": [],
          "tabs": [
            {
              "label": [
                {
                  "t": "fact",
                  "fact": "F229"
                }
              ],
              "stars": [
                {
                  "t": "fact",
                  "fact": "F230"
                }
              ],
              "usedBy": [
                {
                  "t": "link",
                  "href": "https://github.com/eugene-khyst/artistassistapp",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F229"
                    }
                  ]
                },
                {
                  "t": "text",
                  "text": " "
                }
              ],
              "language": "javascript",
              "code": "async function translateText(\n  sourceText: string,\n  sourceLang: SourceLang,\n  targetLang: TargetLang\n): Promise<string | undefined> {\n  const result = await translate(padLinguiTags(sourceText), {\n    from: sourceLang,\n    to: GOOGLE_TRANSLATE_LANGS[targetLang] ?? targetLang,\n    forceBatch: true,\n    autoCorrect: false,\n  });\n  return result.text ? restoreLinguiTags(sourceText, result.text) : undefined;\n}\n",
              "prov": [
                {
                  "t": "link",
                  "href": "https://github.com/eugene-khyst/artistassistapp/blob/1e3bb0e8ccb692683541bac8977a565409254fc0/translate-po.ts#L83-L95",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F228"
                    }
                  ]
                }
              ],
              "more": [
                {
                  "t": "link",
                  "href": "https://dashboard.exa.ai/playground/search?q=google-translate-api-x%20GitHub%20projects",
                  "label": [
                    {
                      "t": "text",
                      "text": "More projects using "
                    },
                    {
                      "t": "fact",
                      "fact": "F210"
                    },
                    {
                      "t": "text",
                      "text": " →"
                    }
                  ]
                }
              ]
            },
            {
              "label": [
                {
                  "t": "text",
                  "text": "Quickstart"
                }
              ],
              "language": "javascript",
              "code": "import { translate } from 'google-translate-api-x';\n\nconst res = await translate('Ik spreek Engels', {to: 'en'});\nconsole.log(res.text);\n",
              "prov": [
                {
                  "t": "text",
                  "text": "From "
                },
                {
                  "t": "link",
                  "href": "https://github.com/AidanWelch/google-translate-api/blob/master/README.md",
                  "label": [
                    {
                      "t": "text",
                      "text": "README.md"
                    }
                  ]
                }
              ]
            }
          ],
          "install": [
            {
              "t": "fact",
              "fact": "F215"
            }
          ]
        },
        {
          "b": "entry",
          "anchor": "bing-translate-api",
          "name": [
            {
              "t": "fact",
              "fact": "F231"
            }
          ],
          "links": [
            {
              "label": "GitHub",
              "href": "https://github.com/plainheart/bing-translate-api"
            },
            {
              "label": "npm",
              "href": "https://www.npmjs.com/package/bing-translate-api"
            }
          ],
          "what": [
            {
              "t": "fact",
              "fact": "F238"
            }
          ],
          "facts": [
            {
              "label": "Downloads / mo",
              "value": [
                {
                  "t": "fact",
                  "fact": "F232"
                }
              ]
            },
            {
              "label": "Stars",
              "value": [
                {
                  "t": "fact",
                  "fact": "F240"
                }
              ]
            },
            {
              "label": "Last release",
              "value": [
                {
                  "t": "fact",
                  "fact": "F234"
                }
              ]
            },
            {
              "label": "License",
              "value": [
                {
                  "t": "fact",
                  "fact": "F233"
                }
              ]
            },
            {
              "label": "Capabilities",
              "value": [
                {
                  "t": "link",
                  "href": "https://github.com/plainheart/bing-translate-api",
                  "label": [
                    {
                      "t": "text",
                      "text": "From the "
                    },
                    {
                      "t": "fact",
                      "fact": "F231"
                    },
                    {
                      "t": "text",
                      "text": " docs"
                    }
                  ]
                }
              ]
            }
          ],
          "pros": [],
          "cons": [],
          "tabs": [
            {
              "label": [
                {
                  "t": "fact",
                  "fact": "F250"
                }
              ],
              "stars": [
                {
                  "t": "fact",
                  "fact": "F251"
                }
              ],
              "usedBy": [
                {
                  "t": "link",
                  "href": "https://github.com/SillyTavern/SillyTavern",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F250"
                    }
                  ]
                },
                {
                  "t": "text",
                  "text": " "
                }
              ],
              "language": "javascript",
              "code": "async (request, response) => {\n    try {\n        const text = request.body.text;\n        let lang = request.body.lang;\n\n        if (request.body.lang === 'zh-CN') {\n            lang = 'zh-Hans';\n        }\n\n        if (request.body.lang === 'zh-TW') {\n            lang = 'zh-Hant';\n        }\n\n        if (request.body.lang === 'pt-BR') {\n            lang = 'pt';\n        }\n\n        if (!text || !lang) {\n            return response.sendStatus(400);\n        }\n\n        console.debug('Input text: ' + text);\n\n        const result = await bingTranslate(text, null, lang);\n        const translatedText = result?.translation;\n        console.debug('Translated text: ' + translatedText);\n        return response.send(translatedText);\n    } catch (error) {\n        console.error('Translation error', error);\n        return response.sendStatus(500);\n    }\n}\n",
              "prov": [
                {
                  "t": "link",
                  "href": "https://github.com/SillyTavern/SillyTavern/blob/06bde939fb1e9c4c8d8641d810f0a916b5bce127/src/endpoints/translate.js#L378-L409",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F249"
                    }
                  ]
                }
              ],
              "more": [
                {
                  "t": "link",
                  "href": "https://dashboard.exa.ai/playground/search?q=bing-translate-api%20GitHub%20projects",
                  "label": [
                    {
                      "t": "text",
                      "text": "More projects using "
                    },
                    {
                      "t": "fact",
                      "fact": "F231"
                    },
                    {
                      "t": "text",
                      "text": " →"
                    }
                  ]
                }
              ]
            },
            {
              "label": [
                {
                  "t": "text",
                  "text": "Quickstart"
                }
              ],
              "language": "javascript",
              "code": "const { translate } = require('bing-translate-api');\n\ntranslate('你好', null, 'en').then(res => {\n  console.log(res.translation);\n}).catch(err => {\n  console.error(err);\n});\n",
              "prov": [
                {
                  "t": "text",
                  "text": "From "
                },
                {
                  "t": "link",
                  "href": "https://github.com/plainheart/bing-translate-api/blob/master/README.md",
                  "label": [
                    {
                      "t": "text",
                      "text": "README.md"
                    }
                  ]
                }
              ]
            }
          ],
          "install": [
            {
              "t": "fact",
              "fact": "F236"
            }
          ]
        },
        {
          "b": "entry",
          "anchor": "translate",
          "name": [
            {
              "t": "fact",
              "fact": "F252"
            }
          ],
          "links": [
            {
              "label": "GitHub",
              "href": "https://github.com/franciscop/translate"
            },
            {
              "label": "npm",
              "href": "https://www.npmjs.com/package/translate"
            }
          ],
          "what": [
            {
              "t": "fact",
              "fact": "F80"
            }
          ],
          "facts": [
            {
              "label": "Downloads / mo",
              "value": [
                {
                  "t": "fact",
                  "fact": "F253"
                }
              ]
            },
            {
              "label": "Stars",
              "value": [
                {
                  "t": "fact",
                  "fact": "F259"
                }
              ]
            },
            {
              "label": "Last release",
              "value": [
                {
                  "t": "fact",
                  "fact": "F255"
                }
              ]
            },
            {
              "label": "License",
              "value": [
                {
                  "t": "fact",
                  "fact": "F254"
                }
              ]
            },
            {
              "label": "Capabilities",
              "value": [
                {
                  "t": "link",
                  "href": "https://github.com/franciscop/translate",
                  "label": [
                    {
                      "t": "text",
                      "text": "From the "
                    },
                    {
                      "t": "fact",
                      "fact": "F252"
                    },
                    {
                      "t": "text",
                      "text": " docs"
                    }
                  ]
                }
              ]
            }
          ],
          "pros": [
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F81"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F82"
                }
              ]
            },
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F83"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F84"
                }
              ]
            }
          ],
          "cons": [
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F85"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F86"
                }
              ]
            },
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F87"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F88"
                }
              ]
            }
          ],
          "tabs": [
            {
              "label": [
                {
                  "t": "fact",
                  "fact": "F268"
                }
              ],
              "stars": [
                {
                  "t": "fact",
                  "fact": "F269"
                }
              ],
              "usedBy": [
                {
                  "t": "link",
                  "href": "https://github.com/tokens-studio/figma-plugin",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F268"
                    }
                  ]
                },
                {
                  "t": "text",
                  "text": " "
                }
              ],
              "language": "javascript",
              "code": "async function autoTranslate() {\n\n  const sourceOfTruth = await glob('**/*.json', {\n    cwd: sourceRoot,\n  });\n\n  const targetLanguages = (await fs.readdir(langRoot)).filter((file) => file !== 'en')\n\n  console.log('Found source of truth files: ', sourceOfTruth);\n  console.log(`Found ${targetLanguages.length} target languages `);\n\n  sourceOfTruth.map(async (file) => {\n    // Load the file contents\n\n    const source = await fs.readFile(path.join(sourceRoot, file), 'utf8');\n    const sourceObj = JSON.parse(source);\n\n    // This flattens the potentially nested object into a single level\n    const keys = deepKeys(sourceObj);\n\n    // Attempt to translate target languages\n    await Promise.all(targetLanguages.map(async (lang) => {\n      let existing = {};\n      try {\n        const existingFile = await fs.readFile(path.join(langRoot, lang, file), 'utf8');\n        existing = JSON.parse(existingFile);\n      } catch (err) {\n        // Assume it doesn't exist\n        existing = {};\n      }\n\n      const initial = Promise.resolve(existing);\n\n      const completed = await keys.reduce(async (acc, key) => {\n\n        const newAcc = await acc;\n\n        if (hasProperty(newAcc, key)) {\n          // Already translated\n          return newAcc;\n        }\n\n        const value = getProperty(sourceObj, key);\n\n        // Check if the value contains double braces with interpolation placeholders\n        const hasInterpolation = /\\{\\{([^{}]+?)\\}\\}/.test(value);\n        if (hasInterpolation) {\n            // Extract the interpolation placeholders and preserve the braces\n            const placeholders = value.match(/\\{\\{([^{}]+?)\\}\\}/g);\n\n            // Replace the interpolation placeholders with a placeholder token\n            const placeholderToken = '__PLACEHOLDER__';\n            const replacedValue = value.replace(/\\{\\{([^{}]+?)\\}\\}/g, placeholderToken);\n\n            // Translate the replaced value\n            // @ts-ignore\n            const translated = await translate(replacedValue, { from: 'en', to: lang });\n\n            // Restore the interpolation placeholders using the placeholder token\n            const translatedValue = placeholders.reduce((acc, placeholder) => {\n              return acc.replace(placeholderToken, placeholder);\n            }, translated);\n\n            setProperty(newAcc, key, translatedValue);\n        } else {\n\n          try {  // @ts-ignore\n            const translated = await translate(value, { from: 'en', to: lang });\n            \n            setProperty(newAcc, key, translated);\n            \n          } catch (err) {\n            console.log(`Failed to translate ${key} in ${file} to ${lang}`);\n          }\n        }\n        return newAcc\n      }, initial);\n\n\n      await fs.writeFile(path.join(langRoot, lang, file), `${JSON.stringify(completed, null, 2)}\\n`);\n    }));\n  });\n\n}\n",
              "prov": [
                {
                  "t": "link",
                  "href": "https://github.com/tokens-studio/figma-plugin/blob/03c0a245dccd152f20b986df7d62681c9d23db93/packages/tokens-studio-for-figma/scripts/translate.mjs#L19-L102",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F267"
                    }
                  ]
                }
              ],
              "more": [
                {
                  "t": "link",
                  "href": "https://dashboard.exa.ai/playground/search?q=Projects%20using%20translate%20for%20text%20translation&filters=%7B%22type%22%3A%20%22auto%22%2C%20%22numResults%22%3A%2010%2C%20%22includeDomains%22%3A%20%5B%22github.com%22%5D%7D",
                  "label": [
                    {
                      "t": "text",
                      "text": "More projects using "
                    },
                    {
                      "t": "fact",
                      "fact": "F252"
                    },
                    {
                      "t": "text",
                      "text": " →"
                    }
                  ]
                }
              ]
            },
            {
              "label": [
                {
                  "t": "text",
                  "text": "Quickstart"
                }
              ],
              "language": "javascript",
              "code": "import translate from \"translate\";\n\ntranslate.engine = \"deepl\";\ntranslate.key = process.env.DEEPL_KEY;\n\nconst text = await translate(\"Hello world\", \"es\");\nconsole.log(text);\n// \"Hola mundo\"\n",
              "prov": [
                {
                  "t": "text",
                  "text": "From "
                },
                {
                  "t": "link",
                  "href": "https://github.com/franciscop/translate/blob/master/readme.md",
                  "label": [
                    {
                      "t": "text",
                      "text": "readme.md"
                    }
                  ]
                }
              ]
            }
          ],
          "install": [
            {
              "t": "fact",
              "fact": "F257"
            }
          ]
        }
      ]
    }
  ],
  "questions": [
    {
      "q": "Which JavaScript translation library should I use?",
      "a": [
        {
          "t": "link",
          "href": "#google-cloud-translate",
          "label": [
            {
              "t": "text",
              "text": "Google Cloud Translate"
            }
          ]
        },
        {
          "t": "text",
          "text": " suits apps that need text and document translation on Google Cloud. "
        },
        {
          "t": "link",
          "href": "#deepl",
          "label": [
            {
              "t": "text",
              "text": "DeepL"
            }
          ]
        },
        {
          "t": "text",
          "text": " suits apps that translate documents and want glossary support. "
        },
        {
          "t": "link",
          "href": "#huggingface-transformers",
          "label": [
            {
              "t": "text",
              "text": "Transformers.js"
            }
          ]
        },
        {
          "t": "text",
          "text": " suits apps that must translate on the device without a server."
        }
      ]
    },
    {
      "q": "How do I use the Google Translate API in JavaScript?",
      "a": [
        {
          "t": "text",
          "text": "Install "
        },
        {
          "t": "link",
          "href": "#google-cloud-translate",
          "label": [
            {
              "t": "text",
              "text": "@google-cloud/translate"
            }
          ]
        },
        {
          "t": "text",
          "text": " and create a client with a Google Cloud project's credentials. The client's translate method takes the text and a target language code."
        }
      ]
    },
    {
      "q": "What is the DeepL API?",
      "a": [
        {
          "t": "text",
          "text": "The DeepL API is a paid machine translation service with a free tier. "
        },
        {
          "t": "link",
          "href": "#deepl",
          "label": [
            {
              "t": "text",
              "text": "DeepL"
            }
          ]
        },
        {
          "t": "text",
          "text": " provides its official Node.js client for text and document translation."
        }
      ]
    },
    {
      "q": "DeepL vs Google Translate: which should I use?",
      "a": [
        {
          "t": "link",
          "href": "#deepl",
          "label": [
            {
              "t": "text",
              "text": "DeepL"
            }
          ]
        },
        {
          "t": "text",
          "text": " supports fewer languages and adds glossaries and formality control. "
        },
        {
          "t": "link",
          "href": "#google-cloud-translate",
          "label": [
            {
              "t": "text",
              "text": "Google Cloud Translate"
            }
          ]
        },
        {
          "t": "text",
          "text": " covers more languages and supports custom models on Google Cloud."
        }
      ]
    },
    {
      "q": "Is there a free translation API for JavaScript?",
      "a": [
        {
          "t": "link",
          "href": "#google-translate-api-x",
          "label": [
            {
              "t": "text",
              "text": "google-translate-api-x"
            }
          ]
        },
        {
          "t": "text",
          "text": " and "
        },
        {
          "t": "link",
          "href": "#bing-translate-api",
          "label": [
            {
              "t": "text",
              "text": "bing-translate-api"
            }
          ]
        },
        {
          "t": "text",
          "text": " call the free web translators without an API key. Both rely on unofficial endpoints that can change or rate-limit requests without notice."
        }
      ]
    },
    {
      "q": "How does Azure Translator work in JavaScript?",
      "a": [
        {
          "t": "text",
          "text": "The "
        },
        {
          "t": "link",
          "href": "#azure-rest-ai-translation-text",
          "label": [
            {
              "t": "text",
              "text": "Azure Translator client"
            }
          ]
        },
        {
          "t": "text",
          "text": " is an isomorphic REST client for Node.js and the browser. It authenticates with an Azure resource key and region."
        }
      ]
    }
  ],
  "facts": {
    "F1": {
      "label": "Library name, @google-cloud/translate",
      "display": "Google Cloud Translate",
      "asOf": "2026-11-17"
    },
    "F2": {
      "label": "Monthly downloads, @google-cloud/translate",
      "display": "2.7M",
      "asOf": "2026-11-15"
    },
    "F3": {
      "label": "License, @google-cloud/translate",
      "display": "Apache-2.0",
      "asOf": "2026-11-17"
    },
    "F4": {
      "label": "Package release, @google-cloud/translate",
      "display": "10.3.0",
      "asOf": "2026-11-17"
    },
    "F5": {
      "label": "Undated package release, @google-cloud/translate",
      "display": "v10.3.0",
      "asOf": "2026-11-17"
    },
    "F6": {
      "label": "Repository stars, @google-cloud/translate",
      "display": "3.2K",
      "asOf": "2026-11-17"
    },
    "F7": {
      "label": "Automatic source language, @google-cloud/translate",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F8": {
      "label": "Text batches, @google-cloud/translate",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F9": {
      "label": "Document translation, @google-cloud/translate",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F10": {
      "label": "Glossaries, @google-cloud/translate",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F11": {
      "label": "Output formats, @google-cloud/translate",
      "display": "PDF",
      "asOf": "2026-11-17"
    },
    "F12": {
      "label": "Install, @google-cloud/translate",
      "display": "npm install @google-cloud/translate",
      "asOf": "2026-11-17"
    },
    "F13": {
      "label": "What it does, @google-cloud/translate",
      "display": "Provides Node.js clients for Google Cloud text and document translation.",
      "asOf": "2026-11-17"
    },
    "F14": {
      "label": "strengths lead, @google-cloud/translate",
      "display": "Translates formatted documents",
      "asOf": "2026-11-17"
    },
    "F15": {
      "label": "strengths, @google-cloud/translate",
      "display": "Use the Advanced client for document translation.",
      "asOf": "2026-11-17"
    },
    "F16": {
      "label": "strengths lead, @google-cloud/translate",
      "display": "Uses custom translation terminology",
      "asOf": "2026-11-17"
    },
    "F17": {
      "label": "strengths, @google-cloud/translate",
      "display": "Apply a glossary to Advanced document translation.",
      "asOf": "2026-11-17"
    },
    "F18": {
      "label": "limitations lead, @google-cloud/translate",
      "display": "Mixed PDFs skip scanned content",
      "asOf": "2026-11-17"
    },
    "F19": {
      "label": "limitations, @google-cloud/translate",
      "display": "Scanned content stays untranslated in PDFs containing both scanned and native text.",
      "asOf": "2026-11-17"
    },
    "F20": {
      "label": "limitations lead, @google-cloud/translate",
      "display": "Requires a billed cloud project",
      "asOf": "2026-11-17"
    },
    "F21": {
      "label": "limitations, @google-cloud/translate",
      "display": "Enable Cloud Translation and billing before authenticating the client.",
      "asOf": "2026-11-17"
    },
    "F22": {
      "label": "Quickstart, @google-cloud/translate",
      "display": "// Copyright 2026 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n//      http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n'use strict';\n\nfunction main(\n  projectId = 'YOUR_PROJECT_ID' // Your GCP Project Id\n) {\n  // [START translate_quickstart]\n  /**\n   * TODO(developer): Uncomment the following line before running the sample.\n   */\n  // const projectId = 'YOUR_PROJECT_ID';\n\n  // Imports the Google Cloud client library\n  const {Translate} = require('@google-cloud/translate').v2;\n\n  // Instantiates a client\n  const translate = new Translate({projectId});\n\n  async function quickStart() {\n    // The text to translate\n    const text = 'Hello, world!';\n\n    // The target language\n    const target = 'ru';\n\n    // Translates some text into Russian\n    const [translation] = await translate.translate(text, target);\n    console.log(`Text: ${text}`);\n    console.log(`Translation: ${translation}`);\n  }\n\n  quickStart();\n  // [END translate_quickstart]\n}\n\nmain(...process.argv.slice(2));\n",
      "asOf": "2026-11-17"
    },
    "F23": {
      "label": "Project function, @google-cloud/translate",
      "display": "async function updateTranslations() {\n\n  try {\n    const root = \"./app/localization/locales\";\n    const fromLanguage = \"en\";\n    \n    // Get valid languages from Google Translate API\n    let [googleLanguages] = await translate.getLanguages(); // ie. { code: \"en\", name: \"English\" }\n    googleLanguages = googleLanguages.map(gl => gl.code.replace(\"-\", \"_\"))\n\n    // Uncomment me to view the various languages Google can translate to/from\n    //console.log(googleLanguages);\n\n    // Get all language directories;\n    // https://stackoverflow.com/a/35759360/1837080\n    const getDirectories = p => readdirSync(p).filter(f => statSync(join(p, f)).isDirectory());\n    const languageDirectories = getDirectories(root).filter(d => googleLanguages.includes(d));    \n\n    // For each language, read in any missing translations\n    // and translate\n    for (const languageDirectory of languageDirectories) {\n\n      // Check to make sure each language has the proper files\n      try {\n        const languageRoot = `${root}/${languageDirectory}`;\n        const translationFile = `${languageRoot}/translation.json`;\n        const missingTranslationFile = `${languageRoot}/translation.missing.json`;\n\n        const translationExists = fs.existsSync(translationFile);\n        const translationMissingExists = fs.existsSync(missingTranslationFile);\n\n        if (translationExists && translationMissingExists) {\n\n          // Read in contents of files\n          const translations = JSON.parse(fs.readFileSync(translationFile, {\n            encoding: \"utf8\"\n          }));\n          const missing = JSON.parse(fs.readFileSync(missingTranslationFile, {\n            encoding: \"utf8\"\n          }));\n\n          // Only translate files with actual values\n          const missingKeys = Object.keys(missing);        \n          if (missingKeys.length > 0){\n\n            // Translate each of the missing keys to the target language\n            for (const missingKey of missingKeys){\n              const googleTranslation = await translate.translate(missingKey, {\n                from: fromLanguage,\n                to: languageDirectory\n              });\n\n              // Only set if a value is returned\n              if (googleTranslation.length > 0){\n                translations[missingKey] = googleTranslation[0];\n              }              \n            }\n  \n            // Write output back to file\n            fs.writeFileSync(translationFile, JSON.stringify(translations, null, 2));\n            fs.writeFileSync(missingTranslationFile, JSON.stringify({}, null, 2));\n  \n            console.log(`Successfully updated translations for ${languageDirectory}`);\n          } else {\n            console.log(`Skipped creating translations for ${languageDirectory}; none found!`);\n          }          \n        } else {\n\n          // Log if we failed\n          if (!translationExists) {\n            console.error(`Could not generate translations for language '${languageDirectory}' because ${translationFile} does not exist, skipping!`);\n          } else if (!translationMissingExists) {\n            console.error(`Could not generate translations for language '${languageDirectory}' because ${missingTranslationFile} does not exist, skipping!`);\n          }\n        }\n      } catch (error) {\n        console.error(\"Failed due to fatal error\");\n        console.error(error);\n      }\n    }\n  } catch (e) {\n    console.error(\"Failed due to fatal error\");\n    console.error(e);\n  }\n}\n",
      "asOf": "2026-11-17"
    },
    "F24": {
      "label": "Project function reference, @google-cloud/translate",
      "display": "translateMissing.js · updateTranslations()",
      "asOf": "2026-11-17"
    },
    "F25": {
      "label": "Project repository, @google-cloud/translate",
      "display": "reZach/secure-electron-template",
      "asOf": "2026-11-17"
    },
    "F26": {
      "label": "Project stars, reZach/secure-electron-template",
      "display": "1.7K",
      "asOf": "2026-11-17"
    },
    "F27": {
      "label": "Project push date, reZach/secure-electron-template",
      "display": "Jun 2026",
      "asOf": "2026-06-30"
    },
    "F28": {
      "label": "Library name, deepl-node",
      "display": "DeepL",
      "asOf": "2026-11-17"
    },
    "F29": {
      "label": "Monthly downloads, deepl-node",
      "display": "1.8M",
      "asOf": "2026-11-15"
    },
    "F30": {
      "label": "License, deepl-node",
      "display": "MIT",
      "asOf": "2026-11-17"
    },
    "F31": {
      "label": "Package release, deepl-node",
      "display": "1.29.0",
      "asOf": "2026-11-17"
    },
    "F32": {
      "label": "Undated package release, deepl-node",
      "display": "v1.29.0",
      "asOf": "2026-11-17"
    },
    "F33": {
      "label": "Repository stars, deepl-node",
      "display": "441",
      "asOf": "2026-11-17"
    },
    "F34": {
      "label": "Automatic source language, deepl-node",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F35": {
      "label": "Text batches, deepl-node",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F36": {
      "label": "Document translation, deepl-node",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F37": {
      "label": "Glossaries, deepl-node",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F38": {
      "label": "Output formats, deepl-node",
      "display": "PDF",
      "asOf": "2026-11-17"
    },
    "F39": {
      "label": "Install, deepl-node",
      "display": "npm install deepl-node",
      "asOf": "2026-11-17"
    },
    "F40": {
      "label": "What it does, deepl-node",
      "display": "Translates text and documents through the DeepL API.",
      "asOf": "2026-11-17"
    },
    "F41": {
      "label": "strengths lead, deepl-node",
      "display": "Translates lists of text",
      "asOf": "2026-11-17"
    },
    "F42": {
      "label": "strengths, deepl-node",
      "display": "Pass an array to translateText for multiple input strings.",
      "asOf": "2026-11-17"
    },
    "F43": {
      "label": "strengths lead, deepl-node",
      "display": "Translates files through one helper",
      "asOf": "2026-11-17"
    },
    "F44": {
      "label": "strengths, deepl-node",
      "display": "Use translateDocument with input and output paths or file handles.",
      "asOf": "2026-11-17"
    },
    "F45": {
      "label": "limitations lead, deepl-node",
      "display": "Glossaries cover selected language pairs",
      "asOf": "2026-11-17"
    },
    "F46": {
      "label": "limitations, deepl-node",
      "display": "Check getGlossaryLanguagePairs before choosing a terminology pair.",
      "asOf": "2026-11-17"
    },
    "F47": {
      "label": "limitations lead, deepl-node",
      "display": "Document waiting needs a timeout",
      "asOf": "2026-11-17"
    },
    "F48": {
      "label": "limitations, deepl-node",
      "display": "Set timeoutMs to bound document translation waiting.",
      "asOf": "2026-11-17"
    },
    "F49": {
      "label": "Quickstart, deepl-node",
      "display": "import * as deepl from 'deepl-node';\n\nconst authKey = \"f63c02c5-f056-...\"; // Replace with your key\nconst deeplClient = new deepl.DeepLClient(authKey);\n\n(async () => {\n    const result = await deeplClient.translateText('Hello, world!', null, 'fr');\n    console.log(result.text); // Bonjour, le monde !\n})();\n",
      "asOf": "2026-11-17"
    },
    "F50": {
      "label": "Library name, @vitalets/google-translate-api",
      "display": "@vitalets/google-translate-api",
      "asOf": "2026-11-17"
    },
    "F51": {
      "label": "Monthly downloads, @vitalets/google-translate-api",
      "display": "288.4K",
      "asOf": "2026-11-15"
    },
    "F52": {
      "label": "License, @vitalets/google-translate-api",
      "display": "MIT",
      "asOf": "2026-11-17"
    },
    "F53": {
      "label": "Package release, @vitalets/google-translate-api",
      "display": "9.2.1",
      "asOf": "2026-11-17"
    },
    "F54": {
      "label": "Undated package release, @vitalets/google-translate-api",
      "display": "v9.2.1",
      "asOf": "2026-11-17"
    },
    "F55": {
      "label": "Repository stars, @vitalets/google-translate-api",
      "display": "1.1K",
      "asOf": "2026-11-17"
    },
    "F56": {
      "label": "Automatic source language, @vitalets/google-translate-api",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F57": {
      "label": "Install, @vitalets/google-translate-api",
      "display": "npm install @vitalets/google-translate-api",
      "asOf": "2026-11-17"
    },
    "F58": {
      "label": "What it does, @vitalets/google-translate-api",
      "display": "Translates text through Google Translate’s public web interface.",
      "asOf": "2026-11-17"
    },
    "F59": {
      "label": "strengths lead, @vitalets/google-translate-api",
      "display": "Detects the source language",
      "asOf": "2026-11-17"
    },
    "F60": {
      "label": "strengths, @vitalets/google-translate-api",
      "display": "Use the default automatic source-language option.",
      "asOf": "2026-11-17"
    },
    "F61": {
      "label": "strengths lead, @vitalets/google-translate-api",
      "display": "Supports browser extension contexts",
      "asOf": "2026-11-17"
    },
    "F62": {
      "label": "strengths, @vitalets/google-translate-api",
      "display": "Translate in extension background or popup pages with the required host permission.",
      "asOf": "2026-11-17"
    },
    "F63": {
      "label": "limitations lead, @vitalets/google-translate-api",
      "display": "Regular web pages are blocked",
      "asOf": "2026-11-17"
    },
    "F64": {
      "label": "limitations, @vitalets/google-translate-api",
      "display": "Google Translate’s CORS policy blocks calls from ordinary web pages.",
      "asOf": "2026-11-17"
    },
    "F65": {
      "label": "limitations lead, @vitalets/google-translate-api",
      "display": "Requests can hit rate limits",
      "asOf": "2026-11-17"
    },
    "F66": {
      "label": "limitations, @vitalets/google-translate-api",
      "display": "Handle TooManyRequestsError when requests from one IP exceed the service limit.",
      "asOf": "2026-11-17"
    },
    "F67": {
      "label": "Quickstart, @vitalets/google-translate-api",
      "display": "import { translate } from '@vitalets/google-translate-api';\n\nconst { text } = await translate('Привет, мир! Как дела?', { to: 'en' });\n\nconsole.log(text) // => 'Hello World! How are you?'\n",
      "asOf": "2026-11-17"
    },
    "F68": {
      "label": "Project function, @vitalets/google-translate-api",
      "display": "export async function translateMarkdown(code: string, from: SupportedLocale, to: SupportedLocale) {\n  // to replace the code blocks intro a placeholder then feed it into translator\n  // then replace back for the results\n  const codeBlocks: string[] = []\n\n  const source = code\n    .replace(/```[\\s\\S\\n]+?```/g, (v) => {\n      const placeholder = `__${codeBlocks.length}__`\n      codeBlocks.push(v)\n      return placeholder\n    })\n    .replace(/`[\\s\\S\\n]+?`/g, (v) => {\n      const placeholder = `__${codeBlocks.length}__`\n      codeBlocks.push(v)\n      return placeholder\n    })\n\n  const { text } = await translate(source, {\n    from,\n    to,\n  })\n\n  if (!text)\n    return\n\n  const result = text.replace(/__\\s*?(\\d+?)\\s*?__/g, (_, i) => codeBlocks[+i])\n\n  return result\n}\n",
      "asOf": "2026-11-17"
    },
    "F69": {
      "label": "Project function reference, @vitalets/google-translate-api",
      "display": "translate.ts · translateMarkdown()",
      "asOf": "2026-11-17"
    },
    "F70": {
      "label": "Project repository, @vitalets/google-translate-api",
      "display": "type-challenges/type-challenges",
      "asOf": "2026-11-17"
    },
    "F71": {
      "label": "Project stars, type-challenges/type-challenges",
      "display": "48.6K",
      "asOf": "2026-11-17"
    },
    "F72": {
      "label": "Project push date, type-challenges/type-challenges",
      "display": "Oct 2026",
      "asOf": "2026-10-26"
    },
    "F73": {
      "label": "Library name, translate",
      "display": "translate",
      "asOf": "2026-11-17"
    },
    "F74": {
      "label": "Monthly downloads, translate",
      "display": "56.1K",
      "asOf": "2026-11-15"
    },
    "F75": {
      "label": "License, translate",
      "display": "MIT",
      "asOf": "2026-11-17"
    },
    "F76": {
      "label": "Package release, translate",
      "display": "3.1.1",
      "asOf": "2026-11-17"
    },
    "F77": {
      "label": "Undated package release, translate",
      "display": "v3.1.1",
      "asOf": "2026-11-17"
    },
    "F78": {
      "label": "Repository stars, translate",
      "display": "314",
      "asOf": "2026-11-17"
    },
    "F79": {
      "label": "Install, translate",
      "display": "npm install translate",
      "asOf": "2026-11-17"
    },
    "F80": {
      "label": "What it does, translate",
      "display": "Uses a shared text-translation interface across several remote translation engines.",
      "asOf": "2026-11-17"
    },
    "F81": {
      "label": "strengths lead, translate",
      "display": "Switches between translation engines",
      "asOf": "2026-11-17"
    },
    "F82": {
      "label": "strengths, translate",
      "display": "Choose Google, Yandex, Libre, or DeepL behind the same interface.",
      "asOf": "2026-11-17"
    },
    "F83": {
      "label": "strengths lead, translate",
      "display": "Supports a self-hosted translation endpoint",
      "asOf": "2026-11-17"
    },
    "F84": {
      "label": "strengths, translate",
      "display": "Set url for a self-hosted LibreTranslate engine.",
      "asOf": "2026-11-17"
    },
    "F85": {
      "label": "limitations lead, translate",
      "display": "Source language defaults to English",
      "asOf": "2026-11-17"
    },
    "F86": {
      "label": "limitations, translate",
      "display": "Set from when the input language differs.",
      "asOf": "2026-11-17"
    },
    "F87": {
      "label": "limitations lead, translate",
      "display": "Cached translations can outlive updates",
      "asOf": "2026-11-17"
    },
    "F88": {
      "label": "limitations, translate",
      "display": "Set cache duration when updated wording must replace cached results.",
      "asOf": "2026-11-17"
    },
    "F89": {
      "label": "Quickstart, translate",
      "display": "// Omit this line if loading from a CDN\nimport translate from \"translate\";\n\ntranslate.engine = \"deepl\"; // \"google\", \"yandex\", \"libre\", \"deepl\"\ntranslate.key = process.env.DEEPL_KEY;\n\nconst text = await translate(\"Hello world\", \"es\");\nconsole.log(text);\n// \"Hola mundo\"\n",
      "asOf": "2026-11-17"
    },
    "F90": {
      "label": "Project function, translate",
      "display": "async function autoTranslate() {\n\n  const sourceOfTruth = await glob('**/*.json', {\n    cwd: sourceRoot,\n  });\n\n  const targetLanguages = (await fs.readdir(langRoot)).filter((file) => file !== 'en')\n\n  console.log('Found source of truth files: ', sourceOfTruth);\n  console.log(`Found ${targetLanguages.length} target languages `);\n\n  sourceOfTruth.map(async (file) => {\n    // Load the file contents\n\n    const source = await fs.readFile(path.join(sourceRoot, file), 'utf8');\n    const sourceObj = JSON.parse(source);\n\n    // This flattens the potentially nested object into a single level\n    const keys = deepKeys(sourceObj);\n\n    // Attempt to translate target languages\n    await Promise.all(targetLanguages.map(async (lang) => {\n      let existing = {};\n      try {\n        const existingFile = await fs.readFile(path.join(langRoot, lang, file), 'utf8');\n        existing = JSON.parse(existingFile);\n      } catch (err) {\n        // Assume it doesn't exist\n        existing = {};\n      }\n\n      const initial = Promise.resolve(existing);\n\n      const completed = await keys.reduce(async (acc, key) => {\n\n        const newAcc = await acc;\n\n        if (hasProperty(newAcc, key)) {\n          // Already translated\n          return newAcc;\n        }\n\n        const value = getProperty(sourceObj, key);\n\n        // Check if the value contains double braces with interpolation placeholders\n        const hasInterpolation = /\\{\\{([^{}]+?)\\}\\}/.test(value);\n        if (hasInterpolation) {\n            // Extract the interpolation placeholders and preserve the braces\n            const placeholders = value.match(/\\{\\{([^{}]+?)\\}\\}/g);\n\n            // Replace the interpolation placeholders with a placeholder token\n            const placeholderToken = '__PLACEHOLDER__';\n            const replacedValue = value.replace(/\\{\\{([^{}]+?)\\}\\}/g, placeholderToken);\n\n            // Translate the replaced value\n            // @ts-ignore\n            const translated = await translate(replacedValue, { from: 'en', to: lang });\n\n            // Restore the interpolation placeholders using the placeholder token\n            const translatedValue = placeholders.reduce((acc, placeholder) => {\n              return acc.replace(placeholderToken, placeholder);\n            }, translated);\n\n            setProperty(newAcc, key, translatedValue);\n        } else {\n\n          try {  // @ts-ignore\n            const translated = await translate(value, { from: 'en', to: lang });\n            \n            setProperty(newAcc, key, translated);\n            \n          } catch (err) {\n            console.log(`Failed to translate ${key} in ${file} to ${lang}`);\n          }\n        }\n        return newAcc\n      }, initial);\n\n\n      await fs.writeFile(path.join(langRoot, lang, file), `${JSON.stringify(completed, null, 2)}\\n`);\n    }));\n  });\n\n}\n",
      "asOf": "2026-11-17"
    },
    "F91": {
      "label": "Project function reference, translate",
      "display": "translate.mjs · autoTranslate()",
      "asOf": "2026-11-17"
    },
    "F92": {
      "label": "Project repository, translate",
      "display": "tokens-studio/figma-plugin",
      "asOf": "2026-11-17"
    },
    "F93": {
      "label": "Project stars, tokens-studio/figma-plugin",
      "display": "1.6K",
      "asOf": "2026-11-17"
    },
    "F94": {
      "label": "Project push date, tokens-studio/figma-plugin",
      "display": "Nov 2026",
      "asOf": "2026-11-16"
    },
    "F95": {
      "label": "Developer need",
      "display": "Translating formatted documents",
      "asOf": "2026-11-17"
    },
    "F96": {
      "label": "Why choose @google-cloud/translate",
      "display": "Advanced document translation",
      "asOf": "2026-11-17"
    },
    "F97": {
      "label": "Developer need in introduction",
      "display": "translating formatted documents",
      "asOf": "2026-11-17"
    },
    "F98": {
      "label": "Developer need",
      "display": "Translating batches of strings",
      "asOf": "2026-11-17"
    },
    "F99": {
      "label": "Why choose deepl-node",
      "display": "array input to translateText",
      "asOf": "2026-11-17"
    },
    "F100": {
      "label": "Developer need in introduction",
      "display": "translating batches of strings",
      "asOf": "2026-11-17"
    },
    "F101": {
      "label": "Developer need",
      "display": "Translating in a browser extension",
      "asOf": "2026-11-17"
    },
    "F102": {
      "label": "Why choose @vitalets/google-translate-api",
      "display": "explicit extension-context support",
      "asOf": "2026-11-17"
    },
    "F103": {
      "label": "Developer need in introduction",
      "display": "translating in a browser extension",
      "asOf": "2026-11-17"
    },
    "F104": {
      "label": "Developer need",
      "display": "Using a self-hosted translation endpoint",
      "asOf": "2026-11-17"
    },
    "F105": {
      "label": "Why choose translate",
      "display": "a custom LibreTranslate endpoint",
      "asOf": "2026-11-17"
    },
    "F106": {
      "label": "Developer need in introduction",
      "display": "using a self-hosted translation endpoint",
      "asOf": "2026-11-17"
    },
    "F107": {
      "label": "When to consider deepl-node",
      "display": "direct access to DeepL text batches matters",
      "asOf": "2026-11-17"
    },
    "F108": {
      "label": "Page introduction",
      "display": "JavaScript translation libraries let application developers translate text between languages.",
      "asOf": "2026-11-17"
    },
    "F109": {
      "label": "FAQ: How is this different from JavaScript localization?",
      "display": "These clients translate text between languages rather than only looking up already translated interface messages.",
      "asOf": "2026-11-17"
    },
    "F110": {
      "label": "FAQ: Which clients accept lists of input strings?",
      "display": "Google’s Basic Translate client has an array-input overload.",
      "asOf": "2026-11-17"
    },
    "F111": {
      "label": "FAQ: Which clients accept lists of input strings?",
      "display": "DeepL translateText accepts either a string or an array of strings.",
      "asOf": "2026-11-17"
    },
    "F112": {
      "label": "FAQ: Can Google translate PDFs containing scanned and native text?",
      "display": "In a PDF mixing scanned and native content, the scanned content is not translated.",
      "asOf": "2026-11-17"
    },
    "F113": {
      "label": "FAQ: Does translating a document preserve every layout detail?",
      "display": "Google reports formatting loss for scanned PDFs and complex PDF layouts.",
      "asOf": "2026-11-17"
    },
    "F114": {
      "label": "FAQ: Can DeepL translate from an unknown source language?",
      "display": "Pass null as the source language to enable detection.",
      "asOf": "2026-11-17"
    },
    "F115": {
      "label": "FAQ: Are DeepL glossaries available for every language pair?",
      "display": "Glossaries support a subset of pairs; query getGlossaryLanguagePairs for those pairs.",
      "asOf": "2026-11-17"
    },
    "F116": {
      "label": "FAQ: Can DeepL document translation wait indefinitely?",
      "display": "The document helper waits without limit by default; timeoutMs bounds the wait.",
      "asOf": "2026-11-17"
    },
    "F117": {
      "label": "FAQ: Can @vitalets/google-translate-api run in a normal web page?",
      "display": "Its calls are blocked by Google Translate’s cross-origin policy in regular web pages.",
      "asOf": "2026-11-17"
    },
    "F118": {
      "label": "FAQ: Does the unofficial client have unlimited request capacity?",
      "display": "Google Translate applies request limits and the client can raise TooManyRequestsError.",
      "asOf": "2026-11-17"
    },
    "F119": {
      "label": "FAQ: Can translate use a self-hosted LibreTranslate server?",
      "display": "Its LibreTranslate engine accepts a custom url.",
      "asOf": "2026-11-17"
    },
    "F120": {
      "label": "FAQ: Does translate assume English input by default?",
      "display": "The documented from option defaults to English; set it for other source languages.",
      "asOf": "2026-11-17"
    },
    "F121": {
      "label": "FAQ: Will translate refresh cached wording automatically?",
      "display": "Without a configured cache duration, translations remain cached until the process, or browser restarts.",
      "asOf": "2026-11-17"
    },
    "F122": {
      "label": "Library name, @huggingface/transformers",
      "display": "@huggingface/transformers",
      "asOf": "2026-11-20"
    },
    "F123": {
      "label": "Monthly downloads, @huggingface/transformers",
      "display": "19.1M",
      "asOf": "2026-11-20"
    },
    "F124": {
      "label": "License, @huggingface/transformers",
      "display": "Apache-2.0",
      "asOf": "2026-11-20"
    },
    "F125": {
      "label": "Package release, @huggingface/transformers",
      "display": "4.3.2",
      "asOf": "2026-11-20"
    },
    "F126": {
      "label": "Package release date, @huggingface/transformers",
      "display": "Oct 2026",
      "asOf": "2026-11-20"
    },
    "F127": {
      "label": "Install, @huggingface/transformers",
      "display": "npm i @huggingface/transformers",
      "asOf": "2026-11-20"
    },
    "F128": {
      "label": "Quickstart, @huggingface/transformers",
      "display": "import { pipeline } from '@huggingface/transformers';\n\nconst translator = await pipeline('translation', 'Xenova/nllb-200-distilled-600M');\nconst output = await translator('जीवन एक चॉकलेट बॉक्स की तरह है।', {\nsrc_lang: 'hin_Deva', // Hindi\ntgt_lang: 'fra_Latn', // French\n});\n// [{ translation_text: 'La vie est comme une boîte à chocolat.' }]\n",
      "asOf": "2026-11-20"
    },
    "F129": {
      "label": "Official description, @huggingface/transformers",
      "display": "Runs Transformers machine learning models in the browser without a server.",
      "asOf": "2026-11-20"
    },
    "F130": {
      "label": "Quickstart source file, @huggingface/transformers",
      "display": "types/pipelines/translation.d.ts",
      "asOf": "2026-11-20"
    },
    "F131": {
      "label": "Repository stars, @huggingface/transformers",
      "display": "16.4K",
      "asOf": "2026-11-20"
    },
    "F132": {
      "label": "Local model inference, @huggingface/transformers",
      "display": "Yes",
      "asOf": "2026-11-20"
    },
    "F133": {
      "label": "Document translation, @huggingface/transformers",
      "display": "No",
      "asOf": "2026-11-20"
    },
    "F134": {
      "label": "Translation role and execution model, @huggingface/transformers",
      "display": "Broader local model SDK with a dedicated documented TranslationPipeline,not a generic prompt-only translation claim. Whole-package downloads cover many ML tasks.",
      "asOf": "2026-11-20"
    },
    "F135": {
      "label": "First-call prerequisites, @huggingface/transformers",
      "display": "[\"Run as an ES module or in a supported browser bundler. First call downloads the chosen model assets; offline inference requires already available model assets/runtime. Use the selected model language codes,not arbitrary ISO tags. Package license does not replace model-weight licensing.\"]",
      "asOf": "2026-11-20"
    },
    "F136": {
      "label": "Actual project argument and return contract, @huggingface/transformers",
      "display": "{\"status\": \"verified\", \"arguments\": \"Whole original react-translator worker callback receives text plus NLLB src_lang/tgt_lang FLORES codes,loads the real translation pipeline through same-file MyTranslationPipeline.getInstance,and constructs TextStreamer(translator.tokenizer,{skip_prompt:true,skip_special_tokens:true,callback_function}). Published4.3.2 TranslationPipeline example uses the same NLLB model and source/target options; streamer is a supported GenerationFunctionParameters option. Current public TextStreamer accepts the actual tokenizer and all three options. The helper factory uses dtype:q8 and progress_callback; it is not counted as an additional native invocation inside this callback.\", \"used_return_shapes\": \"Native translator returns an array of {translation_text:string}; callback posts that array unchanged as complete output. TextStreamer calls callback_function with decoded string fragments; partial UI messages are not complete translation objects. Native constructors and translator invocation are two separate SDK operations; Worker.postMessage is browser host API,not counted. Model download/storage and available language codes are prerequisites; no inference executed.\"}",
      "asOf": "2026-11-20"
    },
    "F137": {
      "label": "Document API scope, @huggingface/transformers",
      "display": "Native TranslationPipeline accepts text or text arrays and produces translation_text records. No format-preserving document upload/download endpoint in this pipeline; extracting document text is a separate task.",
      "asOf": "2026-11-20"
    },
    "F138": {
      "label": "Example model weight license, @huggingface/transformers",
      "display": "Selected NLLB model card declares cc-by-nc-4.0; this differs from the SDK Apache-2.0 license.",
      "asOf": "2026-11-20"
    },
    "F139": {
      "label": "Project function, @huggingface/transformers",
      "display": "async (event) => {\n  // Retrieve the translation pipeline. When called for the first time,\n  // this will load the pipeline and save it for future use.\n  const translator = await MyTranslationPipeline.getInstance((x) => {\n    // We also add a progress callback to the pipeline so that we can\n    // track model loading.\n    self.postMessage(x);\n  });\n\n  // Capture partial output as it streams from the pipeline\n  const streamer = new TextStreamer(translator.tokenizer, {\n    skip_prompt: true,\n    skip_special_tokens: true,\n    callback_function: function (text) {\n      self.postMessage({\n        status: \"update\",\n        output: text,\n      });\n    },\n  });\n\n  // Actually perform the translation\n  const output = await translator(event.data.text, {\n    tgt_lang: event.data.tgt_lang,\n    src_lang: event.data.src_lang,\n\n    // Allows for partial output\n    streamer,\n  });\n\n  // Send the output back to the main thread\n  self.postMessage({\n    status: \"complete\",\n    output,\n  });\n}\n",
      "asOf": "2026-11-20"
    },
    "F140": {
      "label": "Project source file, @huggingface/transformers",
      "display": "react-translator/src/worker.js",
      "asOf": "2026-11-20"
    },
    "F141": {
      "label": "Project full_name, @huggingface/transformers",
      "display": "huggingface/transformers.js-examples",
      "asOf": "2026-11-20"
    },
    "F142": {
      "label": "Project stargazers_count, @huggingface/transformers",
      "display": "2.1K",
      "asOf": "2026-11-20"
    },
    "F143": {
      "label": "Library name, @google-cloud/translate",
      "display": "@google-cloud/translate",
      "asOf": "2026-11-20"
    },
    "F144": {
      "label": "Monthly downloads, @google-cloud/translate",
      "display": "2.8M",
      "asOf": "2026-11-20"
    },
    "F145": {
      "label": "License, @google-cloud/translate",
      "display": "Apache-2.0",
      "asOf": "2026-11-20"
    },
    "F146": {
      "label": "Package release, @google-cloud/translate",
      "display": "10.3.0",
      "asOf": "2026-11-20"
    },
    "F147": {
      "label": "Package release date, @google-cloud/translate",
      "display": "Oct 2026",
      "asOf": "2026-11-20"
    },
    "F148": {
      "label": "Install, @google-cloud/translate",
      "display": "npm install @google-cloud/translate",
      "asOf": "2026-11-20"
    },
    "F149": {
      "label": "Quickstart, @google-cloud/translate",
      "display": "const {Translate} = require('@google-cloud/translate').v2;\nconst translate = new Translate({projectId: 'YOUR_PROJECT_ID'});\n\nasync function main() {\n  const [translation] = await translate.translate('Hello, world!', 'ru');\n  console.log(translation);\n}\nmain();\n",
      "asOf": "2026-11-20"
    },
    "F150": {
      "label": "Repository stars, @google-cloud/translate",
      "display": "3.2K",
      "asOf": "2026-11-20"
    },
    "F151": {
      "label": "Local model inference, @google-cloud/translate",
      "display": "No",
      "asOf": "2026-11-20"
    },
    "F152": {
      "label": "Document translation, @google-cloud/translate",
      "display": "Yes",
      "asOf": "2026-11-20"
    },
    "F153": {
      "label": "Translation role and execution model, @google-cloud/translate",
      "display": "Official hosted Cloud Translation SDK; package includes distinct Basic v2 and Advanced v3 clients.",
      "asOf": "2026-11-20"
    },
    "F154": {
      "label": "First-call prerequisites, @google-cloud/translate",
      "display": "[\"Run saved quickstart.js with an authorized project ID argument. Configure Application Default Credentials and enable Cloud Translation. This official first call uses current package v2 surface; document translation requires the distinct v3 client from the same distribution.\"]",
      "asOf": "2026-11-20"
    },
    "F155": {
      "label": "Actual project argument and return contract, @google-cloud/translate",
      "display": "{\"status\": \"verified\", \"arguments\": \"Whole secure-electron translation maintenance script imports the v2 client from the current package,not an obsolete removed namespace. Current10.3.0 retains getLanguages() and translate(string,{from,to}). Its discovered language directories and missing-key strings are passed directly; target codes must be valid accepted service codes. Host transforms hyphens to underscores for local directory comparison,and later passes that directory spelling to the service; no universal guarantee every regional directory spelling is accepted. Application Default Credentials,enabled service,and authorized project are external prerequisites.\", \"used_return_shapes\": \"getLanguages resolves [LanguageResult[],metadata],so the first destructured value can be mapped by code. translate resolves [string,metadata],and original code consumes element0. Whole function catches/logs outer errors and updates JSON files only on returned text. File-system and local directory helpers are not extra SDK calls. This is actual source-maintenance integration,not a standalone translation quickstart.\"}",
      "asOf": "2026-11-20"
    },
    "F156": {
      "label": "Document API scope, @google-cloud/translate",
      "display": "Current package v3 TranslationServiceClient provides document translation. The v2 client used in the example/quickstart does not itself gain the v3 method.",
      "asOf": "2026-11-20"
    },
    "F157": {
      "label": "Project function, @google-cloud/translate",
      "display": "async function updateTranslations() {\n\n  try {\n    const root = \"./app/localization/locales\";\n    const fromLanguage = \"en\";\n    \n    // Get valid languages from Google Translate API\n    let [googleLanguages] = await translate.getLanguages(); // ie. { code: \"en\", name: \"English\" }\n    googleLanguages = googleLanguages.map(gl => gl.code.replace(\"-\", \"_\"))\n\n    // Uncomment me to view the various languages Google can translate to/from\n    //console.log(googleLanguages);\n\n    // Get all language directories;\n    // https://stackoverflow.com/a/35759360/1837080\n    const getDirectories = p => readdirSync(p).filter(f => statSync(join(p, f)).isDirectory());\n    const languageDirectories = getDirectories(root).filter(d => googleLanguages.includes(d));    \n\n    // For each language, read in any missing translations\n    // and translate\n    for (const languageDirectory of languageDirectories) {\n\n      // Check to make sure each language has the proper files\n      try {\n        const languageRoot = `${root}/${languageDirectory}`;\n        const translationFile = `${languageRoot}/translation.json`;\n        const missingTranslationFile = `${languageRoot}/translation.missing.json`;\n\n        const translationExists = fs.existsSync(translationFile);\n        const translationMissingExists = fs.existsSync(missingTranslationFile);\n\n        if (translationExists && translationMissingExists) {\n\n          // Read in contents of files\n          const translations = JSON.parse(fs.readFileSync(translationFile, {\n            encoding: \"utf8\"\n          }));\n          const missing = JSON.parse(fs.readFileSync(missingTranslationFile, {\n            encoding: \"utf8\"\n          }));\n\n          // Only translate files with actual values\n          const missingKeys = Object.keys(missing);        \n          if (missingKeys.length > 0){\n\n            // Translate each of the missing keys to the target language\n            for (const missingKey of missingKeys){\n              const googleTranslation = await translate.translate(missingKey, {\n                from: fromLanguage,\n                to: languageDirectory\n              });\n\n              // Only set if a value is returned\n              if (googleTranslation.length > 0){\n                translations[missingKey] = googleTranslation[0];\n              }              \n            }\n  \n            // Write output back to file\n            fs.writeFileSync(translationFile, JSON.stringify(translations, null, 2));\n            fs.writeFileSync(missingTranslationFile, JSON.stringify({}, null, 2));\n  \n            console.log(`Successfully updated translations for ${languageDirectory}`);\n          } else {\n            console.log(`Skipped creating translations for ${languageDirectory}; none found!`);\n          }          \n        } else {\n\n          // Log if we failed\n          if (!translationExists) {\n            console.error(`Could not generate translations for language '${languageDirectory}' because ${translationFile} does not exist, skipping!`);\n          } else if (!translationMissingExists) {\n            console.error(`Could not generate translations for language '${languageDirectory}' because ${missingTranslationFile} does not exist, skipping!`);\n          }\n        }\n      } catch (error) {\n        console.error(\"Failed due to fatal error\");\n        console.error(error);\n      }\n    }\n  } catch (e) {\n    console.error(\"Failed due to fatal error\");\n    console.error(e);\n  }\n}\n",
      "asOf": "2026-11-20"
    },
    "F158": {
      "label": "Project source file, @google-cloud/translate",
      "display": "app/localization/translateMissing.js",
      "asOf": "2026-11-20"
    },
    "F159": {
      "label": "Project full_name, @google-cloud/translate",
      "display": "reZach/secure-electron-template",
      "asOf": "2026-11-20"
    },
    "F160": {
      "label": "Project stargazers_count, @google-cloud/translate",
      "display": "1.7K",
      "asOf": "2026-11-20"
    },
    "F161": {
      "label": "Library name, @aws-sdk/client-translate",
      "display": "@aws-sdk/client-translate",
      "asOf": "2026-11-20"
    },
    "F162": {
      "label": "Monthly downloads, @aws-sdk/client-translate",
      "display": "2.8M",
      "asOf": "2026-11-20"
    },
    "F163": {
      "label": "License, @aws-sdk/client-translate",
      "display": "Apache-2.0",
      "asOf": "2026-11-20"
    },
    "F164": {
      "label": "Package release, @aws-sdk/client-translate",
      "display": "3.1172.0",
      "asOf": "2026-11-20"
    },
    "F165": {
      "label": "Package release date, @aws-sdk/client-translate",
      "display": "Nov 2026",
      "asOf": "2026-11-20"
    },
    "F166": {
      "label": "Install, @aws-sdk/client-translate",
      "display": "npm install @aws-sdk/client-translate",
      "asOf": "2026-11-20"
    },
    "F167": {
      "label": "Quickstart, @aws-sdk/client-translate",
      "display": "import { TranslateClient, TranslateTextCommand } from \"@aws-sdk/client-translate\";\n\nconst client = new TranslateClient({ region: \"us-east-1\" });\nconst result = await client.send(new TranslateTextCommand({\n  Text: \"Hello, world!\",\n  SourceLanguageCode: \"en\",\n  TargetLanguageCode: \"es\",\n}));\nconsole.log(result.TranslatedText);\n",
      "asOf": "2026-11-20"
    },
    "F168": {
      "label": "Official description, @aws-sdk/client-translate",
      "display": "Provides the AWS Translate client for Node.js, browsers, and React Native.",
      "asOf": "2026-11-20"
    },
    "F169": {
      "label": "Quickstart source file, @aws-sdk/client-translate",
      "display": "dist-types/commands/TranslateTextCommand.d.ts",
      "asOf": "2026-11-20"
    },
    "F170": {
      "label": "Repository stars, @aws-sdk/client-translate",
      "display": "3.7K",
      "asOf": "2026-11-20"
    },
    "F171": {
      "label": "Local model inference, @aws-sdk/client-translate",
      "display": "No",
      "asOf": "2026-11-20"
    },
    "F172": {
      "label": "Document translation, @aws-sdk/client-translate",
      "display": "Yes",
      "asOf": "2026-11-20"
    },
    "F173": {
      "label": "Translation role and execution model, @aws-sdk/client-translate",
      "display": "Official Amazon Translate client/command package; credentials,region,and authorized service access required.",
      "asOf": "2026-11-20"
    },
    "F174": {
      "label": "First-call prerequisites, @aws-sdk/client-translate",
      "display": "[\"Use an ES module,configured AWS credentials/role,and authorized Amazon Translate region/service permissions. Minimal recipe omits unrelated optional custom terminology/settings from the API command gallery; client resolves standard credentials. No cloud request executed.\"]",
      "asOf": "2026-11-20"
    },
    "F175": {
      "label": "Actual project argument and return contract, @aws-sdk/client-translate",
      "display": "{\"status\": \"verified\", \"arguments\": \"Whole original Amplify Predictions translateText method validates configured region,authenticated credentials,and source/target language codes,then constructs current TranslateClient with region,credentials,and Amplify user-agent tuples. TranslateTextCommand uses exactly Text,SourceLanguageCode,and TargetLanguageCode fields from validated TranslateTextInput/config. Text must be a nonempty service-supported string within the request limit; optional access is not a promise that absent text can be translated. Amplify context/session helpers are retained and are not counted as AWS SDK operations.\", \"used_return_shapes\": \"Current command returns TranslateTextResponse with TranslatedText and TargetLanguageCode string fields. Whole method maps those into its Predictions TranslateTextOutput {text,language}; valid service success is required. Native client and command construction plus send are three SDK operations,not counts of auth,logger,or local validation calls. SDK and service were not executed.\"}",
      "asOf": "2026-11-20"
    },
    "F176": {
      "label": "Document API scope, @aws-sdk/client-translate",
      "display": "Current native command translates a supported document payload; asynchronous S3 batch text translation is a distinct operation with separate setup.",
      "asOf": "2026-11-20"
    },
    "F177": {
      "label": "Project function, @aws-sdk/client-translate",
      "display": "protected async translateText(\n\tinput: TranslateTextInput,\n): Promise<TranslateTextOutput> {\n\tlogger.debug('Starting translation');\n\n\tconst { translateText = {} } =\n\t\tthis._resolveCtx().resourcesConfig.Predictions?.convert ?? {};\n\tassertValidationError(\n\t\t!!translateText.region,\n\t\tPredictionsValidationErrorCode.NoRegion,\n\t);\n\tconst { defaults = {}, region } = translateText;\n\n\tconst { credentials } = await this._resolveCtx().fetchAuthSession();\n\tassertValidationError(\n\t\t!!credentials,\n\t\tPredictionsValidationErrorCode.NoCredentials,\n\t);\n\n\tconst { sourceLanguage, targetLanguage } = defaults;\n\tconst sourceLanguageCode =\n\t\tinput.translateText?.source?.language ?? sourceLanguage;\n\tconst targetLanguageCode =\n\t\tinput.translateText?.targetLanguage ?? targetLanguage;\n\tassertValidationError(\n\t\t!!sourceLanguageCode,\n\t\tPredictionsValidationErrorCode.NoSourceLanguage,\n\t);\n\tassertValidationError(\n\t\t!!targetLanguageCode,\n\t\tPredictionsValidationErrorCode.NoTargetLanguage,\n\t);\n\n\tthis.translateClient = new TranslateClient({\n\t\tregion,\n\t\tcredentials,\n\t\tcustomUserAgent: getAmplifyUserAgentObject({\n\t\t\tcategory: Category.Predictions,\n\t\t\taction: PredictionsAction.Convert,\n\t\t}),\n\t});\n\tconst translateTextCommand = new TranslateTextCommand({\n\t\tSourceLanguageCode: sourceLanguageCode,\n\t\tTargetLanguageCode: targetLanguageCode,\n\t\tText: input.translateText?.source?.text,\n\t});\n\tconst data = await this.translateClient.send(translateTextCommand);\n\n\treturn {\n\t\ttext: data.TranslatedText,\n\t\tlanguage: data.TargetLanguageCode,\n\t} as TranslateTextOutput;\n}\n",
      "asOf": "2026-11-20"
    },
    "F178": {
      "label": "Project source file, @aws-sdk/client-translate",
      "display": "packages/predictions/src/providers/AmazonAIConvertPredictionsProvider.ts",
      "asOf": "2026-11-20"
    },
    "F179": {
      "label": "Project full_name, @aws-sdk/client-translate",
      "display": "aws-amplify/amplify-js",
      "asOf": "2026-11-20"
    },
    "F180": {
      "label": "Project stargazers_count, @aws-sdk/client-translate",
      "display": "9.6K",
      "asOf": "2026-11-20"
    },
    "F181": {
      "label": "Library name, deepl-node",
      "display": "DeepL",
      "asOf": "2026-11-20"
    },
    "F182": {
      "label": "Monthly downloads, deepl-node",
      "display": "1.9M",
      "asOf": "2026-11-20"
    },
    "F183": {
      "label": "License, deepl-node",
      "display": "MIT",
      "asOf": "2026-11-20"
    },
    "F184": {
      "label": "Package release, deepl-node",
      "display": "1.29.0",
      "asOf": "2026-11-20"
    },
    "F185": {
      "label": "Package release date, deepl-node",
      "display": "Nov 2026",
      "asOf": "2026-11-20"
    },
    "F186": {
      "label": "Install, deepl-node",
      "display": "npm install deepl-node",
      "asOf": "2026-11-20"
    },
    "F187": {
      "label": "Quickstart, deepl-node",
      "display": "import * as deepl from \"deepl-node\";\n\nconst client = new deepl.DeepLClient(process.env.DEEPL_AUTH_KEY);\nconst result = await client.translateText(\"Hello, world!\", null, \"fr\");\nconsole.log(result.text);\n",
      "asOf": "2026-11-20"
    },
    "F188": {
      "label": "Repository stars, deepl-node",
      "display": "441",
      "asOf": "2026-11-20"
    },
    "F189": {
      "label": "Local model inference, deepl-node",
      "display": "No",
      "asOf": "2026-11-20"
    },
    "F190": {
      "label": "Document translation, deepl-node",
      "display": "Yes",
      "asOf": "2026-11-20"
    },
    "F191": {
      "label": "Translation role and execution model, deepl-node",
      "display": "Official DeepL API client with text and document translation methods; API authentication and account service limits apply.",
      "asOf": "2026-11-20"
    },
    "F192": {
      "label": "First-call prerequisites, deepl-node",
      "display": "[\"Set your DeepL Free/Pro API key in DEEPL_AUTH_KEY and run as an ES module. API account limits and billing apply. Null source requests automatic detection. No real key or service call used.\"]",
      "asOf": "2026-11-20"
    },
    "F193": {
      "label": "Document API scope, deepl-node",
      "display": "Native high-level translateDocument accepts supported input/output files and handles document translation lifecycle. Supported formats/account limits remain service constraints.",
      "asOf": "2026-11-20"
    },
    "F194": {
      "label": "Library name, @azure-rest/ai-translation-text",
      "display": "@azure-rest/ai-translation-text",
      "asOf": "2026-11-20"
    },
    "F195": {
      "label": "Monthly downloads, @azure-rest/ai-translation-text",
      "display": "407.8K",
      "asOf": "2026-11-20"
    },
    "F196": {
      "label": "License, @azure-rest/ai-translation-text",
      "display": "MIT",
      "asOf": "2026-11-20"
    },
    "F197": {
      "label": "Package release, @azure-rest/ai-translation-text",
      "display": "2.0.0",
      "asOf": "2026-11-20"
    },
    "F198": {
      "label": "Package release date, @azure-rest/ai-translation-text",
      "display": "May 2026",
      "asOf": "2026-11-20"
    },
    "F199": {
      "label": "Install, @azure-rest/ai-translation-text",
      "display": "npm install @azure-rest/ai-translation-text",
      "asOf": "2026-11-20"
    },
    "F200": {
      "label": "Quickstart, @azure-rest/ai-translation-text",
      "display": "import TextTranslationClient, {isUnexpected} from \"@azure-rest/ai-translation-text\";\nconst client = TextTranslationClient(\n  \"https://api.cognitive.microsofttranslator.com\",\n  {key: \"YOUR_SUBSCRIPTION_KEY\", region: \"westus\"},\n);\nconst response = await client.path(\"/translate\").post({\n  body: {inputs: [{\n    text: \"This is a test.\",\n    targets: [{language: \"cs\"}],\n    language: \"en\",\n  }]},\n});\nif (isUnexpected(response)) throw response.body.error;\nconsole.log(response.body.value[0]?.translations[0]?.text);\n",
      "asOf": "2026-11-20"
    },
    "F201": {
      "label": "Official description, @azure-rest/ai-translation-text",
      "display": "Provides an isomorphic client for the Azure Translator service.",
      "asOf": "2026-11-20"
    },
    "F202": {
      "label": "Quickstart source file, @azure-rest/ai-translation-text",
      "display": "sdk/translation/ai-translation-text-rest/README.md",
      "asOf": "2026-11-20"
    },
    "F203": {
      "label": "Repository stars, @azure-rest/ai-translation-text",
      "display": "2.3K",
      "asOf": "2026-11-20"
    },
    "F204": {
      "label": "Local model inference, @azure-rest/ai-translation-text",
      "display": "No",
      "asOf": "2026-11-20"
    },
    "F205": {
      "label": "Document translation, @azure-rest/ai-translation-text",
      "display": "No",
      "asOf": "2026-11-20"
    },
    "F206": {
      "label": "Translation role and execution model, @azure-rest/ai-translation-text",
      "display": "Official Azure Translator REST text client. Public customized factory accepts region-aware API key or identity credentials; document service is separate.",
      "asOf": "2026-11-20"
    },
    "F207": {
      "label": "First-call prerequisites, @azure-rest/ai-translation-text",
      "display": "[\"Use the exact2.0.0 public customized client export. Replace YOUR_SUBSCRIPTION_KEY and region with your Translator resource configuration. Run TypeScript with the appropriate build/toolchain; no SDK executed. This is a single source-text translation request with key authentication,distinct from the dictionary/AAD example.\"]",
      "asOf": "2026-11-20"
    },
    "F208": {
      "label": "Document API scope, @azure-rest/ai-translation-text",
      "display": "Exact current package routes are languages,translate,and transliterate text operations. Document Translation is a separate service/client; arbitrary document files are not accepted by this native text API.",
      "asOf": "2026-11-20"
    },
    "F209": {
      "label": "Public factory and generated internal factory, @azure-rest/ai-translation-text",
      "display": "Public package index exports customClient,which accepts TranslatorCredential and TranslatorTokenCredential. Internal textTranslationClient generated factory is not the root export. Exact2.0.0 tag package.json and immutable source distinguish them.",
      "asOf": "2026-11-20"
    },
    "F210": {
      "label": "Library name, google-translate-api-x",
      "display": "google-translate-api-x",
      "asOf": "2026-11-20"
    },
    "F211": {
      "label": "Monthly downloads, google-translate-api-x",
      "display": "322.1K",
      "asOf": "2026-11-20"
    },
    "F212": {
      "label": "License, google-translate-api-x",
      "display": "MIT",
      "asOf": "2026-11-20"
    },
    "F213": {
      "label": "Package release, google-translate-api-x",
      "display": "10.7.3",
      "asOf": "2026-11-20"
    },
    "F214": {
      "label": "Package release date, google-translate-api-x",
      "display": "May 2026",
      "asOf": "2026-11-20"
    },
    "F215": {
      "label": "Install, google-translate-api-x",
      "display": "npm install google-translate-api-x",
      "asOf": "2026-11-20"
    },
    "F216": {
      "label": "Quickstart, google-translate-api-x",
      "display": "import { translate } from 'google-translate-api-x';\n\nconst res = await translate('Ik spreek Engels', {to: 'en'});\nconsole.log(res.text);\n",
      "asOf": "2026-11-20"
    },
    "F217": {
      "label": "Official description, google-translate-api-x",
      "display": "Provides free access to Google Translate.",
      "asOf": "2026-11-20"
    },
    "F218": {
      "label": "Quickstart source file, google-translate-api-x",
      "display": "README.md",
      "asOf": "2026-11-20"
    },
    "F219": {
      "label": "Repository stars, google-translate-api-x",
      "display": "196",
      "asOf": "2026-11-20"
    },
    "F220": {
      "label": "Local model inference, google-translate-api-x",
      "display": "No",
      "asOf": "2026-11-20"
    },
    "F221": {
      "label": "Document translation, google-translate-api-x",
      "display": "No",
      "asOf": "2026-11-20"
    },
    "F222": {
      "label": "Translation role and execution model, google-translate-api-x",
      "display": "Unofficial Google web-endpoint wrapper supporting single and batch text requests; explicit fork of Vitalets lineage.",
      "asOf": "2026-11-20"
    },
    "F223": {
      "label": "First-call prerequisites, google-translate-api-x",
      "display": "[\"Use an ES module or bundler in a context allowed to contact Google public web endpoints. Ordinary web-page CORS restrictions differ from extension/native contexts. No official Cloud Translation credentials are needed by this unofficial endpoint; rate limits and endpoint changes remain possible.\"]",
      "asOf": "2026-11-20"
    },
    "F224": {
      "label": "Actual project argument and return contract, google-translate-api-x",
      "display": "{\"status\": \"verified\", \"arguments\": \"Whole artistassistapp translateText normalizes Lingui rich-text tag spacing through the actual same-file padLinguiTags helper,then calls current named translate(string,{from,to,forceBatch:true,autoCorrect:false}). Current10.7.3 exports translate and accepts all four options; locale nb maps to Google no through actual same-file table. Input length must satisfy the documented endpoint maximum and target must be a supported code. Helper restoration compares original/translated tag counts and throws if changed; helpers are preserved as source context,not counted as extra SDK calls.\", \"used_return_shapes\": \"Single-string current result has text:string; function returns restored text or undefined when empty. It does not itself parse arbitrary nested ICU plurals; the separate host functions handle limited plural forms. Whole16line translation task has one native call and uses the bounded task exception. Unofficial web endpoint failures/rate limits remain possible.\"}",
      "asOf": "2026-11-20"
    },
    "F225": {
      "label": "Document API scope, google-translate-api-x",
      "display": "Native batch strings/objects are text translations,not format-preserving document file upload/download. CLI/filesystem text extraction remains caller work.",
      "asOf": "2026-11-20"
    },
    "F226": {
      "label": "Web endpoint maximum and CORS, google-translate-api-x",
      "display": "README documents5000-character maximum per translation call and regular webpage CORS restrictions; extension/native request contexts differ.",
      "asOf": "2026-11-20"
    },
    "F227": {
      "label": "Project function, google-translate-api-x",
      "display": "async function translateText(\n  sourceText: string,\n  sourceLang: SourceLang,\n  targetLang: TargetLang\n): Promise<string | undefined> {\n  const result = await translate(padLinguiTags(sourceText), {\n    from: sourceLang,\n    to: GOOGLE_TRANSLATE_LANGS[targetLang] ?? targetLang,\n    forceBatch: true,\n    autoCorrect: false,\n  });\n  return result.text ? restoreLinguiTags(sourceText, result.text) : undefined;\n}\n",
      "asOf": "2026-11-20"
    },
    "F228": {
      "label": "Project source file, google-translate-api-x",
      "display": "translate-po.ts",
      "asOf": "2026-11-20"
    },
    "F229": {
      "label": "Project full_name, google-translate-api-x",
      "display": "eugene-khyst/artistassistapp",
      "asOf": "2026-11-20"
    },
    "F230": {
      "label": "Project stargazers_count, google-translate-api-x",
      "display": "122",
      "asOf": "2026-11-20"
    },
    "F231": {
      "label": "Library name, bing-translate-api",
      "display": "bing-translate-api",
      "asOf": "2026-11-20"
    },
    "F232": {
      "label": "Monthly downloads, bing-translate-api",
      "display": "188.3K",
      "asOf": "2026-11-20"
    },
    "F233": {
      "label": "License, bing-translate-api",
      "display": "MIT",
      "asOf": "2026-11-20"
    },
    "F234": {
      "label": "Package release, bing-translate-api",
      "display": "4.3.0",
      "asOf": "2026-11-20"
    },
    "F235": {
      "label": "Package release date, bing-translate-api",
      "display": "Sep 2026",
      "asOf": "2026-11-20"
    },
    "F236": {
      "label": "Install, bing-translate-api",
      "display": "npm install bing-translate-api",
      "asOf": "2026-11-20"
    },
    "F237": {
      "label": "Quickstart, bing-translate-api",
      "display": "const { translate } = require('bing-translate-api');\n\ntranslate('你好', null, 'en').then(res => {\n  console.log(res.translation);\n}).catch(err => {\n  console.error(err);\n});\n",
      "asOf": "2026-11-20"
    },
    "F238": {
      "label": "Official description, bing-translate-api",
      "display": "Provides free access to Bing and Microsoft Translator from Node.js.",
      "asOf": "2026-11-20"
    },
    "F239": {
      "label": "Quickstart source file, bing-translate-api",
      "display": "README.md",
      "asOf": "2026-11-20"
    },
    "F240": {
      "label": "Repository stars, bing-translate-api",
      "display": "228",
      "asOf": "2026-11-20"
    },
    "F241": {
      "label": "Local model inference, bing-translate-api",
      "display": "No",
      "asOf": "2026-11-20"
    },
    "F242": {
      "label": "Document translation, bing-translate-api",
      "display": "No",
      "asOf": "2026-11-20"
    },
    "F243": {
      "label": "Translation role and execution model, bing-translate-api",
      "display": "Unofficial Bing translation interface plus distinct MET interface in one package; do not equate a Bing wrapper with official Azure SDK support.",
      "asOf": "2026-11-20"
    },
    "F244": {
      "label": "First-call prerequisites, bing-translate-api",
      "display": "[\"This basic call uses the Bing interface and its source auto-detection,not the separate MET client or official Azure account. Requires network access to the public endpoint; documented input/rate limits apply.\"]",
      "asOf": "2026-11-20"
    },
    "F245": {
      "label": "Actual project argument and return contract, bing-translate-api",
      "display": "{\"status\": \"verified\", \"arguments\": \"Whole original SillyTavern /bing request callback uses named translate imported as bingTranslate from the current package. It passes text,null for auto-detected source,and target lang,which match the documented current4.3.0 signature. Express request/response objects are actual host dependencies; required inputs and existing error/status branches are retained. This uses the Bing interface,not MET or the separate Azure client. No current namespace or return type substituted from another translation SDK.\", \"used_return_shapes\": \"Current Bing result exposes translation:string; callback sends that field. The source callback handles thrown request errors using its original HTTP500 path. One lexical native call in a bounded whole route callback qualifies by the task-named translate source path. Express response.send/status and logger calls are host code,not additional SDK calls.\"}",
      "asOf": "2026-11-20"
    },
    "F246": {
      "label": "Document API scope, bing-translate-api",
      "display": "Documented native interface accepts text and returns translation fields; no format-preserving document upload/download operation. MET text translation does not imply Azure Document Translation SDK support.",
      "asOf": "2026-11-20"
    },
    "F247": {
      "label": "Bing request length and MET distinction, bing-translate-api",
      "display": "Bing README documents1000-character general maximum,China5000,and EPT3000,with fallback/rate-limit caveats. MET has its own input/options/response model.",
      "asOf": "2026-11-20"
    },
    "F248": {
      "label": "Project function, bing-translate-api",
      "display": "async (request, response) => {\n    try {\n        const text = request.body.text;\n        let lang = request.body.lang;\n\n        if (request.body.lang === 'zh-CN') {\n            lang = 'zh-Hans';\n        }\n\n        if (request.body.lang === 'zh-TW') {\n            lang = 'zh-Hant';\n        }\n\n        if (request.body.lang === 'pt-BR') {\n            lang = 'pt';\n        }\n\n        if (!text || !lang) {\n            return response.sendStatus(400);\n        }\n\n        console.debug('Input text: ' + text);\n\n        const result = await bingTranslate(text, null, lang);\n        const translatedText = result?.translation;\n        console.debug('Translated text: ' + translatedText);\n        return response.send(translatedText);\n    } catch (error) {\n        console.error('Translation error', error);\n        return response.sendStatus(500);\n    }\n}\n",
      "asOf": "2026-11-20"
    },
    "F249": {
      "label": "Project source file, bing-translate-api",
      "display": "src/endpoints/translate.js",
      "asOf": "2026-11-20"
    },
    "F250": {
      "label": "Project full_name, bing-translate-api",
      "display": "SillyTavern/SillyTavern",
      "asOf": "2026-11-20"
    },
    "F251": {
      "label": "Project stargazers_count, bing-translate-api",
      "display": "35.8K",
      "asOf": "2026-11-20"
    },
    "F252": {
      "label": "Library name, translate",
      "display": "Translate",
      "asOf": "2026-11-20"
    },
    "F253": {
      "label": "Monthly downloads, translate",
      "display": "58.7K",
      "asOf": "2026-11-20"
    },
    "F254": {
      "label": "License, translate",
      "display": "MIT",
      "asOf": "2026-11-20"
    },
    "F255": {
      "label": "Package release, translate",
      "display": "3.1.1",
      "asOf": "2026-11-20"
    },
    "F256": {
      "label": "Package release date, translate",
      "display": "Oct 2026",
      "asOf": "2026-11-20"
    },
    "F257": {
      "label": "Install, translate",
      "display": "npm install translate",
      "asOf": "2026-11-20"
    },
    "F258": {
      "label": "Quickstart, translate",
      "display": "import translate from \"translate\";\n\ntranslate.engine = \"deepl\";\ntranslate.key = process.env.DEEPL_KEY;\n\nconst text = await translate(\"Hello world\", \"es\");\nconsole.log(text);\n// \"Hola mundo\"\n",
      "asOf": "2026-11-20"
    },
    "F259": {
      "label": "Repository stars, translate",
      "display": "314",
      "asOf": "2026-11-20"
    },
    "F260": {
      "label": "Local model inference, translate",
      "display": "No",
      "asOf": "2026-11-20"
    },
    "F261": {
      "label": "Document translation, translate",
      "display": "No",
      "asOf": "2026-11-20"
    },
    "F262": {
      "label": "Translation role and execution model, translate",
      "display": "Common text interface over multiple remote translation engines; engine-specific keys and endpoint behavior remain relevant.",
      "asOf": "2026-11-20"
    },
    "F263": {
      "label": "First-call prerequisites, translate",
      "display": "[\"Run as an ES module and set DEEPL_KEY for the explicitly selected DeepL engine. Other documented engines have different credentials/endpoints; adapter does not bundle a translation model.\"]",
      "asOf": "2026-11-20"
    },
    "F264": {
      "label": "Actual project argument and return contract, translate",
      "display": "{\"status\": \"verified\", \"arguments\": \"Whole Tokens Studio autoTranslate imports current ESM default translate and passes string text with {from:\\\"en\\\",to:lang}. Current3.1.1 supports those source/target options and resolves translated string. Actual source replaces interpolation placeholders before one branch and restores them after,while another branch translates ordinary values. Correct engine/key configuration remains required for the selected backend; current package is a multi-engine adapter,not a translation model. Native calls occur in alternative branches across a multi-key,multi-language job,not always twice per item.\", \"used_return_shapes\": \"Each awaited native call yields string used in restored/ordinary message values. Local filesystem,deepKeys,Promise reductions,and interpolation handling are application code. The outer sourceOfTruth.map uses async callbacks without awaiting the map results; original function completion does not establish that all files have been written. No orchestration bug or captured source was silently repaired.\"}",
      "asOf": "2026-11-20"
    },
    "F265": {
      "label": "Document API scope, translate",
      "display": "Native adapter API translates text strings. It does not expose document-file translation just because its DeepL backend has a separate document service.",
      "asOf": "2026-11-20"
    },
    "F266": {
      "label": "Project function, translate",
      "display": "async function autoTranslate() {\n\n  const sourceOfTruth = await glob('**/*.json', {\n    cwd: sourceRoot,\n  });\n\n  const targetLanguages = (await fs.readdir(langRoot)).filter((file) => file !== 'en')\n\n  console.log('Found source of truth files: ', sourceOfTruth);\n  console.log(`Found ${targetLanguages.length} target languages `);\n\n  sourceOfTruth.map(async (file) => {\n    // Load the file contents\n\n    const source = await fs.readFile(path.join(sourceRoot, file), 'utf8');\n    const sourceObj = JSON.parse(source);\n\n    // This flattens the potentially nested object into a single level\n    const keys = deepKeys(sourceObj);\n\n    // Attempt to translate target languages\n    await Promise.all(targetLanguages.map(async (lang) => {\n      let existing = {};\n      try {\n        const existingFile = await fs.readFile(path.join(langRoot, lang, file), 'utf8');\n        existing = JSON.parse(existingFile);\n      } catch (err) {\n        // Assume it doesn't exist\n        existing = {};\n      }\n\n      const initial = Promise.resolve(existing);\n\n      const completed = await keys.reduce(async (acc, key) => {\n\n        const newAcc = await acc;\n\n        if (hasProperty(newAcc, key)) {\n          // Already translated\n          return newAcc;\n        }\n\n        const value = getProperty(sourceObj, key);\n\n        // Check if the value contains double braces with interpolation placeholders\n        const hasInterpolation = /\\{\\{([^{}]+?)\\}\\}/.test(value);\n        if (hasInterpolation) {\n            // Extract the interpolation placeholders and preserve the braces\n            const placeholders = value.match(/\\{\\{([^{}]+?)\\}\\}/g);\n\n            // Replace the interpolation placeholders with a placeholder token\n            const placeholderToken = '__PLACEHOLDER__';\n            const replacedValue = value.replace(/\\{\\{([^{}]+?)\\}\\}/g, placeholderToken);\n\n            // Translate the replaced value\n            // @ts-ignore\n            const translated = await translate(replacedValue, { from: 'en', to: lang });\n\n            // Restore the interpolation placeholders using the placeholder token\n            const translatedValue = placeholders.reduce((acc, placeholder) => {\n              return acc.replace(placeholderToken, placeholder);\n            }, translated);\n\n            setProperty(newAcc, key, translatedValue);\n        } else {\n\n          try {  // @ts-ignore\n            const translated = await translate(value, { from: 'en', to: lang });\n            \n            setProperty(newAcc, key, translated);\n            \n          } catch (err) {\n            console.log(`Failed to translate ${key} in ${file} to ${lang}`);\n          }\n        }\n        return newAcc\n      }, initial);\n\n\n      await fs.writeFile(path.join(langRoot, lang, file), `${JSON.stringify(completed, null, 2)}\\n`);\n    }));\n  });\n\n}\n",
      "asOf": "2026-11-20"
    },
    "F267": {
      "label": "Project source file, translate",
      "display": "packages/tokens-studio-for-figma/scripts/translate.mjs",
      "asOf": "2026-11-20"
    },
    "F268": {
      "label": "Project full_name, translate",
      "display": "tokens-studio/figma-plugin",
      "asOf": "2026-11-20"
    },
    "F269": {
      "label": "Project stargazers_count, translate",
      "display": "1.6K",
      "asOf": "2026-11-20"
    }
  },
  "dataCheckedAt": "2026-11-20",
  "agent": {
    "exaCall": {
      "endpoint": "/search",
      "body": {
        "query": "Best JavaScript translation libraries Google Cloud DeepL translate code examples",
        "numResults": 5
      },
      "docsUrl": "https://exa.ai/docs/reference/search"
    },
    "calls": []
  }
}
