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

Modal dropdown menue #1554

Open
danian3wa opened this issue Jan 6, 2025 · 5 comments
Open

Modal dropdown menue #1554

danian3wa opened this issue Jan 6, 2025 · 5 comments

Comments

@danian3wa
Copy link

Hi to everyone,

I translated my project with the same method as this demo project and I can't get the dropdown and modal to choose the language. I think it's because of the assets, the way I installed them in my project. The paths with the translated pages work. Whenever I go to /en or /fr, English and français appear in the "Choose your language" section of the menu. What packages do I need to install to make the dropdown, modal, ... work? Can someone help me with this. Here is the code generated by Symfony regarding the dropdown:

  • --   |   |   | English   |   | menu.choose_language   |   |     |
      |
      |
      |
      |

      | Choose your language   |

      |   | ×   |   |
      |     |
      |   |
      |
      |
      |
      |     |
  • English menu.choose_language
    <div id="locale-selector-modal" class="modal" tabindex="-1" aria-hidden="true">
        <div class="modal-lg modal-dialog modal-dialog-centered">
            <div class="modal-content">
                <div class="modal-header">
                    <p class="modal-title" lang="en">
                                                Choose your language
                    </p>
                    <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                        <span aria-hidden="true">&times;</span>
                    </button>
                </div>
    
                <div class="modal-body">
                    <ul class="locales">
                                                                                                            <li class="active " translate="no">
                                <a class="stretched-link" lang="en" hreflang="en" href="[/en/home](https://127.0.0.1:8000/en/home)">
                                    English
                                    <small>en</small>
                                </a>
                            </li>
                                                                                                            <li class=" " translate="no">
                                <a class="stretched-link" lang="fr" hreflang="fr" href="[/fr/home](https://127.0.0.1:8000/fr/home)">
                                    Français
                                    <small>fr</small>
                                </a>
                            </li>
                                                                                                    
                                            </ul>
                </div>
            </div>
        </div>
    </div>
    
                </li>
    
  • @alexmerlin
    Copy link

    Define "make the dropdown, modal, ... work".

    1. The modal does not open on clicking the language selector?
    2. The current language is not selected?
    3. The language selector does nothing when clicking a language?

    Based on the generated HTML and assuming that the assets were copied/loaded correctly, everything seems to be in place for it to work.

    @danian3wa
    Copy link
    Author

    danian3wa commented Jan 6, 2025 via email

    @danian3wa
    Copy link
    Author

    danian3wa commented Jan 7, 2025

    @alexmerlin

    I tried to use the Symfony Demo project as a translation template for another project. I managed to make it work partially in the sense that the pages are translated but the language selection button does not open the modal with the languages. In the code inspector I can see the links with the translation languages ​​for each page on all pages. Is there any documentation to implement the same translation system because I failed to integrate my project into the Symfony Demo project, so I tried to insert the translation from the Symfony Demo project into my project.
    Thank you in advance for your time. Kind regards,

    @alexmerlin
    Copy link

    Is there any documentation to implement the same translation system

    Have you tried with the official translation docs?

    @danian3wa
    Copy link
    Author

    danian3wa commented Jan 8, 2025 via email

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

    No branches or pull requests

    2 participants