• Resolved ldybiec

    (@ldybiec)



    I have website and i have plugin Weglot, when will change website language, button “change language” change possition. I would lika have buttons always the same possition, In weglot.php where I must change code ?

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

Viewing 12 replies - 1 through 12 (of 12 total)
  • Plugin Author Remy B

    (@remyb92)

    Hi,

    I’m not sure I understand, you would like to have always the “PL” button on the left and always “EN” button on the right ?

    Exactly I would like have button “PL” on left side and button “EN” on right Side always

    • This reply was modified 7 months, 2 weeks ago by  ldybiec.
    Plugin Author Remy B

    (@remyb92)

    ok, I see. In this case enter the following code in the field “Override CSS” of the plugin.

    .wg-flags.en {
        float: right!important;
    }

    Then save 🙂

    Thanks it works, but I have yet problem because when i click button”EN” i would like add on url “& wmc-currency=GBP” and when i click button “PL” will add “wmc-currency=PLN”.

    I wrote variable “$value1 = ‘&wmc-currency=GBP’ ;” in weglot.php and I added in code

     $list .= '<li class="wg-li ' . $flag_class . $d . '">
    <a data-wg-notranslate href="' . $link .$value1 .'">' 
    . ($withname ? ($full ? WGUtils::getLangNameFromCode( $d,false ) : strtoupper( $d )) : '') . '</a></li>';

    it’s working, but on once side. Can you help me?

    • This reply was modified 7 months, 2 weeks ago by  ldybiec.
    Plugin Author Remy B

    (@remyb92)

    For this I’m not sure, but what you did is good.
    What do you mean “for one side” ? I went to your website http://asgym.pl/ but I don’t see the currency=GBP

    Open the page . I would like have, when I click button “PL” will be change currency on polish money ans the same when i click button”EN” currency will be change british money. I found plugin who add to url “&wmc-currency=PLN” and “&wmc-currency=GBP”.

    Plugin Author Remy B

    (@remyb92)

    Yes I see what you want to do but Weglot doesn’t allow this by default. It should be possible by changing some code but it can be hard.
    Maybe write:
    $value[‘en’] = ‘&wmc-currency=GBP
    $value[‘pl’] = ‘&wmc-currency=PLN

    Then in the code, something like

     $list .= '<li class="wg-li ' . $flag_class . $d . '">
    <a data-wg-notranslate href="' . $link .$value[$d] .'">' 
    . ($withname ? ($full ? WGUtils::getLangNameFromCode( $d,false ) : strtoupper( $d )) : '') . '</a></li>';

    I haven’t tested this code but it should be something around this

    Everything of working, thank you so much

    I have one more problem, because when I click the button “EN” in url add a new value “?wmc-currency=GBP” but when I click button “PL” currency doesn’t change becuse is added to the previous value, so url always appends add new value to old. How can I change code i weglot.php that i will change language old value currency will delete and will add new value. Can you open page asgym.pl and help me?

    Plugin Author Remy B

    (@remyb92)

    You will need to detect the URL and remove the ?wmc-currency=GBP from the link so that you don’t have http://asgym.pl/?wmc-currency=GBP?&wmc-currency=PLN but only
    http://asgym.pl/?&wmc-currency=PLN
    in the code you can use parse_url function on the link, then remove parameters

    Could you help me with function parse_url because I can’t do it.

    Plugin Author Remy B

    (@remyb92)

    You can check the documentation about parse_url here
    It will help you

Viewing 12 replies - 1 through 12 (of 12 total)
  • The topic ‘EDIT CODE WELGOT’ is closed to new replies.