Support localized menu strings + improved some css for menus

This commit is contained in:
Niko 2022-02-26 02:59:04 +01:00
parent 258f69cc11
commit b0fefb4690
5 changed files with 23 additions and 1 deletions

View File

@ -28,7 +28,8 @@ app.menus = {
position: 'left',
maxwidth: 35,
items: [
{ text: 'Test', onclick: "alert('test')", fa: 'times' },
{ text: 's:nav.profile', fa: 'user',
onclick: "alert('user')" },
{ separator: true },
],
},

View File

@ -48,9 +48,21 @@ fieldset label > * {
#menu-container.left .component.button {
text-align: right !important;
}
#menu-container.left .component.button .fa {
margin-left: .5em;
}
#menu-container.right .component.button {
text-align: left !important;
}
#menu-container.right .component.button {
margin-right: .5em;
}
#menu-container .component.button > * {
vertical-align: middle;
}
#menu-container .component.button .fa {
font-size: 1.5em;
}
#menu-container #menu .button {
padding: 1em;
}

View File

@ -40,6 +40,9 @@ app.menu = {
var content = '';
for (var i = 0; i < items.length; i++) {
var item = items[i];
if (typeof item.text === 'string')
if (item.text.startsWith('s:'))
item.text = s(item.text.substr(2));
item.displayIconRight = 'none';
item.displayIconLeft = 'none';
if (item.fa !== undefined)

View File

@ -7,6 +7,9 @@ $strings = [
'nav_close' => 'Close this window',
'action_quiz' => 'Fill the quiz requested by your crush',
],
'nav' => [
'profile' => 'Profile',
],
'form' => [
'login' => 'Log in',
'email' => 'E-mail',

View File

@ -7,6 +7,9 @@ $strings = [
'nav_close' => 'Cerrar esta ventana',
'action_quiz' => 'Rellena el quiz que te ha pedido tu crush',
],
'nav' => [
'profile' => 'Perfil',
],
'form' => [
'login' => 'Iniciar sesión',
'email' => 'E-mail',