-
Notifications
You must be signed in to change notification settings - Fork 14
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
Consider using isolates instead of embeddings to handle mixed-direction strings #1355
Comments
Nov 17 2022 Dev meeting: @kathy-phet can you please add some specific examples, that depict the problems? And make a rough time investment about how difficult/complex to switch over. @jonathanolson and @jbphet agreed to take a look. Thanks! |
Here are two examples from the currently live version of Build a Molecule (v1.0.6). Persian (locale = fa): Moroccan Arabic (locale = ar_MA): In both of these examples, the chemical formulas for the compounds are being rendered in reverse, e.g. O2H instead of H2O. To be clear, I'm not saying that using isolates instead of embeddings will solve this problems - I basically think we shouldn't be adding either to patterns. However, this issue needs some attention to make things work better for RTL languages, and the Unicode spec seems to recommend isolates, so perhaps now would be a good time to try them out and see if they are easier to work with, which is what the spec seems to say. |
Here is a related issue about this problem in BAM specifically. I'm putting it here to make sure these two are linked: phetsims/build-a-molecule#220. |
I asked @kathy-phet about whether I should take the time to fix this fully now, or put some short-term fixes into the upcoming Greenhouse Effect prototype publication. Here is the dialog:
So it looks like I'm cleared to spend some initial investigation time on this. |
https://stackoverflow.com/questions/71817022/what-is-the-difference-between-embed-and-isolate-values-in-unicode-bidi-cs looks like an interesting case. They look similar enough. Let me know if you need any assistance! |
From 12/8/22 dev meeting: KP: @jbphet and @jonathanolson please collaborate when JB is ready to discuss. |
@jbphet the chemical formula wasn't including LTR marks (even though it had LTR text). That's mainly because they weren't composed of translated strings. Wrapping it with these should resolve the issue for the sim. Commits above, can you view? |
QA test in phetsims/qa#1113. |
Most of this work is handled. Any remaining work will be in phetsims/build-a-molecule#220. |
While working on an issue related to the testing of dynamic strings (#1319), I came across the following information on a page that describes the RLE unicode character:
I know we've run into some problems with embeddings, and I'm wondering if using isolates instead could make things simpler. I'll mark this for developer meeting and perhaps a subgroup can investigate.
The text was updated successfully, but these errors were encountered: