Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
Advanced Search

David Roessli

Member
  • Content Count

    9
  • Joined

  • Last visited

  1. I’m afraid this solution of injecting code to patch targeted strings is not sustainable and is liable to break at any template update. Squarespace needs to provide this functionality from within its platform. In the meantime, I discovered an external provider that offers an elegant solution (not free) called localize.js. Check it out at localizejs.com
  2. I’m afraid this solution of injecting code to patch targeted strings is not sustainable and is liable to break at any template update. Squarespace needs to provide this functionality from within its platform. In the meantime, I discovered an external provider that offers an elegant solution (not free) called localize.js. Check it out at localizejs.com
  3. Yes, I need to take a look at forms in general. I'll come back to you when its done.Cheers for the beer ;)
  4. Apparently, there is no way to edit template blocks (even in dev mode), see http://answers.squarespace.com/questions/1004/can-i-change-the-date-format-in-summary-blocks It is annoying that Squarespace doesn't honor the language locale you choose in your settings. The only use it does of it is to set the lang parameter in the html element. So, I wrote a few lines of JavaScript that translate the date into French and substitute the annoying “X month ago” string that appears in .timesince elements. It also translates 'Share' into 'Partagez' and 'Continue reading' into 'Continuer à lire'. The only caveat is that the date is displayed in English until the DOM is fully loaded and the substitution is run. So the page can 'flash' a little. It can be easily customised to other languages. I have used it within the Five template. Copy and paste the following code into your footer (Settings > Code injection): <script> /* ::::::::::::::::::::::::::::::::::::::::::::: ::: Build array of months in French */ var month=new Array(12); month[0]="janvier"; month[1]="février"; month[2]="mars"; month[3]="avril"; month[4]="mai"; month[5]="juin"; month[6]="juillet"; month[7]="août"; month[8]="septembre"; month[9]="octobre"; month[10]="novembre"; month[11]="décembre"; Y.use('node', 'node-load', function(Y) { Y.on('domready', function() { /* ::::::::::::::::::::::::::::::::::::::::::::: ::: Substitute specific strings */ Y.all('.ss-social-button').setHTML('<span class="ss-social-button-icon"></span>Partagez'); Y.all('.inline-read-more').setHTML('Continuer à lire'); // Y.all('.newer-posts').setHTML('Suiv'); // Y.all('.older-posts').setHTML('Prec'); /* ::::::::::::::::::::::::::::::::::::::::::::: ::: Reformat published date (Blog) */ Y.all('time.published').each( function() { var pdate = new Date(this.getAttribute('datetime')); this.setHTML(pdate.getDate() + " " + month[pdate.getMonth()] + " " + pdate.getFullYear()); } ); // .published /* ::::::::::::::::::::::::::::::::::::::::::::: ::: Reformat time since string */ Y.all('time.timestamp').each( function() { var tdate = new Date(this.getAttribute('datetime')); this.setHTML(tdate.getDate() + " " + month[tdate.getMonth()] + " " + tdate.getFullYear()); } ); // .timestamp (.timesince) }); // Y.on }); </script>
×
×
  • Create New...