Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for multiple locales. #64

Open
neskk opened this issue Nov 8, 2019 · 0 comments
Open

Add support for multiple locales. #64

neskk opened this issue Nov 8, 2019 · 0 comments

Comments

@neskk
Copy link
Contributor

neskk commented Nov 8, 2019

First of all, thank you for your awesome work ;)

I followed the guide on active admin wiki to add a language selection to the utility menu as in https://github.com/activeadmin/activeadmin/wiki/Switching-locale. The problem is that, using this theme it seems nested menus are broken.

initializers/active_admin.rb:

  config.namespace :admin do |admin|
    admin.build_menu :utility_navigation do |menu|
      menu.add label: "Languages" do |lang|
        lang.add label: "English", url: proc { url_for(locale: 'en') }, id: 'i18n-en', priority: 1
        lang.add label: "Português", url: proc { url_for(locale: 'pt') }, id: 'i18n-pt', priority: 2
      end

      admin.add_current_user_to_menu menu
      admin.add_logout_button_to_menu menu
    end
  end

resulting html:

          <li class="menu_item has_nested" id="languages">
            <a href="#">Languages</a>
            <ul class="menu">
              <li class="menu_item" id="i18n-en">
                <a href="/en/admin">English</a>
              </li>
              <li class="menu_item" id="i18n-pt">
                <a href="/pt/admin">Português</a>
              </li>
            </ul>
          </li>

Everything is "functional" but visually the menu isn't a drop-down:
image

When in view-ports with small resolution this also happens:
image

Would be great if you added some option to deal with this menus/submenus. E.g. include a helper that lets you choose the icon for the menu and fixes the markup to allow the drop-down menu to work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants