-
Notifications
You must be signed in to change notification settings - Fork 779
Added language auto detection feature #713
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
On line 3451, added function this.getBrowserLanguage to detect the user's browser language. On line 1759, called getBrowserLanguage to automatically refresh and reload in the user's browser language.
nice, thanks! This has been suggested by a number of non-English speaking users in the past, so we should discuss it. To be honest, though, I don't like websites that automatically switch to a - in my own case German - translation whenever I log on. Scratch is a good example. It keeps forgetting that I want to see the site in English and every couple of days I have to scroll all the way down to reset it to English. You can manually set Snap to a translation, and it will remember your choice whenever you open it again. Also, if you're a teacher and want to always show Snap in a particular language you can share a link to URL that forces Snap to translate to a certain language (for example, German):
(careful, after you follow this link you'll have to reset the translation to your preferred language, hehe!) |
That's just a bad UI design -- most translatable sites have little flag icons at the top of the page. And someone who encounters Snap! for the first time without a teacher might not realize that it's even capable of supporting a language other than English, so the browser's native setting is a better first choice. Does Scratch translate all the help files? That's something I wish we did. |
It would seem, then, that we could just use the browser language & store it on non-initialized runs and use the stored lang afterwards, as long as Snap is reliable in its storage, which it seems to be. |
If we stop using images for help files we could at least use a service to translate them.
Yeah, it seems like the first time you load Snap!, the app could check for a saved browser setting and if it isn't present, use the auto detection. |
another idea would be not to switch automatically, but to pop-up a speech bubble or something offering you to switch to what the browser assumes to be your language (if it's different from the current one). This "bubble" could simply go away as soon as you click on something else (just like a tooltip or a menu), and you wouldn't see it if you open Snap in presentation mode. |
Also, if we do this, we will need to make sure all the help files are properly named or map the few exceptions we have. #446 Was discussing that i believe. |
Well, the current help file mechanism - which we inherited from Scratch 1.4 - is clearly a kludge. The right way to go about this would be for each help panel to be it's own actual (fully interactive) mini-project! |
I like this idea. I think that if we checked the browser language, prompted the user about changing their language if it doesn't match, and then if they select change, it would change it, or they exit the prompt and nothing changes. There could also be a "don't ask again" option so that it doesn't reappear all of the time. |
On line 3451, added function this.getBrowserLanguage to detect the user's browser language. On line 1759, we call getBrowserLanguage to automatically refresh and reload in the user's browser language (overrides default English language).