(Redirected from Viewer Language (block))
Language | |
language::translate reporter | |
Category | Translate |
Type | Reporter |
Introduced in | 3.0 |
The Language block is a Translate Extension block and a reporter block in Scratch 3.0. This block returns the Scratch website language of the current user, unless the language is not available in the dropdown for the Translate () to () block, and will instead report "English". Additionally, all languages that are not the same as the ones in the Translate () to () block are changed to match the dropdown. In addition, 22 languages report as lower case (whereas all other languages report as upper case):
- български (Bulgarian)
- català (Catalan)
- čeština (Czech)
- eesti (Estonian)
- español (Spanish)
- euskara (Basque)
- galego (Galicia)
- hrvatski (Croatian)
- isiZulu (Zulu)[a]
- íslenska (Icelandic)
- latvieŝu (Latvian)
- lietuvių (Lithuanian)
- magyar (Hungarian)
- norsk (Norwegian)
- polski (Polish)
- русский (Russian)
- slovenčina (Slovak)
- slovenščina (Slovene)
- српски (Serbian)
- suomi (Finnish)
- svenska (Swedish)
- українська (Ukrainian)
Notes:
- ↑ Beginning is intentionally lower case to match how it's spelt in its original language
Example Uses
- Showing text in the project viewer's language:
say (translate [This text will appear in your language] to (language:: translate):: translate)
- To inform the user that the project doesn't support their language:
when green flag clicked if <not <(language ::translate) = [English]>> then say (translate [Please note that this project only supports English, which may not be your language.] to (language ::translate) ::translate) for (7) seconds end broadcast (start the project v)
- Confirming if the language set is actually their main language.
. . . ask (translate (join (join [So your language is ](language::translate))[?]) to (language::translate)) and wait if <(answer) = (translate [yes] to (language::translate)::translate)> then set [language v] to (language::translate) broadcast (continue v) else ask [Then what is your language?] and wait set [language v] to (answer) broadcast (continue v)
- Speaking in the user's language
when gf clicked set language to (language::translate) speak (translate [Hello!] to (language::translate))