Better localization of blog_entry

Permalink Browser Info Environment

Just a note about a minor issue about the localization.
In blog_entry.php we have this code:
<?php echo t('Posted by')?>
<?php echo $c->getVersionObject()->getVersionAuthorUserName(); ?>
on <i class="fa fa-calendar"></i>
  $collectionDate = strtotime($c->getCollectionDatePublic());
  $date = date("F j, Y", $collectionDate); 
  echo $date;

This has two problems: the "on" is not localized, the date is not localized and it does not reflects the current user timezone.

Here's the fix for this:
  echo t(
    'Posted by %1$s on %2$s',
    '<i class="fa fa-calendar"></i> '.\Core::make('date')->formatDate($c->getCollectionDatePublic(), true)

Bonus track: attached to this message you can find the Italian localization of Salix (the archive contain the compiled and the source files of the localizations: in the downloadable archive you should have only the .mo file /languages/it_IT/LC_MESSAGES/

1 Attachment

Type: Discussion
Status: Resolved
View Replies:
pilipala replied on at Permalink Reply
Hi Sketchadd,

Thank you for bringing that issue to our attention. We appreciate feedback and are always looking for ways to improve our themes. You are right about the text "on" not being internationalised and we will modify that in a future update.


pilipala replied on at Permalink Reply
Salix upgrade v0.9.7 - we have added more echo t functions in Blog Entry and Portfolio Item page templates.

concrete5 Environment Information


Browser User-Agent String

Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/50.0.2661.75 Safari/537.36

Hide Post Content

This will replace the post content with the message: "Content has been removed by an Administrator"

Hide Content

Request Refund

You may not request a refund that is not currently owned by you.