This article presents possible use cases and corresponding sample flows that your app can support. It provides a useful starting point as you plan your app's implementation.
If you're developing a delivery service app, the Wix user may want to translate content from the primary language (English) into a secondary language (French). They have two schemas, one for restaurant delivery and one for catering delivery. The content they want to translate includes delivery instructions, special notes for couriers, and customer communications. Follow the flow below to get started:
Prepare the content for translation
Use the createSchema()
method to create schemas for both restaurant and catering delivery. In each schema, define all the fields that will require translation.
Collect the original user-generated content
Prompt the Wix user to provide the original content in the site's primary language (English) for each schema. Call bulkCreateContent()
to save this collected content. This content will serve as the baseline for future translations.
Translate the content to French
The Wix user can translate the content manually or using their preferred translation service. Once translated, they can add the French content through the Translation Manager. The Translation Manager automatically calls the API to store the translations and mark them as ready to publish.
Update as needed
If there are updates to the primary or secondary locale content, repeat the process to keep all content up-to-date. Call queryContents()
to check for existing content, and either bulkUpdateContent()
or bulkCreateContent()
to add or update the translation content.
Let's say you're developing an app that provides original default FAQ content in English for Wix users. The Wix user may prefer to update this default content with their own original content.
Your app provides English FAQs as boilerplate content. Call createContent()
to store this default content.
Prompt the Wix user to replace the default content in the Translation Manager with their own custom content.
Listen for the onContentUpdated()
event to make sure the Wix user has entered their custom content.
Call updateContent()
to replace the default FAQ content in your app with the Wix user's content.