"TODO" comment added
Multilanguage support for legend button
This commit is contained in:
parent
dc660de57f
commit
c3f700977a
@ -274,6 +274,28 @@ default_ciclopi_messages = {
|
|||||||
'back_to_stations': {
|
'back_to_stations': {
|
||||||
'en': "Back to stations",
|
'en': "Back to stations",
|
||||||
'it': "Torna alle stazioni"
|
'it': "Torna alle stazioni"
|
||||||
|
},
|
||||||
|
'legend': {
|
||||||
|
'name': {
|
||||||
|
'en': "Station name",
|
||||||
|
'it': "Nome della stazione",
|
||||||
|
},
|
||||||
|
'distance': {
|
||||||
|
'en': "Distance in meters",
|
||||||
|
'it': "Distanza in m",
|
||||||
|
},
|
||||||
|
'description': {
|
||||||
|
'en': "Station address",
|
||||||
|
'it': "Indirizzo della stazione",
|
||||||
|
},
|
||||||
|
'bikes': {
|
||||||
|
'en': "Available bikes",
|
||||||
|
'it': "Bici disponibili",
|
||||||
|
},
|
||||||
|
'free': {
|
||||||
|
'en': "Free parking stalls",
|
||||||
|
'it': "Posti liberi",
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1163,6 +1185,8 @@ async def _ciclopi_button_main(bot, update, user_record, arguments):
|
|||||||
)
|
)
|
||||||
return result, text, reply_markup
|
return result, text, reply_markup
|
||||||
|
|
||||||
|
# TODO: Multilanguage support from this line
|
||||||
|
|
||||||
|
|
||||||
async def _ciclopi_button_sort(bot, update, user_record, arguments):
|
async def _ciclopi_button_sort(bot, update, user_record, arguments):
|
||||||
result, text, reply_markup = '', '', None
|
result, text, reply_markup = '', '', None
|
||||||
@ -1353,15 +1377,15 @@ async def _ciclopi_button_legend(bot, update, user_record, arguments):
|
|||||||
"<code> </code>🚲 {s[bikes]} | 🅿️ {s[free]} | 📍 {s[distance]}"
|
"<code> </code>🚲 {s[bikes]} | 🅿️ {s[free]} | 📍 {s[distance]}"
|
||||||
).format(
|
).format(
|
||||||
s={
|
s={
|
||||||
'name': "Nome della stazione",
|
key: bot.get_message(
|
||||||
'distance': "Distanza in m",
|
'ciclopi', 'button', 'legend', key,
|
||||||
'description': "Indirizzo della stazione",
|
update=update, user_record=user_record
|
||||||
'bikes': "Bici disponibili",
|
)
|
||||||
'free': "Posti liberi"
|
for key in ('name', 'distance', 'description', 'bikes', 'free')
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
reply_markup = make_inline_keyboard(
|
reply_markup = make_inline_keyboard(
|
||||||
+ get_menu_back_buttons(
|
get_menu_back_buttons(
|
||||||
bot=bot, update=update, user_record=user_record,
|
bot=bot, update=update, user_record=user_record,
|
||||||
include_back_to_settings=True
|
include_back_to_settings=True
|
||||||
)
|
)
|
||||||
@ -1680,18 +1704,10 @@ async def _ciclopi_button_favorites(bot, update, user_record, arguments):
|
|||||||
)
|
)
|
||||||
]
|
]
|
||||||
] + [
|
] + [
|
||||||
[
|
get_menu_back_buttons(
|
||||||
make_button(
|
bot=bot, update=update, user_record=user_record,
|
||||||
text="⚙️ Torna alle impostazioni",
|
include_back_to_settings=True
|
||||||
prefix='ciclopi:///',
|
)
|
||||||
data=['main']
|
|
||||||
),
|
|
||||||
make_button(
|
|
||||||
text="🚲 Torna alle stazioni",
|
|
||||||
prefix='ciclopi:///',
|
|
||||||
data=['show']
|
|
||||||
)
|
|
||||||
]
|
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
return result, text, reply_markup
|
return result, text, reply_markup
|
||||||
|
Loading…
x
Reference in New Issue
Block a user