Skip to content

Commit

Permalink
RTL languages video transcripts handling and element positioning corr…
Browse files Browse the repository at this point in the history
…ected
  • Loading branch information
LianaHarris360 committed Jan 6, 2023
1 parent ca39e6d commit 645e5bb
Show file tree
Hide file tree
Showing 9 changed files with 39 additions and 29 deletions.
6 changes: 4 additions & 2 deletions kolibri/core/assets/src/views/AppBar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -357,8 +357,11 @@
position: fixed;
right: 8px;
z-index: 8;
[dir='rtl'] & {
right: auto;
left: 8px;
}
}
.role {
margin-bottom: 8px;
font-size: small;
Expand All @@ -385,7 +388,6 @@
/deep/ .ui-toolbar__title {
margin-right: 10px;
}
.brand-logo {
max-width: 48px;
max-height: 48px;
Expand Down
6 changes: 6 additions & 0 deletions kolibri/core/assets/src/views/CoreMenu/CoreMenuOption.vue
Original file line number Diff line number Diff line change
Expand Up @@ -115,4 +115,10 @@
}
}
.core-menu-option /deep/ .icon {
[dir='rtl'] & {
left: auto;
}
}
</style>
1 change: 1 addition & 0 deletions kolibri/core/assets/src/views/SideNav.vue
Original file line number Diff line number Diff line change
Expand Up @@ -328,6 +328,7 @@
position: fixed;
top: 0;
bottom: 0;
left: 0;
z-index: 16;
}
Expand Down
2 changes: 1 addition & 1 deletion kolibri/core/kolibri_plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ def language_globals(self):
"english_name": lang_info["english_name"]
if lang_info
else get_language_info(code)["name"],
"lang_direction": get_language_info(code)["bidi"],
"lang_direction": "rtl" if get_language_info(code)["bidi"] else "ltr",
}
return {
"coreLanguageMessages": self.frontend_messages(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,10 @@
.message {
display: inline-block;
margin: 0 16px;
margin-right: 16px;
[dir='rtl'] & {
margin: 0 16px;
}
}
</style>
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
/>
</td>

<td class="title" :class="isRTL">
<td class="title">
<KLabeledIcon>
<template #icon>
<ContentIcon :kind="node.kind" />
Expand Down Expand Up @@ -99,9 +99,6 @@
importing() {
return this.node.updated_resource && !this.node.available;
},
isRTL() {
return document.getElementsByTagName('html')[0].getAttribute('dir') === 'rtl' ? 'rtl' : {};
},
},
};
Expand Down Expand Up @@ -129,8 +126,10 @@
margin-left: 24px;
}
/deep/ .title.rtl .icon {
left: auto;
.title /deep/ .icon {
[dir='rtl'] & {
left: auto;
}
}
</style>
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,10 @@
.message {
display: inline-block;
margin: 0 16px;
margin-right: 16px;
[dir='rtl'] & {
margin: 0 16px;
}
}
</style>
28 changes: 13 additions & 15 deletions kolibri/plugins/learn/assets/src/views/LearningActivityBar.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<template>

<UiToolbar style="z-index: 8;" :style="contentSpecificStyles" class="toolbar" :class="isRTL">
<UiToolbar style="z-index: 8;" :style="contentSpecificStyles" class="toolbar">
<CoachContentLabel
:value="isCoachContent"
style="margin-top: 8px; width: auto;"
Expand Down Expand Up @@ -293,9 +293,6 @@
return {};
}
},
isRTL() {
return document.getElementsByTagName('html')[0].getAttribute('dir') === 'rtl' ? 'rtl' : {};
},
},
created() {
window.addEventListener('click', this.onWindowClick);
Expand Down Expand Up @@ -394,14 +391,14 @@
}
/*
Make truncation via text ellipsis work well in UIToolbar's body flex item:
By default, `min-width` is `auto` for a flex item which means it
cannot be smaller than the size of its content which causes the whole
title being visible even in cases when it should be already truncated.
Overriding it to `0` allows the title to be shrinked and then truncated
properly. Labeled icon wrapper needs to have this set too for its parent
flex item to shrink.
*/
Make truncation via text ellipsis work well in UIToolbar's body flex item:
By default, `min-width` is `auto` for a flex item which means it
cannot be smaller than the size of its content which causes the whole
title being visible even in cases when it should be already truncated.
Overriding it to `0` allows the title to be shrinked and then truncated
properly. Labeled icon wrapper needs to have this set too for its parent
flex item to shrink.
*/
/deep/ .ui-toolbar__body,
/deep/ .labeled-icon-wrapper {
min-width: 0;
Expand All @@ -421,9 +418,10 @@
height: 18px;
}
}
/deep/ .toolbar.rtl .icon {
right: 0.625rem;
.toolbar /deep/ .icon {
[dir='rtl'] & {
right: 0.625rem;
}
}
@media (prefers-reduced-motion: reduce) {
Expand Down
4 changes: 1 addition & 3 deletions kolibri/plugins/learn/assets/src/views/LibraryPage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -379,9 +379,7 @@
return this.searchTerms.categories;
},
gridOffset() {
return this.isRtl
? { marginRight: `${this.sidePanelWidth + 24}px` }
: { marginLeft: `${this.sidePanelWidth + 24}px` };
return { marginLeft: `${this.sidePanelWidth + 24}px` };
},
},
watch: {
Expand Down

0 comments on commit 645e5bb

Please sign in to comment.