Discuss Scratch
- LemonComputer
-
100+ posts
Country detectors
I think it would be awesome to have a ‘Country’ block. It would help a lot on many of my projects. It would be like this
I need a script that goes like
If there is a way to do this sort of thing already, I apologise. I just couldn't find a way to do it and had no matching answers on Google for a tutorial on how to do this. I also apologise if there's already a suggestion on this. I actually need the script for my project to be of any use.
(Country)
I need a script that goes like
when backdrop switches to [backdrop5 v]Basically like that but for most countries that are able to access Scratch.
if <(Country) = [UK]> then
switch costume to [English tutorial1 v]
else
if <(Country) = [France]> then
switch costume to [French tutorial1 v]
end
If there is a way to do this sort of thing already, I apologise. I just couldn't find a way to do it and had no matching answers on Google for a tutorial on how to do this. I also apologise if there's already a suggestion on this. I actually need the script for my project to be of any use.
- KingOfAwesome58219
-
1000+ posts
Country detectors
However broad it may be, Scratch shouldn't have to ask for your GPS location. I've seen many parents getting super angry in the forums because a project asked for microphone access and they think that Scratch is now going to record them and give them a virus (somehow).
Cool idea, not sure it's worth the confusion.
You can always have buttons at the start of the project that the user can pick to choose their language.
Cool idea, not sure it's worth the confusion.
You can always have buttons at the start of the project that the user can pick to choose their language.
- jokebookservice1
-
1000+ posts
Country detectors
Maybe not country, but selected language. Some countries can have more than one official language 
I actually think this is a great suggestion and would like to see it in Scratch 3.0 in the Sensing category.

I actually think this is a great suggestion and would like to see it in Scratch 3.0 in the Sensing category.
- powercon5
-
1000+ posts
Country detectors
So
(Language::sensing)I can see how that could work and would go along with
(username)
- Bright-Idea
-
1000+ posts
Country detectors
I support for a
I actually wanted to use this recently for a “Facts about Your Country” and I wanted it to auto-detect the country, but I realized it didn't exist, so… yeah.
(country :: sensing)block. (It would be better in sensing rather than variables.
I actually wanted to use this recently for a “Facts about Your Country” and I wanted it to auto-detect the country, but I realized it didn't exist, so… yeah.
- dude341
-
1000+ posts
Country detectors
No support because this could happen:
set [Nothing here... v] to (country)EDIT: I will support if it uses the location from your profile, not your actual location. I forgot that the profile location existed, so everyone knows I'm from the UK. But I wouldn't support if it used your actual country you were in.
broadcast [encode variable to numbers v]
set [☁ Defiantly nothing here v] to (encoded variable)
Last edited by dude341 (Oct. 27, 2016 17:50:05)
- Candylanguagegirl
-
1000+ posts
Country detectors
What if we just had it detect the country the person said they were from when they signed up? After all, that's pretty easy to lie on or switch to “location not given” so you aren't giving away personal information if you aren't ok with that. It's public on your profile anyway, I don't see how having that available in a game would be too much.
- SC_DStwo_Master
-
100+ posts
Country detectors
^^this Maybe not country, but selected language. Some countries can have more than one official language
I actually think this is a great suggestion and would like to see it in Scratch 3.0 in the Sensing category.
- 19f8361
-
500+ posts
Country detectors
support, but how about 2 blocks:
(language ::sensing) //reports English if you using English, or reports French if you using Français.
(country uses [acutal location v]::sensing) //works if you accept location, reports using your acutal location.
(country uses [scratcher location v]::sensing) //reports your location using some data to report scratcher's location.
Last edited by 19f8361 (Oct. 27, 2016 18:44:05)
- ateesdalejr
-
100+ posts
Country detectors
FTFY support, but how about 2 blocks:(language ::sensing) //Should most likely report the language code like EN etc.
(country ::sensing) //works if you accept location, reports using your set location..
- Austinato
-
1000+ posts
Country detectors
As for this one, would this use IP addresses? support, but how about 2 blocks:(country uses [acutal location v]::sensing) //works if you accept location, reports using your acutal location.
- 19f8361
-
500+ posts
Country detectors
As for this one, would this use IP addresses? support, but how about 2 blocks:(country uses [acutal location v]::sensing) //works if you accept location, reports using your acutal location.
how about this:
(country uses [IP address v]::sensing) //uses IP address to determine the location. sometimes, it reports incorrect locations.
Last edited by 19f8361 (Oct. 27, 2016 21:02:51)
- LemonComputer
-
100+ posts
Country detectors
No support because this could happen:set [Nothing here... v] to (country)EDIT: I will support if it uses the location from your profile, not your actual location. I forgot that the profile location existed, so everyone knows I'm from the UK. But I wouldn't support if it used your actual country you were in.
broadcast [encode variable to numbers v]
set [☁ Defiantly nothing here v] to (encoded variable)
I don't know that Scratch would even be able to access your actual location, so yeah I did mean your profile's location. Thanks.
- dude341
-
1000+ posts
Country detectors
Oh, OK. Support then, this would be useful for detecting people's language.No support because this could happen:set [Nothing here... v] to (country)EDIT: I will support if it uses the location from your profile, not your actual location. I forgot that the profile location existed, so everyone knows I'm from the UK. But I wouldn't support if it used your actual country you were in.
broadcast [encode variable to numbers v]
set [☁ Defiantly nothing here v] to (encoded variable)
I don't know that Scratch would even be able to access your actual location, so yeah I did mean your profile's location. Thanks.
- KingOfAwesome58219
-
1000+ posts
Country detectors
So:
What would the (country) block return if the scratch had no country selected? Just a “No Given Location,” or maybe undefined?
As with the username block, it should have a “This project can detect which country you have selected on your profile,” and “This project can detect which language you have selected,” What would happen if you had multiple of these messages?
(language :: sensing) // gives the language that the scratcher is using scratch inI really like this idea. Support!
(country :: sensing) // gives the country the scratch has selected on their profile
What would the (country) block return if the scratch had no country selected? Just a “No Given Location,” or maybe undefined?
As with the username block, it should have a “This project can detect which country you have selected on your profile,” and “This project can detect which language you have selected,” What would happen if you had multiple of these messages?
Last edited by KingOfAwesome58219 (Oct. 28, 2016 14:29:23)
- jokebookservice1
-
1000+ posts
Country detectors
They could be presented as a list: “This project can access your username and location. To hide your identity…” So:(language :: sensing) // gives the language that the scratcher is using scratch inI really like this idea. Support!
(country :: sensing) // gives the country the scratch has selected on their profile
What would the (country) block return if the scratch had no country selected? Just a “No Given Location,” or maybe undefined?
As with the username block, it should have a “This project can detect which country you have selected on your profile,” and “This project can detect which language you have selected,” What would happen if you had multiple of these messages?
- WolfCat67
-
1000+ posts
Country detectors
They should make a “location not given” change to be “United States” by default. After all, that is where the Scratch website is based.
- Gobblesmack
-
100+ posts
Country detectors
Why? They should make a “location not given” change to be “United States” by default. After all, that is where the Scratch website is based.
Some people like having location not given on their profile.
Also, I support as per this, as it would be pretty useful and cool:
So:(language :: sensing) // gives the language that the scratcher is using scratch inI really like this idea. Support!
(country :: sensing) // gives the country the scratch has selected on their profile
What would the (country) block return if the scratch had no country selected? Just a “No Given Location,” or maybe undefined?
As with the username block, it should have a “This project can detect which country you have selected on your profile,” and “This project can detect which language you have selected,” What would happen if you had multiple of these messages?
- Austinato
-
1000+ posts
Country detectors
I think that the user is speaking about the “Location not given” setting translating to “United States” by default to the computer, but not publicly.Why? They should make a “location not given” change to be “United States” by default. After all, that is where the Scratch website is based.
Some people like having location not given on their profile.
Thanks for reading,
Austinato
- jokebookservice1
-
1000+ posts
Country detectors
Why not just report an empty string by default – unless…I think that the user is speaking about the “Location not given” setting translating to “United States” by default to the computer, but not publicly.Why? They should make a “location not given” change to be “United States” by default. After all, that is where the Scratch website is based.
Some people like having location not given on their profile.
Thanks for reading,
Austinato
The regular “Location not Given” is usually internally stored as “0” in the API.
However, you may have seen some tricks where people set their location to two letter codes. To prevent rude locations/security vulnerabilities, invalid locations (ones that don't actually exist) become “Location not Given”. However, you can still access the location the user set it to, by using the API.
Should location not given report location not given, 0, or the actual location as per the API?