The "Translate" Extension
-
Introduction
You can use the “Translate” extension to translate some text to a target language.
Add the Translate Extension
You can click on the extension button at the bottom left, then select the Translate extension to add it:
https://cdncreaticodecom.b-cdn.net/scratch-gui-projects/forum/65278809-643e-4fb0-a066-ca4978a3473d.gif" width="1000" style="border-radius: 5px; border: 1px solid #29622d;">
There are 2 blocks in this extension:https://cdncreaticodecom.b-cdn.net/scratch-gui-projects/forum/b7246596-191a-4f22-a8ec-fbe1be8a539a.png" width="350" style="">
The “language” Block
The “language” block tells us the local language used by the current user. When you switch the playground’s interface to another language, this block will report the updated language as well.
https://cdncreaticodecom.b-cdn.net/scratch-gui-projects/forum/5687d1be-8c8b-43a0-81ad-242794153427.gif" width="1000" style="border-radius: 5px; border: 1px solid #29622d;">
The “translate to” Block
This block takes 2 inputs:
- Any text that you want to translate from
- The target language that you can select from the dropdown
Since this is a reporter block, it will report a value directly, which is the translated text.
https://cdncreaticodecom.b-cdn.net/scratch-gui-projects/forum/85dfdf51-0bce-4830-8766-4abd43f2dbc4.gif" width="600" style="border-radius: 5px; border: 1px solid #29622d;">
Translate to User’s Language
We can easily combine the 2 blocks above to achieve a useful feature: translating to the user’s language automatically.
For example, suppose your project will say “how are you?” to the user. You can put the “language” block into the language selector of the “translate” block, so that the sentence will be translated to the language used by the user.
https://cdncreaticodecom.b-cdn.net/scratch-gui-projects/forum/b50c0370-8c02-40c8-835f-451487c1e52c.gif" width="600" style="border-radius: 5px; border: 1px solid #29622d;">
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login