Support » Plugin: MultilingualPress » Where is the language switching widget?

  • Resolved brettalton

    (@brettalton)


    Hi there,

    I was able to get my website up and running with two languages (after a few problems that I’d like to document elsewhere, including an issue with the .htaccess), but it’s up and running and a beautiful solution so far.

    My problem is the front end. I saw on this page,

    https://en-ca.wordpress.org/plugins/multilingual-press/

    that the plugin included,

    Show a list of links for all translations on each page in a flexible widget.

    The problem is, I don’t see how/where to activate this widget. My handmade theme only supports widgets I make, so I don’t know where or how this widget becomes available.

    I searched for dynamic_sidebar and register_sidebar but to no avail. Can you direct me to how this function may work?

    As a follow up, is it possible to link an English page with a French page, so that if there is a redirect, they can stay on the same page they were viewing? Thanks.

    • This topic was modified 2 years, 2 months ago by  brettalton.

    The page I need help with: [log in to see the link]

Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Contributor Thorsten Frommen

    (@tfrommen)

    Hi there,

    well, the widget is called Language Switcher, and it is a regular widget, to be found under Appearance -> Widgets.

    Please see this for more information (navigate with SPACE and SHIFT+SPACE).

    Regarding the pages, yes, sure. You can link standard posts, pages, and also custom posts.

    See this for more information. It works just the same for pages.

    I hope this helps.

    Have a nice day/weekend,
    Thorsten

    Can you post those slides as a part of your documentation for the plugin? It’s so hard to find documentation and “what to do” after you install it.

    And now, what about modifying the widget? Where can we do that? Like if I want the languages in a dropdown menu, how can I achieve that?

    Thanks so much for your help!

    • This reply was modified 2 years, 2 months ago by  brettalton.
    Plugin Contributor Thorsten Frommen

    (@tfrommen)

    Hi,

    we will include almost everything included in the slides in our future documentation, yes.

    As you might have seen, you can configure the widget, just like any other one, on the Widgets page in your WordPress back end.

    Regarding the modifying, you cannot really do this, sorry.
    What you could do is hook into a filter, mlp_linked_elements_html, and regenerate the HTML from scratch, according to your needs. Have a look at the current implementation to see how to do it.

    Have a nice week!
    Thorsten

    Configuring won’t do because we simply want links that act in the manner: “EN | FR”. I’ll have to custom make it myself. How do I write a hook to mlp_linked_elements_html in order to achieve this? I can obviously edit Mlp_Helpers.php but it would be overwritten on a plugin update.

    Sorry for continually bothering, just not sure how to extend the functionality!

    Plugin Contributor Thorsten Frommen

    (@tfrommen)

    Hey there,

    no need to be sorry for bothering. That’s what these forums are there for in the first place! 😉

    However, I think the widget already provides what you want to have.
    Configure the widget like so:

    • Link text: Language code (short)
    • Show flag: No
    • Show current site: Yes
    • Show links for translated content only: Yes

    -> Image

    This gives a list of plain text links, for example: en es it fr

    -> Image

    Now, you have to style it according to your needs.
    First step is to make the links uppercase:

    .mlp-language-box li {
    	margin: 0;
    	text-transform: uppercase;
    }

    Next step is to take care of the separator. I don’t know exactly how you would want it to be, but here is one example:

    .mlp-language-box * + li:before {
    	content: '|';
    	margin: 0 .5em;
    }

    -> Image

    Hope that helps.

    Cheers,
    Thorsten

    This worked incredibly well. Thank you so much! Might I advise to add something like this to your documentation when you launch? Otherwise, I’m so grateful for your plugin and your help, thank you!

    Plugin Contributor Thorsten Frommen

    (@tfrommen)

    You’re welcome. 🙂

    Not sure if this can be useful for a lot of people, but yes, we could add this as an example for styling the widget output.

    Cheers,
    Thorsten

    Hi Thorsten,

    thats exact the same that I am searching but instead of text I want to see only the flags. I try to configure the widget with flag but the flags are not side by side (as the text) rather than among themselves.

    E.g. [GermanFlag] | [EnglishFlag]

    Can you help?

    Best regards

    Plugin Contributor Thorsten Frommen

    (@tfrommen)

    Hey,

    I’m not sure I am following.

    When I set up the widget with no text, but flags, I get what you described.
    -> https://imgur.com/a/kzT2r
    -> https://imgur.com/a/yKOZA

    If this is different for you, then I guess your menu CSS is different, for example, block list items…?

    Anyway, I assume this is a CSS-related issue, and not specific to MultilingualPress.

    Is the site live so I can see it?

    Cheers,
    Thorsten

    PS: next time, please start a new topic, and link to any related ones. Thanks.

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Where is the language switching widget?’ is closed to new replies.