{"action":"created","issue":{"url":"https://api.github.com/repos/stephenmcd/mezzanine/issues/1669","repository_url":"https://api.github.com/repos/stephenmcd/mezzanine","labels_url":"https://api.github.com/repos/stephenmcd/mezzanine/issues/1669/labels{/name}","comments_url":"https://api.github.com/repos/stephenmcd/mezzanine/issues/1669/comments","events_url":"https://api.github.com/repos/stephenmcd/mezzanine/issues/1669/events","html_url":"https://github.com/stephenmcd/mezzanine/issues/1669","id":175471582,"number":1669,"title":"Language switcher in the admin site is not displayed","user":{"login":"mrtnkiss","id":4548334,"avatar_url":"https://avatars.githubusercontent.com/u/4548334?v=3","gravatar_id":"","url":"https://api.github.com/users/mrtnkiss","html_url":"https://github.com/mrtnkiss","followers_url":"https://api.github.com/users/mrtnkiss/followers","following_url":"https://api.github.com/users/mrtnkiss/following{/other_user}","gists_url":"https://api.github.com/users/mrtnkiss/gists{/gist_id}","starred_url":"https://api.github.com/users/mrtnkiss/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mrtnkiss/subscriptions","organizations_url":"https://api.github.com/users/mrtnkiss/orgs","repos_url":"https://api.github.com/users/mrtnkiss/repos","events_url":"https://api.github.com/users/mrtnkiss/events{/privacy}","received_events_url":"https://api.github.com/users/mrtnkiss/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-09-07T10:48:14Z","updated_at":"2016-09-08T00:59:53Z","closed_at":null,"body":"The language-switcher dropdown menu is not displayed in the admin site. The language switcher is present at the login form.\r\n\r\nI have a working project and I created a dummy project using default settings in order to reproduce it and found that both setups have the same results.\r\n\r\nVersions:\r\n\r\n- Python 2.7.11 64-bit, Windows 7\r\n- Django 1.8.3, Mezzanine 4.0.0, django-modeltranslation 0.11\r\n- Django 1.10.1, Mezzanine 4.2.0, django-modeltranslation branch master-dj110-integration which has Django 1.10 support\r\n\r\nUsing following settings:\r\n```\r\nUSE_L10N = True\r\nUSE_I18N = True\r\nUSE_MODELTRANSLATION = True\r\nLANGUAGES = (\r\n    ('hu', _('Magyar')),\r\n    ('en', _('English')),\r\n    ('de', _('Deutsch'))\r\n)\r\n```\r\n\r\n\r\nAfter digging around, I think I found the problem.\r\n\r\nIn the template core/admin/includes/dropdown_menu.html the **„LANGUAGES”** template variable is not populated, is empty, therefore failing the \r\n\r\n`{% if settings.USE_L10N and LANGUAGES|length > 1 %}`\r\n\r\ntest on line 25 (line numbers are for 4.2.0) , therefore the language switcher is not displayed. This template is loaded via the admin_dropdown_menu  template tag (core/template_tags/mezzanine_tags.py line 667). The template_vars variable inside this function is not populated with the LANGUAGES from settings.\r\n\r\nMy workaround is to add LANGUAGES to TEMPLATE_ACCESSIBLE_SETTINGS (it is not there by default), and then either \r\n\r\n- replace LANGUAGES with settings.LANGUAGES in the dropdown_menu.html template or\r\n- populate template_vars explicitly in the template tag with a line added after line 686: `template_vars[\"LANGUAGES\"] = context[\"settings\"][”LANGUAGES”]`\r\n\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/stephenmcd/mezzanine/issues/comments/245464629","html_url":"https://github.com/stephenmcd/mezzanine/issues/1669#issuecomment-245464629","issue_url":"https://api.github.com/repos/stephenmcd/mezzanine/issues/1669","id":245464629,"user":{"login":"stephenmcd","id":116385,"avatar_url":"https://avatars.githubusercontent.com/u/116385?v=3","gravatar_id":"","url":"https://api.github.com/users/stephenmcd","html_url":"https://github.com/stephenmcd","followers_url":"https://api.github.com/users/stephenmcd/followers","following_url":"https://api.github.com/users/stephenmcd/following{/other_user}","gists_url":"https://api.github.com/users/stephenmcd/gists{/gist_id}","starred_url":"https://api.github.com/users/stephenmcd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stephenmcd/subscriptions","organizations_url":"https://api.github.com/users/stephenmcd/orgs","repos_url":"https://api.github.com/users/stephenmcd/repos","events_url":"https://api.github.com/users/stephenmcd/events{/privacy}","received_events_url":"https://api.github.com/users/stephenmcd/received_events","type":"User","site_admin":false},"created_at":"2016-09-08T00:59:53Z","updated_at":"2016-09-08T00:59:53Z","body":"Thanks for all the detail!\r\n\r\nIt regressed in 71873e1ef11b7817d94595aaa8c96a513f4b26c4 - I have the correct fix incoming.\r\n\r\nYour workaround is perfect for anyone who can't update."}}
{"actor":{"display_login":"stephenmcd"}}