Before you ask please READ THIS

Language Switcher (WPML) Problem RifePro

in FatMoon Posts: 293
Hi Air

I'm translating a website already done using wpml and I'm having weird behaviors in the menu .. when using the language switcher from wpml I get duplicate entries in the menu! If I set the wpml language switcher not to use anything in the menu I have both languages showing .. is there a conflict beweent Rife and WPML or did I not unterstand something? All I need is the language switch for the the language not shown (no need for current language).. can help?

You can see it here: https://ml.lunique-foundation.org/support

Thanks, Pascal

Comments

  • Posts: 293
    almost forgot: also the header behave differently when I switch language...
  • AirAir
    Posts: 10,970
    Hello :-)
    FLYART said: also the header behave differently when I switch language...
    You have different header color varaint set in this page in the German language(normal variant). In English you have dark variant.
    FLYART said: when using the language switcher from wpml I get duplicate entries in the menu! If I set the wpml language switcher not to use anything in the menu I have both languages showing .. is there a conflict beweent Rife and WPML or did I not unterstand something? All I need is the language switch for the the language not shown (no need for current language)..
    I don't know about any conflict. So what options you have used to activate the language switcher?

    With kind regards.
  • Posts: 293
    Hi Air

    Thans for your fast reply! To activate the language switch I simply used the wpml language switcher option (see screenshot). When I use it (like I did now for you to see) it doubles the language option in the menu (so now I have german twice).. if I add current languae I have current language twice... no clue where ohter settings might be?

    Thanks for the header info.. seems like dupicationg the page in wmpl doesn't automatically use the same header choice?

    Thanks, Pascal
    Bildschirmfoto 2019-02-04 um 15.34.00.png
    1096 x 882 - 102K
  • AirAir
    Posts: 10,970
    Hello :-)
    FLYART said: Thanks for the header info.. seems like dupicationg the page in wmpl doesn't automatically use the same header choice?
    Hard to say what is happening on this action. WPML developer would have to speak.
    FLYART said: if I add current languae I have current language twice... no clue where ohter settings might be?

    Could you please send me temporary* access to your WordPress so I could check there what is going on? Send it here on the forum via private message(click on my nick, in top-right corner you will find option "Message"). In message please add LINK to topic it applies to.

    I will check tomorrow what could be going on. There are just too many variables to guess what is the correct solution.

    By sending access to WordPress I mean:
    -create a new ADMIN account with a fake e-mail
    -set some password to this account
    -send me created login and password

    *temporary - please delete this account after I am done, for your safety!

    With kind regrads.

  • Posts: 293
    Just sent you the info.. thanks for your help!
    Pascal
  • AirAir
    Posts: 10,970
    Hey :-)

    It seems there is indeed some kind of "conflict" with a new version of WPML, as WPML has introduced new features for language switchers.

    To fix it I have removed below code from rife\advance\utilities\wpml.php line ~10
    //we are removing default filter for language switcher and alter it a bit
    if(!empty($sitepress_settings['display_ls_in_menu']) && ( !function_exists( 'wpml_home_url_ls_hide_check' ) || !wpml_home_url_ls_hide_check() ) ) {
    	remove_filter( 'wp_nav_menu_items', array( $icl_language_switcher, 'wp_nav_menu_items_filter' ), 10 );
    	add_filter( 'wp_nav_menu_items', 'apollo13framework_wpml_add_custom_menu', 10, 2 );
    }
    In my opinion, this code is still valid when you want to have language switcher as a submenu, but I will have to revisit it for the new version of WPML.

    Thanks for your help!

    With kind regards.
  • Posts: 293
    Hey Air

    Wow, thanks.. never would have thought it's that "deep"! Great it works for now and sorry you'll have to revisit the new wpml feature for the rife implementation!

    Have a great day!
    Pascal
  • AirAir
    Posts: 10,970
    Thanks, Pascal. WordPress is changing every day;-)

    Have a great day as well my man!

    With kind regards.
  • Posts: 293
    Hi again Air!

    I have a question that is tottaly out of support range! But if you might have a "second" to look at it it might help?
    I am having a weird issue with languages in the give forms. I am using two different forms (one in english one in german). So far so good. In german when opening the form everything is in german until I change the payment method using the radio button then parts of the form appear in english. From that moment these fields remain in english even when switching back and forth..
    https://ml.lunique-foundation.org/spenden/?lang=de

    I totally understand if you don't have the time or if it's out of scope.. no worries.. I still love you if you can't help me :smiley:

    Pascal
    language_error.jpg
    1417 x 842 - 153K
  • AirAir
    Posts: 10,970
    Hey :-)

    I believe this is a bug. It probably doesn't send language parameter when requesting update form, and you get wrong localization. Just guessing.

    You should talk to authors of these plugins, sorry :-)

    With kind regards.
  • Posts: 293
    Just what I thought .. and of course I already did post in WordPress Support for this.. but you guys are good and fast so I took a shot at it ;)
    Thanks, Pascal
  • Posts: 293
    Hi Air

    Remember the above problem I had with the language switcher (as you helped me in php above) .. well.. updating to WP 5.1.1 created a similar problem.. and I cannot find that part in the mentionned php file (maybe I'm just stupid :)) .. can you help?
    Thanks, Pascal
    Bildschirmfoto 2019-03-21 um 16.37.30.png
    1034 x 569 - 857K
  • AirAir
    Posts: 10,970
    Hey :-)

    Could you please send me temporary* access to your WordPress and FTP so I could check there what is going on? Send it here on the forum via private message(click on my nick, in top-right corner you will find option "Message"). In message please add LINK to topic it applies to.

    By sending access to WordPress I mean:
    -create a new ADMIN account with a fake e-mail
    -set some password to this account
    -send me created login and password

    *temporary - please delete this account after I am done, for your safety!
  • Posts: 293
    Hi Air
    Thanks for your help.. I sent everything thorugh private message
    Link is: https://lunique-foundation.org/wp-admin
  • AirAir
    Posts: 10,970
    Fixed :-)

    The code was in line 10 of the mentioned file.

    With kind regards.
  • Posts: 293
    Thanks a lot.. how could I not see that????
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion