Skip to content

Commit adccd44

Browse files
committed
Fix rtl UI
1 parent e4347ee commit adccd44

File tree

12 files changed

+96
-15
lines changed

12 files changed

+96
-15
lines changed

webapp/app/locales/en-us.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,8 @@
202202
"reviewed": "reviewed",
203203
"activities_title": "Latest activities",
204204
"item": {
205+
"rtl_badge": "RTL",
206+
"rtl": "Right to left text",
205207
"correct_all_button": "Mark all strings as reviewed",
206208
"uncorrect_all_button": "Put all strings back in review"
207209
}

webapp/app/locales/fr-ca.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,8 @@
218218
"reviewed": "revu",
219219
"activities_title": "Dernières activités",
220220
"item": {
221+
"rtl_badge": "RTL",
222+
"rtl": "Texte de droite à gauche",
221223
"correct_all_button": "Marquer toutes les chaînes comme vérifiées",
222224
"uncorrect_all_button": "Remettre toutes les chaînes à réviser"
223225
}

webapp/app/pods/components/conflicts-list/item/styles.scss

Lines changed: 29 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,30 @@
3131
.item-details {
3232
display: flex;
3333
flex-direction: column;
34+
35+
&[data-dir='rtl'] {
36+
.item-details__column {
37+
align-items: flex-end;
38+
}
39+
.item-details__column:first-of-type {
40+
margin-right: 0;
41+
margin-left: 15px;
42+
}
43+
44+
.item-key {
45+
margin-right: 0;
46+
margin-left: 15px;
47+
flex-direction: row-reverse;
48+
}
49+
50+
.item-key-prefix::before {
51+
content: '';
52+
}
53+
54+
.item-key-prefix::after {
55+
content: '/';
56+
}
57+
}
3458
}
3559

3660
.item-details__column {
@@ -154,21 +178,21 @@
154178
}
155179

156180
.item-key-prefix {
157-
display: block;
181+
display: inline-flex;
158182
font-size: 11px;
159183
color: #959595;
184+
gap: 6px;
160185
font-weight: 300;
161186

162187
&::before {
163188
content: '/';
164-
margin-right: -5px;
165189
}
166190
}
167191

168192
.item-key {
169193
display: flex;
170194
align-items: center;
171-
gap: 3px;
195+
gap: 5px;
172196
margin-bottom: 12px;
173197
font-family: var(--font-monospace);
174198
word-break: break-all;
@@ -214,8 +238,8 @@
214238
justify-content: flex-end;
215239
position: absolute;
216240
gap: 10px;
217-
top: 7px;
218-
right: 7px;
241+
top: 10px;
242+
right: 10px;
219243
z-index: 3;
220244

221245
&[data-dir='rtl'] {

webapp/app/pods/components/conflicts-list/item/template.hbs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
</div>
2626
</div>
2727
{{else}}
28-
<div local-class='item-details'>
28+
<div local-class='item-details' data-dir={{if this.revisionTextDirRtl 'rtl'}}>
2929
<div local-class='item-details__column'>
3030
<LinkTo @route='logged-in.project.translation' @models={{array @project.id @conflict.id}} local-class='key'>
3131
<strong local-class='item-key'>

webapp/app/pods/components/dashboard-revisions/item/component.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,10 @@ export default class DashboardRevisionsItem extends Component<Args> {
6868
return this.args.revision.name || this.args.revision.language.name;
6969
}
7070

71+
get rtl() {
72+
return this.args.revision.rtl || this.args.revision.language.rtl;
73+
}
74+
7175
@action
7276
toggleShowActions() {
7377
this.showActions = !this.showActions;

webapp/app/pods/components/dashboard-revisions/item/template.hbs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,11 @@
1212
{{#if (get @permissions 'index_translations')}}
1313
<LinkTo @route='logged-in.project.revision.translations' @models={{array @project.id @revision.id}} local-class='language-name'>
1414
{{this.languageName}}
15+
{{#if this.rtl}}
16+
<AccBadge class='tooltip tooltip--top' title={{t 'components.dashboard_revisions.item.rtl'}}>
17+
{{t 'components.dashboard_revisions.item.rtl_badge'}}
18+
</AccBadge>
19+
{{/if}}
1520
<span local-class='language-reviewedPercentage'>
1621
{{this.correctedKeysPercentage}}
1722
%
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<LinkTo @route='logged-in.project.files.new-machine-translations' @model={{@project.id}} local-class='button' class='button button--borderLess button--filled button--white'>
1+
<LinkTo @route='logged-in.project.files.new-machine-translations' @model={{@project.id}} local-class='button' class='button button--borderLess button--filled button--grey'>
22
{{inline-svg '/assets/language.svg' class='button-icon'}}
33
{{t 'components.documents_machine_translations_button.link'}}
44
</LinkTo>

webapp/app/pods/components/related-translations-list/item/styles.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@
8181
right: 14px;
8282

8383
&[data-dir='rtl'] {
84+
flex-direction: row-reverse;
8485
right: auto;
8586
left: 14px;
8687
}

webapp/app/pods/components/translations-list/item/styles.scss

Lines changed: 45 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,37 @@
77
border: 1px solid transparent;
88
border-radius: var(--border-radius);
99

10+
&[data-dir='rtl'] {
11+
.item-header {
12+
flex-direction: row-reverse;
13+
14+
.item-edit-wrapper {
15+
flex-direction: row-reverse;
16+
}
17+
18+
.item-meta {
19+
flex-direction: row-reverse;
20+
margin-right: 10px;
21+
}
22+
23+
.item-updatedAt {
24+
margin-left: 0;
25+
margin-right: 10px;
26+
}
27+
28+
.item-key {
29+
flex-direction: row-reverse;
30+
}
31+
32+
.item-key-prefix::before {
33+
content: '';
34+
}
35+
.item-key-prefix::after {
36+
content: '/';
37+
}
38+
}
39+
}
40+
1041
&:focus,
1142
&:hover {
1243
background: var(--background-light);
@@ -16,6 +47,12 @@
1647
opacity: 1;
1748
}
1849

50+
&[data-dir='rtl'] {
51+
.item-edit {
52+
transform: translateX(40px);
53+
}
54+
}
55+
1956
.item-edit {
2057
transform: translateX(-40px);
2158
opacity: 1;
@@ -55,6 +92,10 @@
5592
}
5693
}
5794

95+
.item-edit-wrapper {
96+
display: flex;
97+
}
98+
5899
.item-header {
59100
position: relative;
60101
display: flex;
@@ -89,25 +130,24 @@
89130
}
90131

91132
.item-key-prefix {
92-
display: block;
133+
display: inline-flex;
134+
gap: 5px;
93135
font-size: 11px;
94136
color: #959595;
95137
flex-shrink: 0;
96138
font-weight: 300;
97139

98140
&::before {
99141
content: '/';
100-
margin-right: -5px;
101142
}
102143
}
103144

104145
.item-key {
105146
display: flex;
106147
align-items: center;
107-
gap: 2px;
148+
gap: 5px;
108149
transition: 0.2s ease-in-out;
109150
transition-property: color;
110-
margin-right: 10px;
111151
color: var(--color-primary);
112152
line-height: 1.5;
113153
word-break: break-all;
@@ -197,6 +237,7 @@
197237
&[data-dir='rtl'] {
198238
right: auto;
199239
left: 14px;
240+
flex-direction: row-reverse;
200241
}
201242
}
202243

webapp/app/pods/components/translations-list/item/template.hbs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
<li local-class='translations-list-item {{if this.isInEditMode "item--editMode"}}'>
2-
<span local-class='item-header'>
3-
<span>
1+
<li local-class='translations-list-item {{if this.isInEditMode "item--editMode"}}' data-dir={{if this.revisionTextDirRtl 'rtl'}}>
2+
<span local-class='item-header' data-dir={{if this.revisionTextDirRtl 'rtl'}}>
3+
<span local-class='item-edit-wrapper'>
44
<span local-class='item-edit'>
55
<span role='button' {{on 'click' (fn this.toggleEdit)}}>
66
{{#if this.isInEditMode}}

webapp/app/queries/project-dashboard.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,9 +134,11 @@ export default gql`
134134
translationsCount
135135
isMaster
136136
name
137+
rtl
137138
language {
138139
id
139140
name
141+
rtl
140142
}
141143
}
142144

webapp/app/styles/html-components/button.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@
236236
}
237237

238238
.button--grey {
239-
color: #8a8a8a;
239+
color: #000;
240240
border-color: var(--background-light);
241241

242242
&.button--loading svg.loading {

0 commit comments

Comments
 (0)