-
Notifications
You must be signed in to change notification settings - Fork 26
fix: display group handles RTL language direction #2677
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think perhaps this needs to be handled differently as I can imagine cases where the background image includes text that doesn't want to be flipped horizontally (e.g. logos/icons).
Could we not just use the asset language override system to include a flipped version for specific language codes?
I think that might not work exactly, since also an image that is e.g. aligned to the top right would need to become aligned to the top left(?) |
Visit the preview URL for this PR (updated for commit e1ba0eb): https://plh-teens-app1--pr2677-fix-display-group-ba-6f47u9rm.web.app (expires Tue, 21 Jan 2025 14:52:57 GMT) 🔥 via Firebase Hosting GitHub Action 🌎 Sign: e4c0bab6b08dd290fbf002fd6e07987fa4b5fce1 |
Hmm yes I did consider this but dismissed it for the reason @esmeetewinkel mentions. It's quite a tricky problem to solve, but we do have an immediate use case where it is required. One option would be to extend this PR's implementation with an exposed property, such as A messy but potentially workable option would be to author the change manually: i.e. author two sets of the display group in question, with only one displaying conditionally based upon the current app language. |
I don't have time to review now - but would be good to test this carefully on the |
It should still be possible to change the alignment based on language code, either via an override template or some sort of calc statement reading from Or if wanting a single asset can provide a raw CSS override to flip in the same way this PR tries to hardcode - In either case I still think better to handle from the authoring, as doing it in code raises more questions about why, for example, all images aren't flipped horizontally when in rtl mode and just the background image. Better to at least be consistent |
Okay, that's fine with me, I've been able to resolve with authoring using your first suggestion (I was worried about duplicate assets making the app download larger than needed but not a problem since it's only two assets in this case, and good to know there's a CSS workaround too). I do agree we're actually in a bit of a confusing (and inconsistent) situation already with some components flipping some images horizontally but not all. But hopefully that's mainly contained within KW specific components, and we can move towards more consistency as and when these become available to all deployments. |
@jfmcquade shall we close this PR favouring the workaround that @chrismclarke suggested? |
Yes I think so, it's true that we can't really apply this mirroring universally as it's all content-specific, so it makes sense that it should be handled at a content authoring level. If we decide further tools for doing so would be helpful, we can consider those independently of these proposed changes. |
Sounds good to me too, I've made a quick follow-up PR to provide an app language direction field for authors and give an example of flipping image horizontally on rtl language |
PR Checklist
Description
Follow-up to #2589
Git Issues
Closes #
Screenshots/Videos
feature_display_group:
LTR:
RTL: