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

Implement right-to-left interface #3970

Merged
merged 69 commits into from
Sep 9, 2023
Merged
Show file tree
Hide file tree
Changes from 68 commits
Commits
Show all changes
69 commits
Select commit Hold shift + click to select a range
538884b
Replace margin-left with margin-inline-start
kommunarr Aug 28, 2023
ed1836a
Replace margin-right with margin-inline-end
kommunarr Aug 28, 2023
5dc8303
Replace padding-left with padding-inline-start
kommunarr Aug 28, 2023
215ae66
Replace padding-right with padding-inline-end
kommunarr Aug 28, 2023
1bee690
Replace padding-top & padding-bottom with padding-block; continue rep…
kommunarr Aug 28, 2023
0fa5a5f
Add updated rtl-compatible margins to ft-slider and fix indentation
kommunarr Aug 28, 2023
c88f916
Replace margin-top & margin-bottom with margin-block; continue replac…
kommunarr Aug 28, 2023
7509ef1
Continue replacing with margin-block and margin-inline
kommunarr Aug 28, 2023
0b06cb1
Replace left and right with inset-inline-start and inset-inline-end
kommunarr Aug 28, 2023
d73c9ee
Replace margin-bottom, top, and bottom with margin-block-end, inset-b…
kommunarr Aug 28, 2023
127ee1a
Replace text-align left and right with text-align start and end
kommunarr Aug 28, 2023
3fe7977
Fix syntax error with inset-block-end
kommunarr Aug 28, 2023
6de06bb
Implement dynamic float: left/right based on direction ltr/rtl
kommunarr Aug 28, 2023
a95d32c
Implement dynamic navigation arrow placement based on direction ltr/rtl
kommunarr Aug 28, 2023
3f5539a
Add direction to body based on preferred language
kommunarr Aug 28, 2023
5f29208
Implement horizontal directionality coefficient to fix translate work…
kommunarr Aug 29, 2023
eb6169c
Add explicit text-align: start in places to ensure rtl version is cor…
kommunarr Aug 28, 2023
e2e7bfb
Add text-align: start to places where it is not inferred to enable pr…
kommunarr Aug 29, 2023
245c811
Fix search bar magnifying glass being too far right issue
kommunarr Aug 29, 2023
32b3473
Move body.dir-setting logic to setLocale to fix dir not setting corre…
kommunarr Aug 29, 2023
fe8f397
Change .switchColumn to have align-items: start instead of justify-it…
kommunarr Aug 29, 2023
5325cc2
Fix emergent bug in which history icons are temporarily disabled on c…
kommunarr Aug 29, 2023
251cde5
Add Kurdish to rtl languages list & add li items to be right-aligned …
kommunarr Aug 29, 2023
b38c586
Force FreeTube logo to be ordered left-to-right for 'brand consistency'
kommunarr Aug 29, 2023
d221f43
Add styling flipping font-awesome icons for rtl languages except for …
kommunarr Aug 29, 2023
b8462cc
Update isRightAligned with additional languages, and use it instead o…
kommunarr Aug 29, 2023
03648af
Update isRightAligned property name to more clearly reflect rtl purpose
kommunarr Aug 29, 2023
a16c7f7
Simplify left/right arrow display logic
kommunarr Aug 29, 2023
a96fc0c
Replace justify-self: left & justify-self: right with justify-self; s…
kommunarr Aug 29, 2023
a9d1937
Remove misguided attempt to emulate directionality-agnosticism with r…
kommunarr Aug 29, 2023
e6a8b5c
Explicitly center FreeTube version on About page
kommunarr Aug 29, 2023
83db9b6
Replace pre-existing identation issue
kommunarr Aug 30, 2023
2617e7d
Replace margin-left with margin-inline-start
kommunarr Aug 28, 2023
bf1c458
Replace margin-right with margin-inline-end
kommunarr Aug 28, 2023
594adb8
Replace padding-left with padding-inline-start
kommunarr Aug 28, 2023
0427cee
Replace padding-right with padding-inline-end
kommunarr Aug 28, 2023
68a00a8
Replace padding-top & padding-bottom with padding-block; continue rep…
kommunarr Aug 28, 2023
c70a511
Add updated rtl-compatible margins to ft-slider and fix indentation
kommunarr Aug 28, 2023
d7cf402
Replace margin-top & margin-bottom with margin-block; continue replac…
kommunarr Aug 28, 2023
f2a0385
Continue replacing with margin-block and margin-inline
kommunarr Aug 28, 2023
9558f61
Replace left and right with inset-inline-start and inset-inline-end
kommunarr Aug 28, 2023
b07a378
Replace margin-bottom, top, and bottom with margin-block-end, inset-b…
kommunarr Aug 28, 2023
fa2cba3
Replace text-align left and right with text-align start and end
kommunarr Aug 28, 2023
31729e6
Fix syntax error with inset-block-end
kommunarr Aug 28, 2023
08a0a5f
Implement dynamic float: left/right based on direction ltr/rtl
kommunarr Aug 28, 2023
03542be
Implement dynamic navigation arrow placement based on direction ltr/rtl
kommunarr Aug 28, 2023
b97480f
Add direction to body based on preferred language
kommunarr Aug 28, 2023
b73220e
Implement horizontal directionality coefficient to fix translate work…
kommunarr Aug 29, 2023
c20e834
Add explicit text-align: start in places to ensure rtl version is cor…
kommunarr Aug 28, 2023
b46e92b
Add text-align: start to places where it is not inferred to enable pr…
kommunarr Aug 29, 2023
64e69f0
Fix search bar magnifying glass being too far right issue
kommunarr Aug 29, 2023
cdcbc08
Move body.dir-setting logic to setLocale to fix dir not setting corre…
kommunarr Aug 29, 2023
e152e4e
Change .switchColumn to have align-items: start instead of justify-it…
kommunarr Aug 29, 2023
df5926a
Fix emergent bug in which history icons are temporarily disabled on c…
kommunarr Aug 29, 2023
2fe664a
Add Kurdish to rtl languages list & add li items to be right-aligned …
kommunarr Aug 29, 2023
8f42005
Force FreeTube logo to be ordered left-to-right for 'brand consistency'
kommunarr Aug 29, 2023
3bc31a1
Add styling flipping font-awesome icons for rtl languages except for …
kommunarr Aug 29, 2023
ea6405a
Update isRightAligned with additional languages, and use it instead o…
kommunarr Aug 29, 2023
301fe30
Update isRightAligned property name to more clearly reflect rtl purpose
kommunarr Aug 29, 2023
d7626c8
Simplify left/right arrow display logic
kommunarr Aug 29, 2023
1f58445
Replace justify-self: left & justify-self: right with justify-self; s…
kommunarr Aug 29, 2023
3d1cdfa
Remove misguided attempt to emulate directionality-agnosticism with r…
kommunarr Aug 29, 2023
812cdee
Explicitly center FreeTube version on About page
kommunarr Aug 29, 2023
b9d6bf1
Merge branch 'development' of github.com:FreeTubeApp/FreeTube into ad…
kommunarr Sep 1, 2023
c136216
Fix question mark icon orientation in Arabic, Kurdish, Persian, and Urdu
kommunarr Sep 1, 2023
3149c3e
Fix question mark reversing logic for Arabic, Hebrew, Persian, and Urdu
kommunarr Sep 1, 2023
7ed599d
Fix minor indentation issue
kommunarr Sep 5, 2023
a97b3fe
Remove unused function
kommunarr Sep 5, 2023
3cee5da
Update src/renderer/components/ft-slider/ft-slider.css
kommunarr Sep 7, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 11 additions & 7 deletions src/renderer/App.css
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,19 @@

.routerView {
flex: 1 1 0%;
margin: 18px 10px;
margin-block: 18px;
margin-inline: 10px;
}

.banner {
width: 85%;
margin: 20px auto 0;
margin-block: 20px;
margin-inline: auto;
}

.banner-wrapper {
margin: 0 10px;
margin-block: 0;
margin-inline: 10px;
}

.flexBox {
Expand All @@ -45,16 +48,17 @@

@media only screen and (max-width: 680px) {
.routerView {
margin: 68px 8px 68px;
margin-block: 68px;
margin-inline: 8px;
}

.banner {
width: 80%;
margin-top: 20px;
margin-block-start: 20px;
}

.flexBox {
margin-top: 60px;
margin-bottom: -75px;
margin-block-start: 60px;
margin-block-end: -75px;
}
}
10 changes: 8 additions & 2 deletions src/renderer/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,9 @@ export default defineComponent({
showProgressBar: function () {
return this.$store.getters.getShowProgressBar
},
isRightAligned: function () {
return this.locale === 'ar' || this.locale === 'he'
isLocaleRightToLeft: function () {
return this.locale === 'ar' || this.locale === 'fa' || this.locale === 'he' ||
this.locale === 'ur' || this.locale === 'yi' || this.locale === 'ku'
},
checkForUpdates: function () {
return this.$store.getters.getCheckForUpdates
Expand Down Expand Up @@ -509,6 +510,11 @@ export default defineComponent({

setLocale: function() {
document.documentElement.setAttribute('lang', this.locale)
if (this.isLocaleRightToLeft) {
document.body.dir = 'rtl'
} else {
document.body.dir = 'ltr'
}
},

/**
Expand Down
2 changes: 1 addition & 1 deletion src/renderer/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
id="app"
:class="{
hideOutlines: hideOutlines,
rightAligned: isRightAligned
isLocaleRightToLeft: isLocaleRightToLeft
}"
>
<top-nav ref="topNav" />
Expand Down
6 changes: 3 additions & 3 deletions src/renderer/components/channel-about/channel-about.css
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
.about {
background-color: var(--card-bg-color);
margin-top: 0;
margin-block-start: 0;
padding: 10px;
position: relative;
z-index: 1;
Expand Down Expand Up @@ -34,9 +34,9 @@
}

.aboutDetails {
text-align: left;
text-align: start;
}

.aboutDetails th {
padding-right: 10px;
padding-inline-end: 10px;
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
.experimental-warning {
text-align: center;
font-weight: bold;
padding-left: 4%;
padding-right: 4%
padding-inline-start: 4%;
padding-inline-end: 4%
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@

h2 {
background-color: var(--card-bg-color);
padding: 10px 0;
padding-block: 10px;
padding-inline: 0;
text-align: center;
width: 100%;
}
Expand All @@ -12,7 +13,8 @@
background-color: var(--card-bg-color);
font-size: 10em;
height: 100%;
padding: 20px 0;
padding-block: 20px;
padding-inline: 0;
text-align: center;
width: 100%;
}
Expand Down
7 changes: 4 additions & 3 deletions src/renderer/components/ft-button/ft-button.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
font-family: 'Roboto', sans-serif;
min-width: 100px;
font-size: 0.9rem;
padding: 10px 20px;
padding-block: 10px;
padding-inline: 20px;
box-sizing: border-box;
cursor: pointer;
display: inline-block;
Expand Down Expand Up @@ -36,8 +37,8 @@
position: absolute;
width: 100%;
height: 100%;
top: 0;
left: 0;
inset-block-start: 0;
inset-inline-start: 0;
pointer-events: none;
background-image: radial-gradient(circle, #fff 10%, transparent 10.01%);
background-repeat: no-repeat;
Expand Down
5 changes: 2 additions & 3 deletions src/renderer/components/ft-card/ft-card.css
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
.ft-card {
background-color: var(--card-bg-color);
margin: 8px;
padding: 16px;
padding-top: 3px;
padding-bottom: 16px;
padding-block: 3px 16px;
padding-inline: 16px;
box-shadow: 0 1px 2px rgba(0,0,0,.1);
}
Original file line number Diff line number Diff line change
Expand Up @@ -32,16 +32,16 @@

.selected {
position: absolute;
top: 10px;
inset-block-start: 10px;
background-color: rgba(0, 0, 0, 0.5);
}

.icon {
color: #EEEEEE;
font-size: 25px;
position: absolute;
top: 12px;
left: 12px;
inset-block-start: 12px;
inset-inline-start: 12px;
}

.channelName {
Expand Down
21 changes: 11 additions & 10 deletions src/renderer/components/ft-community-poll/ft-community-poll.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.vote-count {
padding-bottom: 6px;
padding-block-end: 6px;
font-size: smaller;
}

Expand All @@ -9,21 +9,21 @@
border-style: solid;
border-width: 2px;
display: block;
float: left;
float: var(--float-left-ltr-rtl-value);
height: 10px;
left: 5px;
inset-inline-start: 5px;
position: relative;
top: 8px;
inset-block-start: 8px;
width: 10px;
}

.filled-circle {
border-radius: 50%;
background-color: black;
float: left;
float: var(--float-left-ltr-rtl-value);
height: 6px;
left: 2px;
top: 2px;
inset-inline-start: 2px;
inset-block-start: 2px;
position: relative;
width: 6px;
}
Expand All @@ -32,11 +32,12 @@
border-radius: 5px;
border-style: solid;
border-width: 2px;
padding: 5px 25px;
padding-block: 5px;
padding-inline: 25px;
}

.option {
padding-bottom: 10px;
padding-block-end: 10px;
}

.correct-option {
Expand Down
32 changes: 17 additions & 15 deletions src/renderer/components/ft-community-post/ft-community-post.scss
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
-webkit-border-radius: 50%;
border-radius: 50%;
height: 55px;
margin-right: 5px;
margin-inline-end: 5px;
width: 55px;
}

Expand All @@ -32,12 +32,14 @@
.authorName {
font-size: 15px;
font-weight: bold;
margin: 5px 6px 0 5px;
margin-block: 5px 0;
margin-inline: 5px 6px;
}

.publishedText {
font-size: 15px;
margin: 5px 6px 0 5px;
margin-block: 5px 0;
margin-inline: 5px 6px;
}
}

Expand All @@ -51,24 +53,24 @@
display: block;
flex-direction: column;
font-size: 15px;
margin-top: 4px;
margin-block-start: 4px;
max-width: 210px;
text-align: left;
text-align: start;

@media screen and (max-width: 680px) {
margin-left: 0;
text-align: left;
margin-inline-start: 0;
text-align: start;
}

.likeBar {
border-radius: 4px;
height: 8px;
margin-bottom: 4px;
margin-block-end: 4px;
}

.likeCount {
margin-left: 5px;
margin-right: 6px;
margin-inline-start: 5px;
margin-inline-end: 6px;
}
}

Expand All @@ -77,8 +79,8 @@

.videoThumbnail {
display: flex;
margin-bottom: auto;
margin-top: auto;
margin-block-end: auto;
margin-block-start: auto;
position: relative;
width: fit-content;

Expand All @@ -91,7 +93,7 @@
}

.playlistText {
margin-left: 10px;
margin-inline-start: 10px;
width: 50%;
word-wrap: break-word;

Expand All @@ -111,7 +113,7 @@
color: var(--primary-text-color);
display: flex;
font-size: small;
padding-top: 10px;
padding-block-start: 10px;
text-decoration-line: none;
width: 100%;
}
Expand All @@ -128,5 +130,5 @@

.ft-list-item.grid {
min-height: 0 !important;
padding-bottom: 20px;
padding-block-end: 20px;
}
16 changes: 9 additions & 7 deletions src/renderer/components/ft-icon-button/ft-icon-button.scss
Original file line number Diff line number Diff line change
Expand Up @@ -95,19 +95,19 @@
z-index: 3;

&.left {
right: calc(50% - 10px);
inset-inline-end: calc(50% - 10px);
}

&.right {
left: calc(50% - 10px);
inset-inline-start: calc(50% - 10px);
}

&.top {
bottom: 45px;
inset-block-end: 45px;
}

&.bottom {
top: 45px;
inset-block-start: 45px;
}

.list {
Expand All @@ -119,7 +119,8 @@
.listItem {
cursor: pointer;
margin: 0;
padding: 8px 10px;
padding-block: 8px;
padding-inline: 10px;
transition: background 0.2s ease-out;
white-space: nowrap;

Expand All @@ -138,8 +139,9 @@
}

.listItemDivider {
border-top: 1px solid var(--tertiary-text-color);
margin: 1px auto;
border-block-start: 1px solid var(--tertiary-text-color);
margin-block: 1px;
margin-inline: auto;
// Too "visible" with current color
opacity: 0.5;
width: 95%;
Expand Down
9 changes: 4 additions & 5 deletions src/renderer/components/ft-input-tags/ft-input-tags.css
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,12 @@
margin: 5px;
border-radius: 5px;
display:flex;
float: left;
float: var(--float-left-ltr-rtl-value);
}

.ft-tag-box li>span {
padding-top: 10px;
padding-bottom: 10px;
padding-left: 10px;
padding-block: 10px;
padding-inline-start: 10px;
overflow-wrap: break-word;
word-wrap: break-word;
word-break: break-all;
Expand All @@ -45,7 +44,7 @@
}

:deep(.ft-input-component .ft-input) {
margin-top: 10px;
margin-block-start: 10px;
}

@media only screen and (max-width: 576px) {
Expand Down
Loading