(Block)
m (GET translate-service.scratch.mit.edu/translate: Wrong URL for example)
Line 265: Line 265:
 
{{API request
 
{{API request
 
|Translate something
 
|Translate something
|<nowiki>https://translate-service.scratch.mit.edu/supported?language=ja&text=Hello</nowiki>
+
|<nowiki>https://translate-service.scratch.mit.edu/translate?language=ja&text=Hello</nowiki>
 
|<nowiki>{
 
|<nowiki>{
 
   "result": "こんにちは"
 
   "result": "こんにちは"

Revision as of 12:38, 22 September 2018

Clock.png This article or section contains information about a feature from a future version of Scratch that is unreleased and is subject to change. Please cite any additional info in order to prevent speculation.
Document stub.png This article is a stub. It may be incomplete, unfinished, or have missing parts/sections. If the article can be expanded, please do so! There may be suggestions on its talk page. (April 2018)
When translating English into Japanese

The Translate Extension is an extension in Scratch 3.0 which provides a block to translate a string.

Block

This extension has two blocks:

  • 3.0 Translate () to ().png
  • Viewer-lang-block.png

Translate API

Scratch has an API for translation. The Translate Extension depends on it, so it always requires the Internet when it's used.

GET translate-service.scratch.mit.edu/supported

Get supported language


Example Request
GET https://translate-service.scratch.mit.edu/supported?language=en
Example Response


GET translate-service.scratch.mit.edu/translate

Translate something


Example Request
GET https://translate-service.scratch.mit.edu/translate?language=ja&text=Hello
Example Response