Navigation

    CreatiCode Scratch Forum

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • CreatiCode

    The "Translate" Extension

    2D Blocks
    1
    1
    206
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • info-creaticode
      CreatiCode last edited by admin

      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:

       
      There are 2 blocks in this extension:

       
       

      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.

       
       

      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.

       
       

      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.

      1 Reply Last reply Reply Quote 0
      • First post
        Last post