Skip to content

Conversation

@ac-mmi
Copy link
Contributor

@ac-mmi ac-mmi commented Jul 24, 2025

@walterbender Switch Musicblocks to use i18next for language management

@github-actions
Copy link
Contributor

✅ All Jest tests passed! This PR is ready to merge.

@github-actions
Copy link
Contributor

✅ All Jest tests passed! This PR is ready to merge.

@walterbender
Copy link
Member

Very close to finishing this. Please do add instructions for running the Python script in po/README.md

@pikurasa this is a major update to i18n. Can you please test Kanji and Kana to make sure they are behaving properly? Thx.

@github-actions
Copy link
Contributor

✅ All Jest tests passed! This PR is ready to merge.

@github-actions
Copy link
Contributor

✅ All Jest tests passed! This PR is ready to merge.

@walterbender
Copy link
Member

@pikurasa It would be helpful if you could test Kanji and Kana before we merge this.

@pikurasa
Copy link
Collaborator

pikurasa commented Sep 7, 2025

When I tried to just fetch the code and run it locally without a server, it wouldn't open for me. I tried in incognito as well, but no luck.

Here are the captured logs:
-1757244818200.log

I then tried a local server, and it worked. Instructions: https://github.com/sugarlabs/musicblocks/?tab=readme-ov-file#how-to-set-up-a-local-server

Maybe this is expected, but "FYI".

I'm continuing to test now.

@walterbender
Copy link
Member

walterbender commented Sep 7, 2025 via email

@pikurasa
Copy link
Collaborator

pikurasa commented Sep 7, 2025

I don't think that the current i18n works w/o running a server either.

I mean that it wouldn't open the first time. On the other branches, you can open it the first time (but, yes, after that you cannot truly test i18n).

At any rate, I have some results. I'll share them in the next comment.

@pikurasa
Copy link
Collaborator

pikurasa commented Sep 7, 2025

On this branch, I am able to run in Japanese (Kanji).

I found only two palette strings that are untranslated: media and sensors; and one block string: duration (MS)

There are some missing strings in other places (e.g.) help, but I expect those. "Media" and "Sensors", I'm pretty sure have been translated.

As for Japanese (Kana), I cannot find a path to getting it to work.

I tried:

  • Going from Japanese (Kanji) into (Kana). I get a message in Japanese telling me that I'm already in the language.
  • Going to English and directly into (Kana), but what results is really (Kanji)
  • Refreshing the browser tab
  • Toggling in and out of advanced mode

None of these things seem to get a user into (Kana).

You can see the testing in this video, if that helps: https://youtu.be/x7RdFk_QppQ

@github-actions
Copy link
Contributor

github-actions bot commented Sep 7, 2025

✅ All Jest tests passed! This PR is ready to merge.

@ac-mmi
Copy link
Contributor Author

ac-mmi commented Sep 7, 2025

@pikurasa I’ve resolved the language change issue for kana/kanji. Tested on my side, and it’s working now.

@walterbender
Copy link
Member

Looks good to me. @pikurasa ?

@pikurasa
Copy link
Collaborator

pikurasa commented Sep 7, 2025

This updated version does switch to kana.

Some observations:

  • The Japanese-specific loading screen seems to not load. I see something in the logs about it as well: The resource http://127.0.0.1:3000/loading-animation-ja.svg was preloaded using link preload but not used within a few seconds from the window's load event. Please make sure it has an appropriate as value and it is preloaded intentionally.
  • Switching to advanced mode is not automatic, even in English. It does finally trigger upon refresh. This is a regression.

@github-actions
Copy link
Contributor

github-actions bot commented Sep 8, 2025

✅ All Jest tests passed! This PR is ready to merge.

@pikurasa
Copy link
Collaborator

pikurasa commented Sep 8, 2025

@ac-mmi

Is this ready for testing again?

Also, please be mindful that there are conflicts that need to be resolved before merging.

@ac-mmi
Copy link
Contributor Author

ac-mmi commented Sep 8, 2025

@pikurasa yes i solved that loading issue in japanese language and that advance mode issue as well

@github-actions
Copy link
Contributor

github-actions bot commented Sep 8, 2025

✅ All Jest tests passed! This PR is ready to merge.

@pikurasa
Copy link
Collaborator

It works.

While testing, it sometimes seemed to need a refresh to go into advanced mode. This would be a regression, but it was inconsistent in its reproducibility.

Also, once I ran into this:

Screenshot from 2025-09-10 07-06-54

I've never seen that before. But, again, that was inconsistent in its reproducibility.

@walterbender was also going to review once again and look into whether this PR is still using the new method of switching between kana and kanji.

@ac-mmi
Copy link
Contributor Author

ac-mmi commented Sep 10, 2025

@pikurasa This issue actually occurred earlier. The root cause was in languagebox.js, where this._language = "ja"; was being set for both Kana and Kanji. I had already resolved this at the same time when we were troubleshooting the Kana → Kanji transition issue.

@walterbender walterbender merged commit 1f92f04 into sugarlabs:master Sep 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants