> Portal Navigation:
> 
> - Append `.md` to any URL under `https://dev.wix.com/docs/` to get its markdown version.
> - Pages are either content pages (article or reference text) or menu pages (a list of links to child pages).
> - To get a menu page, truncate any URL to a parent path and append `.md` (e.g. `https://dev.wix.com/docs/sdk.md`, `https://dev.wix.com/docs/sdk/core-modules.md`).
> - Top-level index of all portals: https://dev.wix.com/docs/llms.txt
> - Full concatenated docs: https://dev.wix.com/docs/llms-full.txt

## Resource: Introduction

## Article: Async Site Translator API

## Article Link: https://dev.wix.com/docs/api-reference/business-management/multilingual/machine-translation/async-site-translator/introduction.md

## Article Content:

# About the Async Site Translator API

The Async Site Translator API translates a site's content in bulk, in the background. Instead of
translating one unit of content at a time, you start a job that works through the site's translatable
content and reports its progress, so a site with a large amount of content isn't bound by request
timeouts. This API is based on [Wix Multilingual](https://support.wix.com/en/article/about-wix-multilingual).

With the Async Site Translator API, you can:

- Start a background job that translates a site's content from one locale to another.
- Choose which content the job covers, by translation status or by schema and item.
- Track a job's progress and retrieve the fields it couldn't translate.

Translations are written to the site's translation content, so you can read them back with the
[Translation Content API](https://dev.wix.com/docs/api-reference/business-management/multilingual/translation/translation-content.md).

## The translation job lifecycle

Translate Site returns as soon as the job is accepted, with a `jobId` and nothing else. Everything
after that happens in the background, and you follow it by polling Get Translation Job Status:

| State | Meaning |
| --- | --- |
| `PENDING` | The job is accepted and waiting to start. |
| `RUNNING` | The job is translating content. |
| `COMPLETED` | The job finished. Check `failedFields`, because a completed job can still have individual field failures. |
| `FAILED` | The job stopped before finishing. Content translated before it stopped is kept. |

There's no published limit on how long a job takes, so poll until the job reaches `COMPLETED` or
`FAILED`. A job stays queryable indefinitely, so you can check its outcome long after it finishes.

Note that `totalFieldsCount` reports how many fields the job has processed so far, successes and
failures combined. It isn't the job's full scope, so it doesn't work as a progress denominator while
the job runs.

## What the site owner sees

A job writes into the site's existing translation content, so its results appear in the
[Translation Manager](https://support.wix.com/en/article/wix-multilingual-using-the-translation-manager)
as the job progresses. There's no separate import step.

Each translated field is marked as ready to publish, and as machine translated. The site owner
reviews the translations in the Translation Manager, and publishes the site to make them visible to
visitors.

## Word credits

Site translation consumes the site's word credit balance, where 1 credit equals 1 word. Credits are
checked once, when the job starts. If the site doesn't have enough credits for the content in scope,
Translate Site fails with a `NOT_ENOUGH_CREDITS` error whose `requiredWords` field reports how many
words need credit.

Wix users can get more credits by purchasing a
[translation package](https://support.wix.com/en/article/wix-multilingual-auto-translating-your-site#purchasing-translation-packages).
To check a site's balance before starting a job, use the
[Credit Data API](https://dev.wix.com/docs/api-reference/business-management/multilingual/machine-translation/credit-data.md).

Currently, sites built in the Harmony editor are translated with AI translation, which doesn't draw
on the word credit balance. Jobs on those sites aren't limited by credits.

## Before you begin

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

- You can only use this API on sites where the Wix user has installed the [Wix Multilingual app](https://www.wix.com/app-market/wix-multilingual?searchLocation=home).
- Content can only be translated if it has an existing [translation schema](https://dev.wix.com/docs/api-reference/business-management/multilingual/translation/translation-schema.md). Hidden and display-only fields are skipped.
- A job reads the site's content as it goes, rather than working from a snapshot taken when it started. Content edited while a job is running may or may not be included, depending on whether the job has already reached it.
- Several jobs can run against the same site at once, and they don't coordinate. Two jobs started close together can select the same field and translate it twice, spending word credits twice for the same result.
- The translation engine is selected automatically based on the site's editor. You can't choose it in the request, and the job doesn't report which engine ran.

## Use cases

- [Translate a site's untranslated content](https://dev.wix.com/docs/api-reference/business-management/multilingual/machine-translation/async-site-translator/sample-flows.md#translate-a-sites-untranslated-content)
- [Refresh translations after content changes](https://dev.wix.com/docs/api-reference/business-management/multilingual/machine-translation/async-site-translator/sample-flows.md#refresh-translations-after-content-changes)
- [Translate one section of a site](https://dev.wix.com/docs/api-reference/business-management/multilingual/machine-translation/async-site-translator/sample-flows.md#translate-one-section-of-a-site)

## Terminology

- **Translation job**: A background task that translates a site's content from one locale into another. Identified by a `jobId`.
- **Word credit**: A unit of translation capacity, where 1 credit equals 1 word to translate. Each site has a word credit balance indicating the number of words available for translation.
- **Translation schema**: The definition of which of an entity's fields are translatable, and their types and validations. Managed with the [Translation Schema API](https://dev.wix.com/docs/api-reference/business-management/multilingual/translation/translation-schema.md).
- **Translation content**: The original and translated content stored against a schema. Managed with the [Translation Content API](https://dev.wix.com/docs/api-reference/business-management/multilingual/translation/translation-content.md).
- **Field status**: Whether a field is untranslated, translated, or outdated, meaning its source content changed after it was translated. `filterByStatus` selects which of these a job picks up.

## See also

- [Sample Flows](https://dev.wix.com/docs/api-reference/business-management/multilingual/machine-translation/async-site-translator/sample-flows.md)
- [Translation Content API](https://dev.wix.com/docs/api-reference/business-management/multilingual/translation/translation-content.md)
- [Translation Schema API](https://dev.wix.com/docs/api-reference/business-management/multilingual/translation/translation-schema.md)
- [Machine Translation API](https://dev.wix.com/docs/api-reference/business-management/multilingual/machine-translation/machine-translation.md)
- [Credit Data API](https://dev.wix.com/docs/api-reference/business-management/multilingual/machine-translation/credit-data.md)
- AI Translation API. Reference not yet published.

@sdk_package_setup