Skip to content
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

Language choice can greatly change preference dialog size #843

Closed
KatieWoe opened this issue Aug 24, 2022 · 12 comments
Closed

Language choice can greatly change preference dialog size #843

KatieWoe opened this issue Aug 24, 2022 · 12 comments
Assignees
Labels

Comments

@KatieWoe
Copy link

Test device
Dell
Operating System
Win 11
Browser
Chrome
Problem description
For phetsims/qa#830
One of the languages (Chinese Taiwan) changes the preference dialog box size quite a bit. It doesn't go out of bounds, so I'm not too worried, but it is different behavior. I think it's due to the translation of the first page of the dialog.

Visuals
Oddly sized dialog box:
longsize
longfirst
Standard sized dialog box:
normalsize
normalfirst

Troubleshooting information:

!!!!! DO NOT EDIT !!!!!
Name: ‪Gravity and Orbits‬
URL: https://phet-dev.colorado.edu/html/gravity-and-orbits/1.6.0-dev.3/phet/gravity-and-orbits_all_phet.html
Version: 1.6.0-dev.3 2022-08-23 23:55:17 UTC
Features missing: applicationcache, applicationcache, touch
Flags: pixelRatioScaling
User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/104.0.0.0 Safari/537.36
Language: en-US
Window: 1536x714
Pixel Ratio: 1.25/1
WebGL: WebGL 1.0 (OpenGL ES 2.0 Chromium)
GLSL: WebGL GLSL ES 1.0 (OpenGL ES GLSL ES 1.0 Chromium)
Vendor: WebKit (WebKit WebGL)
Vertex: attribs: 16 varying: 30 uniform: 4096
Texture: size: 16384 imageUnits: 16 (vertex: 16, combined: 32)
Max viewport: 32767x32767
OES_texture_float: true
Dependencies JSON: {}

@jessegreenberg
Copy link
Contributor

Thanks @KatieWoe. I am not sure what is expected here. The Dialog fits the size of its contents. The contents are allowed to expand to support longer strings. Without dynamic locales this wouldn't be a problem. @arouinfar @kathy-phet should this behavior change?

@kathy-phet
Copy link

@jessegreenberg - I'm not sure why it doesn't just wrap in chinese, since it is a paragraph?

@jessegreenberg
Copy link
Contributor

jessegreenberg commented Aug 25, 2022

The paragraph uses RichText lineWrap. Something about that translated string isn't triggering line breaks. The separator for line breaks is a space ' ', maybe the translated string doesn't use that space character? I am not sure if there is another character to look for in RichText or if it is customary for the entire paragraph to be on line in the chinese translation.

EDIT: I found the translated string, and this shows that it does not use the space character so RichText things it is one long word:
image

@jessegreenberg
Copy link
Contributor

Assigning to @jonathanolson in case he has any thoughts about what should happen with RichText lineWrap in this case, and @arouinfar and @kathy-phet to prioritize and comment on design.

@arouinfar
Copy link

In general, I am fine with the Preferences dialog changing in width in response to locale, so long as it remains within the dev bounds. Since the width is properly constrained here, we can probably leave it at that.

However, in this specific case, we could probably add spaces after the period character without changing the meaning of the translation (source).

I am fine with either approach.

@arouinfar arouinfar removed their assignment Aug 29, 2022
@samreid
Copy link
Member

samreid commented Aug 30, 2022

@arouinfar is this blocking Gravity and Orbits RC? @jonathanolson would this be easy to correct?

@samreid samreid assigned arouinfar and unassigned kathy-phet Aug 30, 2022
@zepumph
Copy link
Member

zepumph commented Aug 30, 2022

@arouinfar said this doesn't block publication.

@jonathanolson
Copy link
Contributor

I should have a fix for this relatively soon!

jonathanolson added a commit to phetsims/acid-base-solutions that referenced this issue Aug 31, 2022
…eak detection. Adding back directional marks into load-unbuilt-strings. Proper RichText line break handling. See phetsims/joist#843
jonathanolson added a commit to phetsims/aqua that referenced this issue Aug 31, 2022
…eak detection. Adding back directional marks into load-unbuilt-strings. Proper RichText line break handling. See phetsims/joist#843
jonathanolson added a commit to phetsims/area-builder that referenced this issue Aug 31, 2022
…eak detection. Adding back directional marks into load-unbuilt-strings. Proper RichText line break handling. See phetsims/joist#843
jonathanolson added a commit to phetsims/area-model-algebra that referenced this issue Aug 31, 2022
…eak detection. Adding back directional marks into load-unbuilt-strings. Proper RichText line break handling. See phetsims/joist#843
jonathanolson added a commit to phetsims/area-model-introduction that referenced this issue Aug 31, 2022
…eak detection. Adding back directional marks into load-unbuilt-strings. Proper RichText line break handling. See phetsims/joist#843
jonathanolson added a commit to phetsims/atomic-interactions that referenced this issue Aug 31, 2022
…eak detection. Adding back directional marks into load-unbuilt-strings. Proper RichText line break handling. See phetsims/joist#843
jonathanolson added a commit to phetsims/bamboo that referenced this issue Aug 31, 2022
…eak detection. Adding back directional marks into load-unbuilt-strings. Proper RichText line break handling. See phetsims/joist#843
jonathanolson added a commit to phetsims/balancing-act that referenced this issue Aug 31, 2022
…eak detection. Adding back directional marks into load-unbuilt-strings. Proper RichText line break handling. See phetsims/joist#843
jonathanolson added a commit to phetsims/axon that referenced this issue Aug 31, 2022
…eak detection. Adding back directional marks into load-unbuilt-strings. Proper RichText line break handling. See phetsims/joist#843
jonathanolson added a commit to phetsims/arithmetic that referenced this issue Aug 31, 2022
…eak detection. Adding back directional marks into load-unbuilt-strings. Proper RichText line break handling. See phetsims/joist#843
jonathanolson added a commit to phetsims/area-model-multiplication that referenced this issue Aug 31, 2022
…eak detection. Adding back directional marks into load-unbuilt-strings. Proper RichText line break handling. See phetsims/joist#843
jonathanolson added a commit to phetsims/trig-tour that referenced this issue Aug 31, 2022
…eak detection. Adding back directional marks into load-unbuilt-strings. Proper RichText line break handling. See phetsims/joist#843
jonathanolson added a commit to phetsims/sun that referenced this issue Aug 31, 2022
…eak detection. Adding back directional marks into load-unbuilt-strings. Proper RichText line break handling. See phetsims/joist#843
jonathanolson added a commit to phetsims/states-of-matter that referenced this issue Aug 31, 2022
…eak detection. Adding back directional marks into load-unbuilt-strings. Proper RichText line break handling. See phetsims/joist#843
jonathanolson added a commit to phetsims/scenery-phet that referenced this issue Aug 31, 2022
…eak detection. Adding back directional marks into load-unbuilt-strings. Proper RichText line break handling. See phetsims/joist#843
jonathanolson added a commit to phetsims/twixt that referenced this issue Aug 31, 2022
…eak detection. Adding back directional marks into load-unbuilt-strings. Proper RichText line break handling. See phetsims/joist#843
jonathanolson added a commit to phetsims/tappi that referenced this issue Aug 31, 2022
…eak detection. Adding back directional marks into load-unbuilt-strings. Proper RichText line break handling. See phetsims/joist#843
jonathanolson added a commit to phetsims/utterance-queue that referenced this issue Aug 31, 2022
…eak detection. Adding back directional marks into load-unbuilt-strings. Proper RichText line break handling. See phetsims/joist#843
jonathanolson added a commit to phetsims/vector-addition-equations that referenced this issue Aug 31, 2022
…eak detection. Adding back directional marks into load-unbuilt-strings. Proper RichText line break handling. See phetsims/joist#843
jonathanolson added a commit to phetsims/unit-rates that referenced this issue Aug 31, 2022
…eak detection. Adding back directional marks into load-unbuilt-strings. Proper RichText line break handling. See phetsims/joist#843
jonathanolson added a commit to phetsims/sherpa that referenced this issue Aug 31, 2022
…eak detection. Adding back directional marks into load-unbuilt-strings. Proper RichText line break handling. See phetsims/joist#843
jonathanolson added a commit to phetsims/wave-on-a-string that referenced this issue Aug 31, 2022
…eak detection. Adding back directional marks into load-unbuilt-strings. Proper RichText line break handling. See phetsims/joist#843
jonathanolson added a commit to phetsims/vegas that referenced this issue Aug 31, 2022
…eak detection. Adding back directional marks into load-unbuilt-strings. Proper RichText line break handling. See phetsims/joist#843
jonathanolson added a commit to phetsims/vibe that referenced this issue Aug 31, 2022
…eak detection. Adding back directional marks into load-unbuilt-strings. Proper RichText line break handling. See phetsims/joist#843
jonathanolson added a commit to phetsims/xray-diffraction that referenced this issue Aug 31, 2022
…eak detection. Adding back directional marks into load-unbuilt-strings. Proper RichText line break handling. See phetsims/joist#843
jonathanolson added a commit to phetsims/waves-intro that referenced this issue Aug 31, 2022
…eak detection. Adding back directional marks into load-unbuilt-strings. Proper RichText line break handling. See phetsims/joist#843
jonathanolson added a commit to phetsims/scenery that referenced this issue Aug 31, 2022
…eak detection. Adding back directional marks into load-unbuilt-strings. Proper RichText line break handling. See phetsims/joist#843
jonathanolson added a commit to phetsims/wave-interference that referenced this issue Aug 31, 2022
…eak detection. Adding back directional marks into load-unbuilt-strings. Proper RichText line break handling. See phetsims/joist#843
jonathanolson added a commit to phetsims/wilder that referenced this issue Aug 31, 2022
…eak detection. Adding back directional marks into load-unbuilt-strings. Proper RichText line break handling. See phetsims/joist#843
jonathanolson added a commit to phetsims/vector-addition that referenced this issue Aug 31, 2022
…eak detection. Adding back directional marks into load-unbuilt-strings. Proper RichText line break handling. See phetsims/joist#843
@jonathanolson
Copy link
Contributor

Main commits in phetsims/chipper@4711345, phetsims/sherpa@e2b5b26, phetsims/scenery@f7a32b0, ee0da58

I added isLeftToRightProperty and some changes to GeneralPreferencesPanel to fix some i18n issues. I noticed that load-unbuilt-strings was NOT adding in directional marks into strings, and that was causing bugginess (I fixed that). RichText lineWrap will now wrap properly at unicode-decided points. This seems to work nicely for all locales that we have:

image

image

and also does the RTL properly:

image

@jonathanolson
Copy link
Contributor

@jessegreenberg would you be able to review?

@zepumph
Copy link
Member

zepumph commented Aug 31, 2022

@pixelzoom, @jbphet and I were all hit by the API changes from this. Committed above.

@jessegreenberg
Copy link
Contributor

I reviewed the commits referenced in #843 (comment), changes make sense to me.

The Preferences dialog is working really well, no longer resizes for different translations. RichText lineWrap is working great for all locales I have seen and the formatting for rtl languages works nicely. Very cool @jonathanolson, thanks! Closing.

jbphet pushed a commit to phetsims/greenhouse-effect that referenced this issue Sep 10, 2022
…eak detection. Adding back directional marks into load-unbuilt-strings. Proper RichText line break handling. See phetsims/joist#843
jonathanolson added a commit to jonathanolson/wordle-solver that referenced this issue Feb 23, 2023
…eak detection. Adding back directional marks into load-unbuilt-strings. Proper RichText line break handling. See phetsims/joist#843
samreid pushed a commit to phetsims/perennial that referenced this issue Oct 22, 2024
…eak detection. Adding back directional marks into load-unbuilt-strings. Proper RichText line break handling. See phetsims/joist#843
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

7 participants