Multilangue footer widgets

Hello

I need help translating the footer. On the site I use woocommrce and the polylang plug for translation. I managed to translate everything except the footer and the button in the main menu (page link: http://server179652.nazwa.pl/klienci/emswear.pl/). The headers in the footer are translated thanks to the string translation in the polylang plugin, but I don’t know how to translate the content of each widget in the footer and the button in the main menu. The website is now almost completed and I would like to launch it next week.

I need help in this subject.

Best regards

Peter

Hi Peter,

Thank you for contacting us. I am happy to help with your queries.

Seems likely you can find the solution on this documentation page of Polylang:

https://polylang.pro/doc/widgets/

I hope that helps.

Please let us know in a new topic if you have any further questions, or if we can provide you with any other assistance.

Regards,
Kharis
aThemes Support

Hi Kharis

Thank you for this but Ihave few questions:

  1. What about the button in main menu ? I added a button in main menu and i would like to translate it for the english version. And also change link for the english version. How can I do that ?
  2. How can I translate the copyrights from polish to english (There is no string in translation strings)?
  3. How can I change background of the dropdown menu in single product size attribute (http://server179652.nazwa.pl/klienci/emswear.pl/en/sklep/emswear-underwear/)?

Best Regards

Peter

Hello Peter,

I’m Rodrigo and will continue this thread with you.

First thanks for using our theme!

  1. To translate the header button text, please go to Appearance > Theme Editor and open the wpml-config.xml at the right sidebar.
    1.1 Add the “header_custom_item_btn_text” like the image below:

    image

    At this point you should be able to translate the button in the Languages > Strings Translation.

  2. First please make sure you have the footer credits field filled and not empty. At this point you already should be able to see in the Languages > Strings Translations. If you are not seeing, please check if the key below it’s in the wpml-config.xml file.
    <key name="footer_credits"/>

  3. Please try adding the given custom CSS code below at Appearance > Customize > Additional CSS:

     table.variations select option {
         background: #2c303b;
     }
     

Please try that and let us know if you need further assistance.

Kind Regards,

Rodrigo,

aThemes Support

1 Like

Hi Rodrigo

Thank you for youre help.

  1. I add this code to wpml-config.xml but nothing changed, no string to translate.
  2. The code is in the wpml-config.xml and the footer credits field is not empty but still no string to translate.
    Maybe the problem (1. and 2.) is because I’m using Sydney pro child theme ?
  3. It works great.

Please help

Peter

Hello,

You are right. Probably that’s the issue.

Try to copy the wpml-config.xml file from original theme and paste inside the child theme folder.

Please try that and let us know if you need further assistance.

Kind Regards,

Rodrigo,

aThemes Support

Hi

I copy the file from original theme to the child theme but still no language string for the footer or menu button.
Any ideas ?

Best Regards
Peter

Hello Peter,

Regarding the wpml-config.html in the child theme folder, I did more tests here and even without the file there, the strings should appear at the Strings Translation:

This is a sydney pro install with the child theme enabled.

I request you sharing the admin access to your site’s admin area with temporary login link over direct message. Ensure that the link expiry is set for one week.

So we can inspect your admin side and see what is happening and look for the best solution for you.

Kind Regards,

Rodrigo,

aThemes Support

Hi Rodrigo
How can I send you private message? I enter in to my messages and I don’t know how to send private message to you :slight_smile: There is no send message button ?
Best Regards
Peter

Hi Peter,

You can click at my nickname on this forum rodrigo (where’s my photo) and then click on the mesage button.

We await your message to resolve this issue as soon possible!

Kind Regards,

Rodrigo,
aThemes Support

Hi Rodrigo
When I click your photo or go to your account page I don’t see any message button ?

Peter

Hi Peter,

Oh sorry for that, seems that by some reason the private message is not showing (even if I enabled it at my settings in this forum).

For now, please send to my aThemes email:

Email

xxxxxxxx

Kind Regards,

Rodrigo,
aThemes Support

Hi Peter,

Thanks for the access!

Really is very strange that in your WP installation the wpml-config.html is not working. I did several tests here with Sydney Pro and the child theme and in all tests the strings appear in the Polylang Strings Translation.

Anyway, there’s another way trough the child theme, by adding the code below in the functions.php file:

/* Strings Translation */
if ( function_exists('pll_register_string') ) :
	function sydney_polylang_extras() {
		pll_register_string('Footer Credits', get_theme_mod('footer_credits'), 'Sydney');
		pll_register_string('Header Button', get_theme_mod('header_custom_item_btn_text'), 'Sydney');
	}
	add_action( 'admin_init', 'sydney_polylang_extras' );
endif;

I’ve already done it for you, then the code is already there.

Now you can go to Polylang Strings Translatio, filter for Sydney group and translate the footer credits and header button.

We hope this helps!

Kind Regards,

Rodrigo,
aThemes Support

Hi Rodrigo
The string do appears now and I translated the strings. But the translation do not appers in front end ?
And also I want to translate link from the button.
Best Regards
Peter

Hi Peter,

Really. Seems our footer credits is not translatable trough the Polylang plugin. I am adding this to our ideas list for future improvements.

You can remove the code I’ve added in the child theme functions.php and please follow this new instructions below to change it with javascript.

  1. Install and activate the TC Custom JavaScript plugin
  2. Go To Appearance > Custom JavaScript
  3. Paste the following code into the provided box
(function($){

     $(document).ready(function(){
         var lang = $('html').attr('lang'),
             footer_credits           = 'emswear.pl © 2021 realizacja:',
             footer_credits_link_text = 'scribnet.pl',
             header_button_text       = 'Kup Teraz',
             header_button_link       = 'https://www.google.com/';

        if( lang == 'en-US' ) {
            footer_credits           = 'emswear.pl © 2021 made by:',
            footer_credits_link_text = 'scribnet.pl',
            header_button_text       = 'Buy now',
            header_button_link       = 'https://www.google.com/';
        }
        
        // Header Button
        $('.header-button').text( header_button_text ).attr('href', header_button_link);

        // Footer Credits
        $('footer .site-info').html( footer_credits + ' <a href="https://scribnet.pl/">'+ footer_credits_link_text +'</a>' );
     });

})(jQuery);

Change the variables values as per your needs. Note that there’s a condition to check when is the English version.

Thanks for your patience!

This solution will definetely resolve your issue.

We hope this helps!

Please try that and let us know if you need further assistance.

Kind Regards,

Rodrigo,

aThemes Support

Hi Rodrigo

I paste the code and when I update it I get server error ?

Peter

Hi Peter,

Really strange. That’s a server side issue. I recommend for you contact your hosting provider about that. Seems that the server is blocking some kind of requests, like javascript code.

If we just enter a simple code like:

alert('testing!');

The code works without forbidden 403 (permission error).

Please try that and let us know if you need further assistance.

Kind Regards,

Rodrigo.

aThemes Support

Hi Rodrigo

I implement the solution on live webpage and it’s workig great :slight_smile: But can you work on updating theme so the original solution will work ?

Best Regards
Peter

He Peter,

Great! :slight_smile:

Sure! This is in our to-do list for future updates.

Let me know if you have any other question.

Kind Regards,

Rodrigo.

aThemes Support