annajimenez Posted April 25 Share Posted April 25 Hello, I have this website in three languages (created manually): Spanish, French, and English. https://alpha-bay.com But I can't figure out how to change the "contact us" button in the header to its version in each language. Does anyone know how to resolve this through code? Thank you very much. Link to comment
tuanphan Posted April 27 Share Posted April 27 You want to rename button text or? If rename button text, follow these (remember to save a copy of all code somewhere, just for backup) First, find this code in your language code and change it to to this code /* HOMEPAGE-LOGO LINKS TO PROPER LANGUAGE HOMEPAGE */ if (lang == "es") { $('a[href="/"]').attr("href", "/es/inicio/"); $("a.btn").html(function() { return $(this).html().replace("Contact us", "ES Contact US"); }); } if (lang == "fr") { $("a.btn").html(function() { return $(this).html().replace("Contact us", "FR Contact US"); }); } Email me if you have need any help (free, of course.). Answer within 24 hours. Or send to forum message Contact Customer Care - Learn CSS - Buy me a coffee (thank you!) Link to comment
annajimenez Posted April 29 Author Share Posted April 29 Hi @tuanphan That worked perfectly, thank you very much! And could I ask you how to change the link as well? In the case of English, it's already correct, but for French and Spanish, I want to direct to their respective pages: FR: https://alpha-bay.com/fr/contactez-nous ES: https://alpha-bay.com/es/contacta Thank you so much for your help! Link to comment
Solution tuanphan Posted May 1 Solution Share Posted May 1 Change the code to this /* HOMEPAGE-LOGO LINKS TO PROPER LANGUAGE HOMEPAGE */ if (lang == "es") { $('a[href="/"]').attr("href", "/es/inicio/"); $("a.btn").html(function() { return $(this).html().replace("Contact us", "ES Contact US"); }); $("a.btn").attr('href','/es/contacta'); } if (lang == "fr") { $("a.btn").html(function() { return $(this).html().replace("Contact us", "FR Contact US"); }); $("a.btn").attr('href','/fr/contactez-nous'); } Email me if you have need any help (free, of course.). Answer within 24 hours. Or send to forum message Contact Customer Care - Learn CSS - Buy me a coffee (thank you!) Link to comment
annajimenez Posted May 2 Author Share Posted May 2 @tuanphan Thank you! You've been incredibly helpful! Everything is sorted. tuanphan 1 Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment