Ok so basically @MakeCode @richard I had an idea to make an extension that automatically detects a user’s language for in-game text localization, which I think would be very cool.
I’m trying to use the helper._getLocalizedInstructions() function to do this, which is for translating that text that shows up to tell you to use your computer keyboard when you use the prompt functionality. Unfortunately I can’t get it to work, neither by changing the default language of my browser or by changing the language in MakeCode settings. Is this functionality actually implemented or is this a fruitless search?
9 Likes
Richard answered on stream and basically said he’ll look into why it’s not working. Thanks Richard!
10 Likes
what is helpers._getLocalizedInstructions (what is pxsim.Keyboard.getLocalizedInstructions)?
1 Like
How in the world does this work??? Also you should implement @Sarge’s localization extension.
2 Likes
It’s a helper function that should automatically translate the “Type your response using your keyboard and hit ENTER” text used when you’re typing a prompt into MakeCode, however it seems not to translate the actual text regardless of what we try to change. This keyboard section of MakeCode’s source code is actually the part of MakeCode that I manipulated to get my critter jam game to work, so I am partially involved
.
@WoofWoof I don’t know if you tried this, but I took a stab at changing your KEYBOARD language and general device language given I know decent Spanish. It didn’t work
but I am assuming it will be keyboard central. I’m also wondering how the function would be used given it’s still just a black box, it’s not like it will return the language it’s translating to…
1 Like
Yeah I was thinking of just detecting the user’s language by just comparing the text output to a big list of all the languages’ text outputs, but on stream Richard said he might make an api for it which would theoretically just return the actual language the viewer was using which would be convenient.
5 Likes