Some sites, have a section of reviews / comments or any other content that can be added dynamically by users. This content can't always be translated manually because it is added by visitors and its not easy to track as a site owner. Therefore this type of content is more likely to be machine translated on demand.
Since machine translation is not 100% accurate for several reasons , especially for content that was generated by visitors and contains slang / typos - it is not a best practice to display it by default.
The optimal solution will be to add a small 'auto translate' button next to the text. This button will display the machine translation once clicked.
For this we have added 2 new attributes :
- bablic-generated-button , should be added to the button
- bablic-generated-text, should be added to the text generated by a user
This two attributes should be under the same element , otherwise no match will be found when clicking on the button.
An example :
<div>
<h2 bablic-generated-text>Hiii, this product is awesome!</h2>
<button bablic-generated-button>auto translate</button>
</div>
The way it works :
If the content was already requested before, Bablic will return the existing translation. If the content was not requested before, and it is the first time, the content will be added to the database first, machine translated, and will be returned to the page.
If your site has no machine words left the text content will only be recorded. In case you want to edit machine translations you can find the content under its page in the Pages Editor.
Find all user generated content :
Go to Text Editor -> View content all pages -> search [user-generated]
Please note that bablic-generated-button should be designed by you. If you want to do it via Bablic, go to Visual Editor -> Edit CSS , and add the style you want for this button.
In order to add a css selector for an attribute , please add the following:
[bablic-generated-button] {
// all css here
}
Please ensure you are choosing to Force Refresh if using this feature, otherwise switching locales may be problematic for the visitor experience.