Wix Multilingual Translation APIs allow you to add multilingual support to your app, enabling Wix users to translate and manage their content across different locales. This ensures site visitors can access content in their preferred language. Learn more about the Wix Multilingual feature.
Wix Multilingual Translation APIs include three services: Translation Schema, Translation Content, and Translation Published Content.
These services are intended to be used in a specific sequence as part of a defined flow:
A translation schema is a blueprint that defines how your app’s data is structured and which fields are translatable. It specifies fields like "Title" or "Description" and any associated rules, such as character limits or formats.
Use the Translation Schema API to organize your app’s content for translation and manage which fields can be translated. You can create schemas for each of your app's entities. For example, a food delivery app might have one schema for a menu and another for orders.
This step only needs to be done once, providing a foundation for all future translations.
After defining the schema and the translatable fields, you need to add original content for those fields. This original content, provided in the site's primary language, serves as the foundation for all translations. Depending on your app, this content can either be user-generated or default content provided by your app:
createContent()
method to save this collected content, ensuring it aligns with the schema you defined in the previous step.createContent()
method with this default content initially. If at a later time users provide their own content, call the Update Content method to replace the default content with user-generated content.Once the original content is added, it can be translated and stored in the following ways:
Before rendering site content, call the Translation Published Content API to retrieve the translated content flagged for publishing and display it in the site visitor’s language. This ensures site visitors see the appropriate translation content for their locale.