Introduction

Developer Preview
APIs in Developer Preview are subject to change and are not intended for use in production.
Send us your suggestions for improving this API. Your feedback is valuable to us.

 

The Machine Translation API allows you to render text from one language to another using machine translation. With this API you can provide translatable content from your code and Wix returns the translated text.

With the Machine Translation API, you can:

To use the Machine Translation API, import machineTranslation from the wix-multilingual.v2 module:

Copy

Before you begin

It's important to note the following before starting to code:

  • Only text translation is supported.
  • Wix does not overwrite the original content source, so make sure to store the returned translatedContent object separately if you want to retrieve it at a later time.
  • Translation requests must not exceed 5,000 characters or the request fails with a TEXT_TOO_LONG error.
  • If the site does not have sufficient word credits to translate all of the text in the request, the request fails with a NOT_ENOUGH_CREDITS error.
  • Note that translated blogs and emails reduce a site's word credits, but are not included in the count displayed in a site's dashboard.

Terminology

  • Machine translate: Wix uses an external service to translate text to other languages. Alternatively, you can manually translate site content with the Translation Manager.
  • Translatable content: Content that is able to be machine translated with this service. Learn more about translatable and untranslatable content.
  • Word credit: Each site has a word credit balance, starting at 3,000 words. Each successful translation request reduces the word credits by the number of words in contentToTranslate. If the site does not have sufficient word credits to translate all of the text in the request, the request fails with a NOT_ENOUGH_CREDITS error. Additional credits can be purchased through the Dashboard.
Did this help?