Skip to content

Commit 4768343

Browse files
committed
feature #1417 Update the design of the language selector (javiereguiluz)
This PR was squashed before being merged into the main branch. Discussion ---------- Update the design of the language selector The current header design looks a bit crowded to me, with the links so close to each other: <img width="1172" alt="" src="https://user-images.githubusercontent.com/73419/235969569-b4fa2803-a4c6-45c7-969f-c7f1373fc401.png"> This PR changes this by making the links a bit smaller and adding more space between them: <img width="1193" alt="" src="https://user-images.githubusercontent.com/73419/235969669-dd4937fc-aa7d-4626-823d-50930c25c2f2.png"> ----- The other issue is the language selector. We're very lucky to have many translations contributed by the community. But that big number is what makes the current selector a bit hard to use (the list is very long). It also has other design issues: <img width="204" alt="" src="https://user-images.githubusercontent.com/73419/235969918-020444c4-1c07-4b13-b0b7-9e0298a66964.png"> This PR proposes a completely different design. When you click on the link to select the language, you no longer see a dropdown menu. Instead, you see a full page modal window listing all available languages. For example, if you are browsing the application in Ukrainian and click on the language selector, you'll see this: <img width="1488" alt="" src="https://user-images.githubusercontent.com/73419/235970298-2e2bb0cf-b232-4a27-83e4-44959b7aecb2.png"> The new language selector was inspired by the one used in https://europa.eu pages. In addition to displaying all languages more clearly, we now respect the features of each language, like the RTL direction of Arabic. Commits ------- b2c68c9 Update the design of the language selector
2 parents f94e895 + b2c68c9 commit 4768343

20 files changed

+151
-66
lines changed

assets/app.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import './styles/app.scss';
22

3-
// loads the Bootstrap jQuery plugins
3+
// loads the Bootstrap plugins
44
import 'bootstrap/js/dist/alert';
55
import 'bootstrap/js/dist/collapse';
66
import 'bootstrap/js/dist/dropdown';

assets/styles/app.scss

Lines changed: 84 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -138,44 +138,107 @@ header {
138138
padding: 0 $navbar-toggler-padding-x;
139139
}
140140

141-
.nav-link {
142-
padding: 0 2rem;
141+
.nav-item {
142+
font-size: 18px;
143+
margin-left: 20px;
143144
}
145+
}
146+
}
147+
148+
#locale-selector-modal {
149+
background: #2c3e50;
150+
151+
.modal-dialog {
152+
@media (min-width: map-get($grid-breakpoints, 'md')) {
153+
max-width: 800px;
154+
width: 96%;
155+
}
156+
}
157+
158+
.modal-content {
159+
border: 0;
160+
}
161+
162+
.modal-header {
163+
background: #2c3e50;
164+
border-bottom: 0;
165+
color: var(--white);
166+
167+
.close { color: var(--white); opacity: 1; }
168+
}
169+
170+
.modal-body {
171+
background: #2c3e50;
144172

145173
.locales {
146-
min-width: 190px;
147-
max-height: 320px;
148-
overflow-y: scroll;
149-
150-
.dropdown-item {
151-
padding: 0.25rem 1rem;
152-
margin-bottom: 0;
153-
154-
&.active a,
155-
&.active small,
156-
&:hover a,
157-
&:hover small,
158-
a:hover {
159-
color: inherit;
174+
list-style: none;
175+
padding: 0;
176+
177+
@media (min-width: map-get($grid-breakpoints, 'md')) {
178+
display: grid;
179+
grid-template-columns: repeat(2, 1fr);
180+
grid-gap: 10px 20px;
181+
}
182+
183+
li {
184+
border-radius: 4px;
185+
margin-bottom: 10px;
186+
position: relative;
187+
188+
@media (min-width: map-get($grid-breakpoints, 'md')) {
189+
margin: 0;
190+
}
191+
192+
&.rtl a {
193+
direction: rtl;
160194
}
161195

162196
a {
197+
align-items: center;
198+
background: #fff;
199+
border-radius: 4px;
163200
color: $gray-900;
201+
display: flex;
202+
justify-content: space-between;
203+
padding: 10px 20px;
164204

165205
small {
166206
border-radius: 4px;
167207
border: 2px solid $gray-300;
168-
color: $gray-700;
169-
float: left;
170-
font-size: 12px;
208+
color: $gray-800;
209+
font-size: 14px;
210+
font-weight: bold;
171211
line-height: 1.1;
172-
margin: 2px 10px 0 0;
212+
margin-inline-start: 10px;
173213
min-width: 26px;
174-
padding: 0 3px;
214+
padding: 2px 6px;
175215
text-align: center;
176216
text-transform: uppercase;
177217
}
178218
}
219+
220+
&:hover a {
221+
outline: 3px solid #18bc9c;
222+
outline-offset: -5px;
223+
224+
small {
225+
background: #18bc9c;
226+
border-color: #18bc9c;
227+
color: #fff;
228+
}
229+
}
230+
231+
&.active a, &:hover.active a {
232+
background: #18bc9c;
233+
color: #fff;
234+
outline: none;
235+
236+
small {
237+
background: transparent;
238+
border-color: #fff;
239+
color: #fff;
240+
}
241+
}
179242
}
180243
}
181244
}

public/build/106.218afa2e.js

Lines changed: 0 additions & 2 deletions
This file was deleted.

public/build/384.abf828b0.js renamed to public/build/384.af623ff4.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

public/build/42.5aced7b3.js

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

public/build/106.350bc330.css renamed to public/build/42.76194c5a.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

public/build/630.ed629036.js

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

public/build/admin.223fd8e3.js

Lines changed: 0 additions & 1 deletion
This file was deleted.

public/build/admin.747eb0c9.js

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

public/build/app.375057e5.js

Lines changed: 0 additions & 2 deletions
This file was deleted.

public/build/app.375057e5.js.LICENSE.txt

Lines changed: 0 additions & 1 deletion
This file was deleted.

public/build/app.8d5ecae9.js

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

public/build/app.fcc22582.css renamed to public/build/app.e7ad18f4.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

public/build/entrypoints.json

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,37 +2,37 @@
22
"entrypoints": {
33
"app": {
44
"js": [
5-
"/build/runtime.c56be18b.js",
5+
"/build/runtime.5feae901.js",
66
"/build/41.64983f8e.js",
7-
"/build/106.218afa2e.js",
8-
"/build/app.375057e5.js"
7+
"/build/42.5aced7b3.js",
8+
"/build/app.8d5ecae9.js"
99
],
1010
"css": [
11-
"/build/106.350bc330.css",
12-
"/build/app.fcc22582.css"
11+
"/build/42.76194c5a.css",
12+
"/build/app.e7ad18f4.css"
1313
]
1414
},
1515
"admin": {
1616
"js": [
17-
"/build/runtime.c56be18b.js",
17+
"/build/runtime.5feae901.js",
1818
"/build/41.64983f8e.js",
19-
"/build/384.abf828b0.js",
20-
"/build/admin.223fd8e3.js"
19+
"/build/384.af623ff4.js",
20+
"/build/admin.747eb0c9.js"
2121
],
2222
"css": [
2323
"/build/admin.2b1a6c83.css"
2424
]
2525
}
2626
},
2727
"integrity": {
28-
"/build/runtime.c56be18b.js": "sha384-Cdl61iQY709LV5xk4fjbcXyComo/jpLrd2Q4lyCXTBFRFq4AqQsmJkF6DyKpj9tr",
28+
"/build/runtime.5feae901.js": "sha384-Dj9HEwBUNZIrIUOJJ4vOrf8e+X7fhJTYGYb0F/RJLrIo5qMTyh/mBApfQI4FmH8F",
2929
"/build/41.64983f8e.js": "sha384-XfOM8D6kvkEmauUMaczMxByKTBpbb9/aDqt1hPMgWDJh1X2ZQu5rIyRn3Ipx+rmn",
30-
"/build/106.218afa2e.js": "sha384-Ao8mwo0SVoI3p0GV1A2IewyXKTFVXgNmsWztk4C0hABtqxwfi7zvKxERcGbMAn36",
31-
"/build/app.375057e5.js": "sha384-wNBy8CKY6y5YBMib8aqJIfIPy03USaz6nXmDKhXOexo1gvFb6rJjgppEn/qE/Q6y",
32-
"/build/106.350bc330.css": "sha384-ieyomRvEoNUU0mGkbZBIUAu3gECtNAm7HWIop5bEhnLLnBAUmmh8vu5xzn/yKV+y",
33-
"/build/app.fcc22582.css": "sha384-+inL6St/xReqNW5U//2eQ0FudoXwgTVG4lJL1rWHiDws2H6U16612IRGzoim7tYN",
34-
"/build/384.abf828b0.js": "sha384-+TRIJU/iNpFojktRMbVDzok0yI2Sce0VAU058Q+i/zxOC0mZqeWJXqMiBevAGErV",
35-
"/build/admin.223fd8e3.js": "sha384-AbTN7LsVgw9ZtWeN1zVDTzOa7oJfWP/yi2oAN25NXGc+Dd4RXoYDGL8a+peIUqfZ",
30+
"/build/42.5aced7b3.js": "sha384-wqPte8ueaLTZwKszn5yK/iS5GuSBYNuwZtNs5G6BWGzGI17VoFv2lXNHwQbeTCWh",
31+
"/build/app.8d5ecae9.js": "sha384-2UhLzumRcZ9rIylCmaGHxKCG1IFSEarrvMs4G6qEzE0Hl0lnrNc+e9jB8gZijjaf",
32+
"/build/42.76194c5a.css": "sha384-PoA8WLGz/za3OOW7qjoDiv5f8mBVtREO35Z70PFH8PVIdu1+nWVUEetA6Q1o6DhV",
33+
"/build/app.e7ad18f4.css": "sha384-AX8sd4a5GkOjaVooLq9t+zDI/fqugWjeU5OP+fHkycws0R/G5zaM8UZ4qx32gTNi",
34+
"/build/384.af623ff4.js": "sha384-DTkf7hVvZ08YUepoH5wzP+thJm6maRzLe8KxUgIc2OajdJkoSDct0pJMEPYcEEeF",
35+
"/build/admin.747eb0c9.js": "sha384-vDe3FhM5HnWbM4nEdbmSv8AB5n/PfPJv0y0Goloka7w6jppc6di5LpKD1A252aFg",
3636
"/build/admin.2b1a6c83.css": "sha384-ikQwASTRPK0sjWtW//EXsUjqkjNxc2Yndtt0m5a/I/qE+qEoikXP5ailZKDaqtN9"
3737
}
3838
}

public/build/manifest.json

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
{
2-
"build/app.css": "/build/app.fcc22582.css",
3-
"build/app.js": "/build/app.375057e5.js",
2+
"build/app.css": "/build/app.e7ad18f4.css",
3+
"build/app.js": "/build/app.8d5ecae9.js",
44
"build/admin.css": "/build/admin.2b1a6c83.css",
5-
"build/admin.js": "/build/admin.223fd8e3.js",
6-
"build/runtime.js": "/build/runtime.c56be18b.js",
5+
"build/admin.js": "/build/admin.747eb0c9.js",
6+
"build/runtime.js": "/build/runtime.5feae901.js",
77
"build/206.b003fa5f.js": "/build/206.b003fa5f.js",
88
"build/41.64983f8e.js": "/build/41.64983f8e.js",
9-
"build/106.350bc330.css": "/build/106.350bc330.css",
10-
"build/106.218afa2e.js": "/build/106.218afa2e.js",
11-
"build/384.abf828b0.js": "/build/384.abf828b0.js",
9+
"build/42.76194c5a.css": "/build/42.76194c5a.css",
10+
"build/42.5aced7b3.js": "/build/42.5aced7b3.js",
11+
"build/630.ed629036.js": "/build/630.ed629036.js",
12+
"build/384.af623ff4.js": "/build/384.af623ff4.js",
1213
"build/images/fa-solid-900.svg": "/build/images/fa-solid-900.7a8b4f13.svg",
1314
"build/images/fa-brands-400.svg": "/build/images/fa-brands-400.2f517e09.svg",
1415
"build/fonts/lato-normal-italic.woff": "/build/fonts/lato-normal-italic.62a9c838.woff",

public/build/runtime.5feae901.js

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

public/build/runtime.c56be18b.js

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)