Discuss Scratch

LemonComputer
Scratcher
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
(Country)

I need a script that goes like
when backdrop switches to [backdrop5 v]
if <(Country) = [UK]> then
switch costume to [English tutorial1 v]
else
if <(Country) = [France]> then
switch costume to [French tutorial1 v]
end
Basically like that but for most countries that are able to access Scratch.

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
Scratcher
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.
jokebookservice1
Scratcher
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.
powercon5
Scratcher
1000+ posts

Country detectors

So
(Language::sensing)
I can see how that could work and would go along with

(username)
Bright-Idea
Scratcher
1000+ posts

Country detectors

I support for a
(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
Scratcher
1000+ posts

Country detectors

No support because this could happen:
set [Nothing here... v] to (country)
broadcast [encode variable to numbers v]
set [☁ Defiantly nothing here v] to (encoded variable)
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.

Last edited by dude341 (Oct. 27, 2016 17:50:05)

Candylanguagegirl
Scratcher
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
Scratcher
100+ posts

Country detectors

jokebookservice1 wrote:

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.
^^this
19f8361
Scratcher
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
Scratcher
100+ posts

Country detectors

19f8361 wrote:

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..
FTFY
Austinato
Scratcher
1000+ posts

Country detectors

19f8361 wrote:

support, but how about 2 blocks:

(country uses [acutal location v]::sensing) //works if you accept location, reports using your acutal location.
As for this one, would this use IP addresses?
19f8361
Scratcher
500+ posts

Country detectors

Austinato wrote:

19f8361 wrote:

support, but how about 2 blocks:

(country uses [acutal location v]::sensing) //works if you accept location, reports using your acutal location.
As for this one, would this use IP addresses?

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
Scratcher
100+ posts

Country detectors

dude341 wrote:

No support because this could happen:
set [Nothing here... v] to (country)
broadcast [encode variable to numbers v]
set [☁ Defiantly nothing here v] to (encoded variable)
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.

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
Scratcher
1000+ posts

Country detectors

LemonComputer wrote:

dude341 wrote:

No support because this could happen:
set [Nothing here... v] to (country)
broadcast [encode variable to numbers v]
set [☁ Defiantly nothing here v] to (encoded variable)
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.

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.
Oh, OK. Support then, this would be useful for detecting people's language.
KingOfAwesome58219
Scratcher
1000+ posts

Country detectors

So:
(language :: sensing) // gives the language that the scratcher is using scratch in
(country :: sensing) // gives the country the scratch has selected on their profile
I really like this idea. Support!

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
Scratcher
1000+ posts

Country detectors

KingOfAwesome58219 wrote:

So:
(language :: sensing) // gives the language that the scratcher is using scratch in
(country :: sensing) // gives the country the scratch has selected on their profile
I really like this idea. Support!

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?
They could be presented as a list: “This project can access your username and location. To hide your identity…”
WolfCat67
Scratcher
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
Scratcher
100+ posts

Country detectors

WolfCat67 wrote:

They should make a “location not given” change to be “United States” by default. After all, that is where the Scratch website is based.
Why?
Some people like having location not given on their profile.

Also, I support as per this, as it would be pretty useful and cool:

KingOfAwesome58219 wrote:

So:
(language :: sensing) // gives the language that the scratcher is using scratch in
(country :: sensing) // gives the country the scratch has selected on their profile
I really like this idea. Support!

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
Scratcher
1000+ posts

Country detectors

Gobblesmack wrote:

WolfCat67 wrote:

They should make a “location not given” change to be “United States” by default. After all, that is where the Scratch website is based.
Why?
Some people like having location not given on their profile.
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.

Thanks for reading,
Austinato
jokebookservice1
Scratcher
1000+ posts

Country detectors

Austinato wrote:

Gobblesmack wrote:

WolfCat67 wrote:

They should make a “location not given” change to be “United States” by default. After all, that is where the Scratch website is based.
Why?
Some people like having location not given on their profile.
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.

Thanks for reading,
Austinato
Why not just report an empty string by default – unless…

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?

Powered by DjangoBB