23
Machine Translation in AEM Vivek Sachdeva

Introduction to Machine translation - AEM

Embed Size (px)

Citation preview

Machine Translation in AEM Vivek Sachdeva

Agenda• What is Machine Translation?• Benefits• How it works?• Demo• Developer's View

Goal of Session

To have understanding of default translator in AEM.

What is Machine Translation

• It is one way of achieving internationalization in the project

• Automatically translate content from one language to other.

Benefits

• Reduction in go-live time

• MT is better than no translation

Following translation workflows are used:

• Add Language Copy

• Update Language Copy

How it works in AEM?

Language Copy Creation

Language Copy Update

Promoting a launch

Developer's View

etc/workflow/models/translation/config.properties

Properties to translate

1) Translate Language Copy Process

2.1) Create Language Copy Launch

2.2) Inject Master Language Into Launch Process

What all Processes are involved?

● It makes a POST call to

/etc/workflow/instances that resolves to

com.adobe.granite.workflow.console.servlet.InstancesServlet

● It requires language root page of target language to be present. For example, to translate some page in en to fr, fr root page should exist. Rest of the hierarchy is automatically created.

Language Copy Creation

● Model(/etc/workflow/models/wcm-translation/create_language_copy/jcr:content/model)

● TranslationWorkflowModel(/etc/workflow/models/wcm-translation/translate-language-copy/jcr:content/model)

● Target Language

● Payload

Language Copy Creation(Contd..)

● Send same properties except value of model which now points to /etc/workflow/models/wcm-translation/update_language_copy/jcr:content/model

● This triggers translation but does not update target page. Translated page is stored under launches folder so it can be reviewed before pushing it.

Language Copy Update

● It is the process of pushing translated content from launch to target language page

● This step follows content review

● Makes a call to /bin/wcmcommand

cmd : promoteLaunch

path : /contet/mypage

Promoting a launch

● Triggered using /services/translate

● com.adobe.cq.social.translation.impl.TranslatorServlet handles translation.

● It returns a JSON with translated content

Translating content of a node

http://localhost:4502/services/translate?userLang=en&respath=/content/geometrixx-media/jcr:content&properties=jcr%3Adescription&tolanguage=en&pagePath=/content/geometrixx-media/en/community&userId=admin

Translating content of a node(Contd..)

● userLang: en

● respath: /content/usergenerated/content/geometrixx-media/en/community/pad/jcr:content/forum/1_ciot/yfbs-i_think_it_willib/1_tosp/y7tv-lidea_di_questovide

● properties: jcr:description

● tolanguage: en

● pagePath: /content/geometrixx-media/en/community/pad.topic.html/content/usergenerated/content/geometrixx-media/en/community/pad/_jcr_content/forum/1_ciot/yfbs-i_think_it_willib

● userId: admin

Translating content of a node(Contd..)

{

translation: {

jcr:description: "The idea of this game is phenomenal: Finally you can interact with a robot and you can simulate real actions!"

},

status: "Success",

displayType: "replace",

display: "replace",

attribution: "Translations by Microsoft"

}

Sample Response

● http://docs.adobe.com/docs/en/aem/6-0/administer/integration/third-party-services/machine-translation.html

● http://docs.adobe.com/docs/en/aem/6-0/administer/social-communities/translate-ugc.html

References