andysuchann Posted May 12, 2022 Share Posted May 12, 2022 Site URL: https://cahcal-fr.squarespace.com/ I'm having difficulty with translating the month in my calendar on my website. I've changed the language setting in the navigation, which translated majority of the website to French, however, it did not translate the month on my calendar page. Does anyone know how I can fix this? Any help would be greatly appreciated! Calendar Page: https://cahcal-fr.squarespace.com/calendrier Pass: cahcal Link to comment
humxahafeex Posted May 12, 2022 Share Posted May 12, 2022 12 minutes ago, andysuchann said: Site URL: https://cahcal-fr.squarespace.com/ I'm having difficulty with translating the month in my calendar on my website. I've changed the language setting in the navigation, which translated majority of the website to French, however, it did not translate the month on my calendar page. Does anyone know how I can fix this? Any help would be greatly appreciated! Calendar Page: https://cahcal-fr.squarespace.com/calendrier Pass: cahcal Hi It's possible , will you please let us know on what plan of squares pace you are using personal or business? Link to comment
andysuchann Posted May 12, 2022 Author Share Posted May 12, 2022 4 minutes ago, humxahafeex said: Hi It's possible , will you please let us know on what plan of squares pace you are using personal or business? It will be a Business Account once I purchase it and push the site live. Link to comment
humxahafeex Posted May 12, 2022 Share Posted May 12, 2022 11 minutes ago, andysuchann said: It will be a Business Account once I purchase it and push the site live. Awesome let me try to do a code for it and post it here in a while. Link to comment
andysuchann Posted May 12, 2022 Author Share Posted May 12, 2022 4 minutes ago, humxahafeex said: Awesome let me try to do a code for it and post it here in a while. Thanks so much - really appreciate! I'm looking to translate the months to French so they would be: janvier - January février - February mars - March avril - April mai - May juin - June juillet - July aout - August septembre -September octobre - October novembre - November décembre - December Link to comment
humxahafeex Posted May 12, 2022 Share Posted May 12, 2022 Hi Here's is the Code on how you can achieve this , Just copy and paste the code in Code Injection you , Simply go to Settings> Advanced> Code Injection In HEADER part add the following code: <script src = "https://code.jquery.com/jquery-2.2.4.min.js" ></script> In FOOTER part add the following code: <script> function translate(){ $(".yui3-calendar-header-label").text(function(){ var month = $(this).text(); month = month.toString(); for (var i=0;i<12;i++) { if (month.includes(arr_month_english[i])){ return $(this).text().replace(arr_month_english[i], arr_month_trans[i]);} } }); } const arr_month_trans = ["Janvier", "Février", "Mars", "Avril", "Mai", "Juin", "Juillet", "Aout", "Septembre", "Octobre", "Novembre", "Décembre"]; const arr_month_english = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"]; $(document).ready(function() { setTimeout(translate, 2000); $(document).on('click','.yui3-calendarnav-prevmonth',function(){translate();}); $(document).on('click','.yui3-calendarnav-nextmonth',function(){translate();}); }); </script> It's DONE, Enjoy , Do Mark it solved if it works for you 🙂 Hey, If my solution helped you don't hesitate to Buy me a coffee : https://www.buymeacoffee.com/hamxahafeex sigmundelias 1 Link to comment
andysuchann Posted May 13, 2022 Author Share Posted May 13, 2022 tHIS 14 hours ago, humxahafeex said: Hi Here's is the Code on how you can achieve this , Just copy and paste the code in Code Injection you , Simply go to Settings> Advanced> Code Injection In HEADER part add the following code: <script src = "https://code.jquery.com/jquery-2.2.4.min.js" ></script> In FOOTER part add the following code: <script> function translate(){ $(".yui3-calendar-header-label").text(function(){ var month = $(this).text(); month = month.toString(); for (var i=0;i<12;i++) { if (month.includes(arr_month_english[i])){ return $(this).text().replace(arr_month_english[i], arr_month_trans[i]);} } }); } const arr_month_trans = ["Janvier", "Février", "Mars", "Avril", "Mai", "Juin", "Juillet", "Aout", "Septembre", "Octobre", "Novembre", "Décembre"]; const arr_month_english = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"]; $(document).ready(function() { setTimeout(translate, 2000); $(document).on('click','.yui3-calendarnav-prevmonth',function(){translate();}); $(document).on('click','.yui3-calendarnav-nextmonth',function(){translate();}); }); </script> It's DONE, Enjoy , Do Mark it solved if it works for you 🙂 Hey, If my solution helped you don't hesitate to Buy me a coffee : https://www.buymeacoffee.com/hamxahafeex This worked, you're the best - thanks so much! Link to comment
humxahafeex Posted May 13, 2022 Share Posted May 13, 2022 9 minutes ago, andysuchann said: tHIS This worked, you're the best - thanks so much! Glad I could helped , Please mark it as solved it helped others as well. Link to comment
Solution paul2009 Posted May 13, 2022 Solution Share Posted May 13, 2022 23 hours ago, andysuchann said: I've changed the language setting in the navigation, which translated majority of the website to French, however, it did not translate the month on my calendar page. @andysuchann This should not happen and should not require custom code to fix. Squarespace have confirmed that this is caused by an issue with calendar dates on their end. It has been reported to their Engineering team, and they’re currently prioritizing the issue so that it can be fixed. Improve your online store with our extensions.About: Squarespace Circle Leader since 2017. I value honesty, transparency, appreciation and great design ♥.Work: Squarespace Developer and founder of SF Digital, building the features Squarespace didn't include™. Content: Links in my posts may refer to SF Digital products or may be affiliate links.Buy me a coffee 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