Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

[WIP] Make layout compatible with RTL languages #8217

Closed
wants to merge 1 commit into from
Closed

[WIP] Make layout compatible with RTL languages #8217

wants to merge 1 commit into from

Conversation

luixxiul
Copy link
Contributor

@luixxiul luixxiul commented Apr 3, 2022

Addresses element-hq/element-web#14520

Requires #8230 #8231 #8243

This PR intends to make the current style rules written for the LTR (Left-To-Right) layout compatible with the RTL (Right-To-Left) layout, in order to make it possible to display UI in RTL languages such as Hebrew properly. Currently, UI in these languages are displayed in the LTR layout, but it should display not only translated strings but also other elements such as icons, buttons, the sidebar, the panel etc. from right to left, according to its layout.

Currently I don't plan to implement a function to enable the RTL layout as it is beyond my capability. The layout should be able to be switched by changing the value of dir specified to the top html tag. Any help to implement it is greatly appreciated!

  • Replace existing padding/margin with logical properties
  • Remove relative values to place elements where it is possible
  • Replace float: right and float: left used to align elements with flex/grid, which takes care of the flow of the elements automatically

Todo:

  • Rename elements whose name includes Right* and Left* eg. mx_RightPanel
  • Add a section to the style guideline to explain that styling with right and left (with margin, padding, float, etc.) should be avoided to maintain the RTL compatibility
  • Rewrite styles/code to display context menus of a space, message composer, etc. properly

Steps to test locally:

  1. Set up the development environment
  2. Add dir="rtl" to html tag of src/vector/index.html inside element-web
  3. Run yarn start
  4. Open Element at http://localhost:8080
  5. Change the language setting into RTL language such as Hebrew
Peek.2022-04-03.09-10.mp4

Here's what your changelog entry will look like:

✨ Features

  • [WIP] Make layout compatible with RTL languages (#8217). Contributed by @luixxiul.

Preview: https://pr8217--matrix-react-sdk.netlify.app
⚠️ Do you trust the author of this PR? Maybe this build will steal your keys or give you malware. Exercise caution. Use test accounts.

@codecov
Copy link

codecov bot commented Apr 3, 2022

Codecov Report

Merging #8217 (a00a6e4) into develop (35c49a8) will not change coverage.
The diff coverage is 0.00%.

❗ Current head a00a6e4 differs from pull request most recent head d7b8902. Consider uploading reports for the commit d7b8902 to get more accurate results

@@           Coverage Diff            @@
##           develop    #8217   +/-   ##
========================================
  Coverage    28.27%   28.27%           
========================================
  Files          861      861           
  Lines        49800    49800           
  Branches     12688    12688           
========================================
  Hits         14083    14083           
  Misses       35717    35717           
Impacted Files Coverage Δ
...rc/components/structures/auth/CompleteSecurity.tsx 0.00% <ø> (ø)
src/components/views/dialogs/DevtoolsDialog.tsx 14.28% <ø> (ø)
...c/components/views/right_panel/RoomSummaryCard.tsx 15.38% <ø> (ø)
src/components/views/right_panel/UserInfo.tsx 29.76% <ø> (ø)
src/components/views/rooms/LinkPreviewWidget.tsx 0.00% <ø> (ø)
src/components/views/rooms/ReplyPreview.tsx 42.85% <ø> (ø)
...omponents/views/settings/SetIntegrationManager.tsx 0.00% <ø> (ø)
src/components/views/toasts/GenericToast.tsx 16.66% <0.00%> (ø)

@luixxiul
Copy link
Contributor Author

luixxiul commented Apr 3, 2022

The commit above fixes the issue that close button is covered by the title.

after

The footer of the dialog is mess; it should be possible to get a clear view once #8160 is landed.

@luixxiul luixxiul changed the title [WIP] Make layout compatible with RTL languages [WIP] Make layout compatible with RTL layout Apr 3, 2022
@luixxiul luixxiul changed the title [WIP] Make layout compatible with RTL layout [WIP] Make layout compatible with RTL languages Apr 3, 2022
@MadLittleMods MadLittleMods added Z-Community-PR Issue is solved by a community member's PR T-Enhancement New features, changes in functionality, performance boosts, user-facing improvements labels Jun 1, 2022
Signed-off-by: Suguru Hirahara <[email protected]>
@luixxiul
Copy link
Contributor Author

luixxiul commented Jun 4, 2023

Closed as RTL design will never land at least until Element X

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
T-Enhancement New features, changes in functionality, performance boosts, user-facing improvements Z-Community-PR Issue is solved by a community member's PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants