Skip to content

Commit

Permalink
menu: update the language menu entry
Browse files Browse the repository at this point in the history
In the menu of the public interface, it exists a 'menu' entry. This
entry list all available languages for the application. This commit
renamed the entry menu using the current language and change the icon
linked to this menu entry

Closes #1466

Co-Authored-by: Renaud Michotte <renaud.michotte@gmail.com>
  • Loading branch information
zannkukai committed Nov 26, 2020
1 parent 0be508a commit 7ae6124
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions rero_ils/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,16 +148,17 @@ def init_menu_tools():
def init_menu_lang():
"""Create the header language menu."""
item = current_menu.submenu('main.menu')
ui_language = 'ui_language_{lang}'.format(lang=current_i18n.language)
# Bug: when you reload the page with register(**kwargs), it failed
# We so check that 'id' already exists. If yes, do not create again
# the item.
rero_register(
item,
endpoint=None,
text='{icon} <span class="{visible}">{menu}'.format(
icon='<i class="fa fa-bars"></i>',
icon='<i class="fa fa-language"></i>',
visible='visible-md-inline visible-lg-inline',
menu=_('Menu')
menu=_(ui_language)
),
order=0,
id='language-menu'
Expand Down

0 comments on commit 7ae6124

Please sign in to comment.