sugarlabs / musicblocks

Music Blocks -- A musical microworld
https://musicblocks.sugarlabs.org/
GNU Affero General Public License v3.0
565 stars 762 forks source link

Way to access languages from the UI? #1011

Closed pikurasa closed 6 years ago

pikurasa commented 6 years ago

Walter and I have been exchanging emails about this issue, but this is the gist:

In some cases it is not so simple or obvious how one changes the language for music blocks. Additionally, Chrome/ium is often unreliable in setting the language for a couple of different reasons.

Reasons Chrome/ium is unreliable: (I have yet to successfully run MB in Japanese on my own computer, but...)

General issues with requiring the browser to be set to a particular language:

Questions:

If you are knowledgeable in this area, please contribute to this conversation.

sanatankc commented 6 years ago

I think an option to change languages will be very helpful. +1

pikurasa commented 6 years ago

I think an option to change languages will be very helpful. +1

@sanatankc Any ideas how this could be implemented?

sanatankc commented 6 years ago

If i am not wrong, than webl10n has an option to set language.

There could be an option including dropdown of languages in somewhere like bottom of the screen.

pikurasa commented 6 years ago

@sanatankc What is webl10n?

We have various languages, but the browser chooses them currently. There is no way right now to access from UI.

sanatankc commented 6 years ago

Oh sorry, webl10n is translation (localisation) method sugarizer uses currently. I am not sure about musicblocks, though.

walterbender commented 6 years ago

On Mon, Dec 25, 2017 at 9:15 PM, Sanatan notifications@github.com wrote:

Oh sorry, webl10n is translation (localisation) method sugarizer uses currently. I am not sure about musicblocks.

It is also used in Music Blocks.

https://github.com/walterbender/musicblocks/blob/master/js/activity.js#L53

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/walterbender/musicblocks/issues/1011#issuecomment-353904882, or mute the thread https://github.com/notifications/unsubscribe-auth/ADz74Qqyl6ARSfLN6LsmpTiwzxoDuNMKks5tEFbHgaJpZM4RL3Sy .

-- Walter Bender Sugar Labs http://www.sugarlabs.org http://www.sugarlabs.org

sanatankc commented 6 years ago

Then we can use setLanguage feature I think on changing languages.

pikurasa commented 6 years ago

Then we can use setLanguage feature I think on changing languages.

By using set language, you can access from UI?

walterbender commented 6 years ago

We'd need to expose it to the UI (maybe in the settings panel)

On Mon, Dec 25, 2017 at 9:33 PM, Devin Ulibarri notifications@github.com wrote:

Then we can use setLanguage feature I think on changing languages.

By using set language, you can access from UI?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/walterbender/musicblocks/issues/1011#issuecomment-353906479, or mute the thread https://github.com/notifications/unsubscribe-auth/ADz74c_nrKgWeJ05FHDyzS-46Awq8WZuks5tEFsWgaJpZM4RL3Sy .

-- Walter Bender Sugar Labs http://www.sugarlabs.org http://www.sugarlabs.org

walterbender commented 6 years ago

I have the following working:

You select a language preference, which is saved to local storage. Refresh the page, and that language preference will take effect. (Will not work with Chrome running from file:/// due to cross-origin error.)

Next: I need to build the UI to expose the language choices.

walterbender commented 6 years ago

Please test on the set-language branch:

https://github.com/walterbender/musicblocks/tree/set-language

pikurasa commented 6 years ago

I tested it:

I think it is a big plus, however there are two design issues that we should consider:

...and perhaps it displays in current language as well as selected language. I can imagine situations where this would be helpful.

walterbender commented 6 years ago

We'll need to hardwire the translations, but it should be doable. Can you please provide the .ja translation?

Re first open, it will try to use the language of the browser. After that, it will use whatever is in local storage.