The content you're reading is getting on in years
This post is on the older side and its content may be out of date.
Be sure to visit our blogs homepage for our latest news, updates and information.
Recently one of our customers asked us for a solution to automatically translate news, blog posts and other content-based items in Sitefinity using Google Translate.
The main idea behind the solution depicted in this article is to automatically create and populate missing language versions using Google Translate once a content-based item is saved as a draft. The content editors can thereafter review and improve the newly generated translations.
Custom workflows provide the means to modify and extend the processes behind the lifecycle of content-based items (as well as pages, media items, etc.) with user-specific logic, which perfectly suits this task.
NOTE:
The following section offers step-by-step instructions on how to extend the workflow file; if you want to skip it you can use the CompleteGoogleTranslateWorkflow.xamlx file from the archive instead.
The Google Translate Flowchart in its complete state.
The only thing left to do is to register the custom workflow:
In the backend, go to Administration > Settings > Advanced > Workflows.
The Settings view lists workflow associations by model type.
Change the workflow ServiceUrl to point at the GoogleTranslateAnyContentApproval.xamlx workflow, for each model you want to apply automatic translation to.
The whole procedure described above could have been implemented entirely inside the GoogleTranslateActivity. However, having only the actual translation logic encapsulated as an activity allows it to be reused in completely different scenarios.
This is where the power of Sitefinity’s workflows comes into play, which allows you to model your own unique business processes using convenient enterprise-grade WF4 technology.
View all posts from The Progress Team on the Progress blog. Connect with us about all things application development and deployment, data integration and digital business.
Let our experts teach you how to use Sitefinity's best-in-class features to deliver compelling digital experiences.
Learn MoreSubscribe to get all the news, info and tutorials you need to build better business apps and sites