• dagrit

    (@dagrit)


    Hi,
    I’m not sure where to start, I’m researching multilanguage site possibilities in wordpress. wpml is on various sites the most praised way to achieve this, but I was wondering; isn’t it possible to translate a custom menu into a slug so you can for example do the thing written below and leave out the plugins?:

    -create custom menu NL (slug nl):
    Startpagina / over ons
    -create custom menu UK (slug uk)
    home / about us

    now for example when peope type https://www.website.com/uk/home
    wordpress knows it needs to activate the uk custom menu in the header. You put the English content in this menu

    Other case; people type: https://www.website.com/nl/startpagina

    the Dutch menu structure is activated with all the Dutch pages from the site.

    Just thinking about this… there are so many ways that lead to Rome… euh multi-language solutions… but this one looks so nice and understandable.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Moderator bcworkz

    (@bcworkz)

    WP has great multi language support, but unfortunately, it’s for only one language at a time. I’m unaware of any plugin that will essentially change the language of any one particular page, but it’s worth some searching, I certainly don’t know everything.

    To get WP to understand your URL idea, you’ll want to use the Rewrite API. That’s the easy part. Getting the page translated takes some doing.

    First nothing will happen unless your installation has all the needed language files loaded. Then all your output needs to be passed through the translate functions with the appropriate language parameters. Member Tony P. figured out a way a while back. See https://www.ads-software.com/support/topic/how-to-change-language-in-each-page?replies=9

    Thread Starter dagrit

    (@dagrit)

    That’s an interesting read, thanks. I was thinking just to activate another menu scheme if one of the pages in the different language is called with the help of wp_nav_menu( );

    WordPress should check in which menu the page is a member of and show that menu in the header (or you could place a custom field with a dropdown menu showing the available custom menu ID’s and select it yourself but that’s… dirty)

    The rewrite would be of SEO reasons but it’s not the main goal to display the current language in the addres bar.

    I think the idea of a global variable could also be enough for the menu change though.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘menus, multilanguage, not sure if this needs a hack?’ is closed to new replies.