Support dynamic locales
Closed this issue · 5 comments
During code review #398, @matthew-blackman @jessegreenberg and I discovered that the sim strings do not dynamically adjust when the locale is changed at runtime. We tested this via ?stringTest=dynamic
then using the arrow keys. The reviewers recommend that we should take the time now to support dynamic locale. It does not look like a very large number of strings on the screen.
@jessegreenberg indicated a previous decision that we did not have time to support dynamic strings for this sim.
@jessegreenberg indicated that this is also moving toward a production publication, not a prototype publication. For me, this is even more reason to support dynamic strings.
@jessegreenberg wanted to run this past @kathy-phet before spending time on it.
Yes, please support dynamic locale. @jessegreenberg - You have my support/time to spend time on this. Thanks!
OK, thanks @kathy-phet! I have added this to the dim sum items for this iteration. This should be a quick task but we will report back if it gets very complicated due to the large number of Voicing strings.
string -> StringProperty done in the above commit, ready for layout changes. Using locales=*&stringTest=dynamic&dev
It looks like Vertex labels need to re-center and the "ResetShape" button needs to be re-centered upon string change.
Dynamic layout added above. @arouinfar and @terracoda offered to review the behavior during a recent standup meeting, assigning to them and thanks!
EDIT: I also did some testing for memory leaks after adding string Properties and did not see any.
@jessegreenberg I tested this thoroughly with stringTest=dynamic
and I'm not seeing any layout issues. Everything looks great!
Also, I just want to note that stringTest=dynamic
is a really useful tool. It's much more efficient than cycling through existing locales or customizing the strings in Studio.
My schedule didn't line up with @terracoda, but I shared a link to the documentation in initialize-globals over Slack. I think it's a pretty low barrier to entry, but happy to consult on any future dynamic locale review needs.
Since I don't have any change requests, I think we're good to close.