-
Notifications
You must be signed in to change notification settings - Fork 887
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
Implement right-to-left interface #3970
Implement right-to-left interface #3970
Conversation
…lacing padding-left and padding-right with padding-inline-start and padding-inline-end
…ing margin-left and margin-right with margin-inline-start and margin-inline-end
This commit also changes border-left to border-inline-start, and border-right to border-inline-end.
…lock-start, and inset-block-end This commit also replaces border-top and border-bottom with border-block-start and border-block-end.
To the fullest of my understanding, it is expected for the left navigation in rtl-supporting browsers to be for forward navigation, and the right one to be for backward navigation.
…ing in wrong x-direction for rtl languages
…oper rtl text orientation
…ctly on page reload
…ems: start I have validated this for all settings tabs; the justify-content: start did nothing in any language, left-to-right or right-to-left. Replacing it with align-items: start aligned all menu switch items by their switches, not by their labels. This makes for a much more uniform settings section for trl languages.
…hanging language to one with different directionality Given that which icon is displayed for which history arrow is now dynamic based on the user's directionality, changing of the icon resets the font-awesome-icon state and thus re-adds the base disabled class to both arrows. This means that changing your language to one that has a different directionality was falsely setting the arrows to their disabled state (until the route is changed, after which the history icons will be fully back to normal). This commmit refactors the history icon setting logic to use class binding to two booleans in the top-nav component's data rather than adding and removing the disabled classes directly to the arrow elements' classLists, thus cleaning up the implementation and fixing the bug.
…f locale value from store Kudos to absidue for pointing out this existing function for representing this, and that it grabs directly from the i18n object. This means that FreeTube will display the proper rtl interface if one is the user's system language, where it did not before.
Leverage the icons being flipped rather than manually setting the classes to their opposites when the directionality is RTL.
8acd703
to
3886a56
Compare
3886a56
to
3149c3e
Compare
Added the problem with using concatenation instead of placeholders to the Development Chores board: https://github.com/FreeTubeApp/FreeTube/projects/10. We already use placeholders in some places (search for |
Co-authored-by: absidue <48293849+absidue@users.noreply.github.com>
Co-authored-by: absidue <48293849+absidue@users.noreply.github.com>
Co-authored-by: PikachuEXE <pikachuexe@gmail.com>
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.
Messes up any LTR text e.g. the video description where link rendering breaks, but I don't think that's solvable unless we embed translation tool level language detection, to pick the direction based on the content.
@atpersian @yarons @rex07 These changes are now present in the latest nightly build. Here is more information on how to use nightly builds. Please feel welcome to update here with any comments or concerns! You are also welcome to compare & contrast with YouTube's current RTL support. |
Dear Dude |
Here you go: https://docs.freetubeapp.io/development/nightly-builds |
* development: (46 commits) Translated using Weblate (Hebrew) Translated using Weblate (Hebrew) Translated using Weblate (Chinese (Simplified)) Add subscribed icon to comments (FreeTubeApp#4007) Translated using Weblate (Icelandic) Translated using Weblate (Czech) Translated using Weblate (Bulgarian) Translated using Weblate (Polish) Translated using Weblate (Arabic) Translated using Weblate (Greek) Translated using Weblate (Italian) Translated using Weblate (Chinese (Simplified)) Translated using Weblate (Hungarian) Translated using Weblate (Portuguese (Brazil)) Translated using Weblate (Ukrainian) Translated using Weblate (Spanish) Translated using Weblate (Hebrew) Translated using Weblate (Turkish) Search: Add hashtags to results (FreeTubeApp#3780) Implement right-to-left interface (FreeTubeApp#3970) ... # Conflicts: # src/renderer/components/ft-element-list/ft-element-list.vue # src/renderer/components/ft-prompt/ft-prompt.css # src/renderer/components/ft-toast/ft-toast.css # src/renderer/scss-partials/_ft-list-item.scss # src/renderer/views/Playlist/Playlist.scss
i check Artifacts file , change some translate for better understanding contents. (language name and ..etc) . thanks for your response . |
No glitches yet, looking pretty good. |
Implement right-to-left interface
Co-authored by @ChunkyProgrammer
Pull Request Type
Related issue
closes #1550
Description
At a high level, this PR updates the interface of FreeTube to accommodate the proper patterns for right-to-left languages throughout the entire app. This PR looks quite large, and it is, but >80-85% of the changes are migrating CSS properties to their 1:1 directionality-agnostic equivalents.
Implementation-wise:
margin-left
/-right
withmargin-inline-start
/-end
&margin-top
/-bottom
withmargin-block-start
/-end
padding-left
/-right
withpadding-inline-start
/end
&padding-top
/-bottom
withpadding-block-start
/-end
left
/right
withinset-inline-start
/-end
&top
/bottom
withinset-block-start
/-end
border-left*
/border-right*
withborder-inset-start
/-end
&border-top*
/border-bottom*
withborder-block-start
/-end
text-align: left
/right
withtext-align: start
/end
float: left
/right
with two CSS variables (becausefloat: inline-start
/-end
is still experimental in Chrome)transform()
x values to conditionally be inverted by multiplying them with a CSS variable of 1 or -1 based on language directionality (090f392)ft-input.css
to fix an emergent issue with the search barmagnifying-glass
icon positioning on languages with right-to-left directionalitymagnifying-glass
on search bars andcircle-question
on theAbout
route)Screenshots
Testing
Test Plan
magnifying-glass
on search bars andcircle-question
on theAbout
routeft-input
placeholders, comments sections, the video count container inside each playlist thumbnail in the Channel Playlists tab, the labels in the profile sections, polls in the Channel Community tab)true ||
tov-if
statements on lines 17 and 21 ofApp.vue
to show & validate updates banner is rtlDesktop
Future Action Items
Add linter requiring use of directionality-neutral CSS properties
To maintain a usable right-to-left interface, we must ensure that the directionality-agnostic property names listed above are used in all cases going forward (with maybe the sole exception of
videoJS.css
).Ongoing Localization Problem
We currently use string concatenation of data and an i18n label in many places in the code (e.g., "v0.19.0 Beta" on the About page, "5,000 views" on video lists. This is not the way to do this, because many languages order those values differently. This will need to be addressed in a separate PR given that this is more of a localization problem, but I thought it would mention it specifically because languages with right-to-left directionality are most notably affected.
Enhancement: Switch left-to-right direction in
ft-input
s and their search results based on whether the text typed is in anltr
orrtl
language.Support for vertical writing modes
This PR actually does much of the heavy lifting for accommodating vertical writing modes. The side nav bar, top nav bar, and many controls' styling will have to be reworked for this to be a reality, but these directionality-agnostic properties aren't just useful for rtl support.
To RTL language users
let us know if you are having any issues with directionality in the video player or any other part of FreeTube!