扩展——“翻译”
-
介绍
可以用“翻译”扩展把文本翻译成目标语言。
添加翻译扩展
点击左下角的扩展按钮,然后选择“翻译”扩展即可添加:
https://cdncreaticodecom.b-cdn.net/scratch-gui-projects/forum/f5f2515a-9556-4caf-9c68-a64d0d7b09f6.gif" width="1000" style="border-radius: 5px; border: 1px solid #29622d;">
这个扩展有2个积木:
https://cdncreaticodecom.b-cdn.net/scratch-gui-projects/forum/9d575482-cb7f-497e-963b-b2dc74fb030d.png" width="350" style="">
积木:“访客语言”
积木“访客语言”告诉我们当前用户使用的本地语言。如果你把游乐场的界面换成另一种语言,这个积木所报告的语言也会随之更改。
https://cdncreaticodecom.b-cdn.net/scratch-gui-projects/forum/0392fd23-8136-4030-883d-9075ce2dfffc.gif" width="1000" style="border-radius: 5px; border: 1px solid #29622d;">
积木:“将( )译为( )”
这个积木有2个输入框:
- 你要翻译的文本;
- 目标语言,可以从下拉列表中选择。
因为这是个报表积木,所以会直接报告一个值,这个值就是翻译后的文本。
https://cdncreaticodecom.b-cdn.net/scratch-gui-projects/forum/db9fa052-6ade-44ff-a69d-12a156a273df.gif" width="600" style="border-radius: 5px; border: 1px solid #29622d;">
翻译成用户的语言
我们可以把以上2个积木组合,即可实现一个有用的功能:自动翻译成用户的语言。
比如你的项目要向用户说“欢迎!”。就可以把积木“访客语言”放到积木“将( )译为( )”的语言选择器,从而句子就翻译成用户所使用的语言。
https://cdncreaticodecom.b-cdn.net/scratch-gui-projects/forum/bb156d9e-4038-415e-94ac-36880f2b63ca.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