Image Translation
Last updated
Was this helpful?
Last updated
Was this helpful?
Built upon the core features of the image translation API (see ‘Image Translation API Introduction’), this editor enables localized optimization and secondary editing of translated results to meet user’s demand for the creation of high-quality multilingual marketing materials.
· Recognizes and translates text in original images, with support for remodifying recognized text content and formats
· Allows users to add text and customize its style
· Supports flexible layout adjustments of text content, including size and position
· Offers a rich and editable library of design materials, such as marketing stickers, which users can add and edit
The pricing of each capability in the Workbench is consistent with the corresponding API product. Charges are based on prepaid resource packages per product, and you may purchase resource packages on demand according to the actual situation. Resource packs are valid for 1 year and are currently non-refundable.
· Editor products and API products are independent of each other, and their resource packages are not interchangeable. For example, if you need both the Image Translation API and the Image Translation Editor, please purchase both packages separately.
· In the editor, charges only occur when ‘Generate’ button is clicked. Before billing, a confirmation will be presented to the integrator (see the Editor Integration Guide for configuration details).
Integration instructions and code examples can be found in the Editor Integration Guide.
In particular, as stated in the ‘Embedding the Editor Static Page’ section of the Editor Integration Guide, the capability routing and input parameters required for the construction of the src field are as follows.
'https://editor.d.design/editor/index.html/#/translate'
Depending on the content that the integrator wishes to present when opening the editor page, different input parameters can be selected.
All parameters are optional. If none are filled in, the editor will display the initial state upon opening the page. Users can then upload images and other operations within the editor to complete the generation task.
imageUrl
String
No
Image URL.
Image requirements:
No larger than 3000x3000 pixels;
Size no more than 10MB;
Supports png, jpeg, jpg, bmp, webp formats.
sourceLanguage
String
No
Source language code.
See Appendix for the list of supported language pairs.
Optional, can be customized in the editor.
If the source language code is filled in, the ‘Source Language’ option in the editor will default to the filled in language.
If left blank, the option will remain empty by default.
Example value:en
targetLanguage
String
No
Target language code.
See Appendix for the list of supported language pairs.
Optional, can be customized in the editor.
If the source language code is filled in, the ‘Source Language’ option in the editor will default to the filled in language.
If left blank, the option will remain empty by default.
Example value:ko
imageEditorId
String
No
This parameter allows for secondary editing of the results returned by the Image Translation API.
After calling the Image Translation API, retrieve imageEditorId via the query interface.
Select either imageUrl or imageEditorId.
If both imageEditorId and imageUrl are provided, imageEditorId will take precedence.
const translateParam = { apiHost: 'ae', imageUrl: "https://img.alicdn.com/imgextra/i3/O1CN01F84hLR29Futc7Oshz_!!6000000008039-0-tps-750-1000.jpg", sourceLanguage: 'zh', targetLanguage: 'en', }; // Processed into a string that can be concatenated const payloadString = encodeURIComponent(JSON.stringify(translateParam));
// Tool page URL const sceneURL = 'https://editor.d.design/editor/index.html/#/translate';
// Concatenated into the final link
const iframeURL = ${sceneURL}?payload=${payloadString}
;
📢Note:Ensure that the field name of payloadString matches the corresponding field name in the server-provided page API.
Integrator can obtain result data in two ways: (1) Event listener; (2) Manual trigger. See the ‘Result Retrieval’ section in the Editor Integration Guide for detailed implementation.
Error messages are uniformly returned via API. Please kindly refer to the Editor Integration Guide for the returned data structure. Error codes are shown as follows.
Capability
Error Code (errCode)
Description
Image Translation
translate-createTranslateTask
Failed to create translation task
translate-getTranslateTask
Failed to retrieve translation task result
The integrator can customize error message based on the errCode to be sent to the user.
You may select the supported language pairs to use. More language pairs are continuously being added. If you have specific requests, please feel free to contact us.
Chinese (Simplified)
Arabic
Chinese (Simplified)
Chinese (Traditional)
Chinese (Simplified)
English
Chinese (Simplified)
French
Chinese (Simplified)
Japanese
Chinese (Simplified)
Korean
Chinese (Simplified)
Portuguese (Portugal)
Chinese (Simplified)
Russian
Chinese (Simplified)
Spanish
Chinese (Simplified)
Vietnamese
Chinese (Simplified)
Thai
Chinese (Simplified)
Indonesia
Chinese (Simplified)
Russian
Chinese (Simplified)
German
Chinese (Simplified)
Polish
Chinese (Simplified)
Dutch
Chinese (Simplified)
Italian
Chinese (Simplified)
Ukrainian
Chinese (Simplified)
Turkish
English
Arabic
English
Chinese (Traditional)
English
Chinese (Simplified)
English
Vietnamese
English
French
English
Japanese
English
Korean
English
Portuguese (Portugal)
English
Russian
English
Spanish
English
Thai
English
Indonesia
English
Russian
English
German
English
Polish
English
Dutch
English
Italian
English
Ukrainian
English
Turkish
Turkish
Arabic
Turkish
English
Arabic
ar
Chinese (Simplified)
zh
Chinese (Traditional)
zh-tw
English
en
French
fr
Japanese
ja
Korean
ko
Portuguese (Portugal)
pt
Russian
ru
Spanish
es
Turkish
tr
Hebrew
he
Vietnamese
vi
Thai
th
Indonesia
id
Russian
ru
German
de
Polish
pl
Dutch
nl
Italian
it
Ukrainian
uk
Example: