Needs review
Project:
GCal Events
Version:
7.x-1.x-dev
Component:
Miscellaneous
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
11 Feb 2009 at 23:30 UTC
Updated:
11 Nov 2014 at 22:21 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
Se7enLC commentedAre there problems with non-english dates? I think php is i18n-aware - I've seen somebody using this application in a foreign language and the month names were changed to match.
The problem with using format_date() will be that it forces you to use the same date format as the rest of drupal, and the same date format in every block. In some cases it might be beneficial to use just the time, or just the month name in one block, and a full date in another. People seem to like customizations of things like this.
I could probably patch it such that the default date is the one selected in drupal admin, but still leave it overridable.
Comment #2
Joackim commentedThe Drupal API states that format_date can be called with $type = 'custom' and the $format set to a PHP-date compatible string. It would simply be a matter och changing date($timestamp, $format) to format_date($timestamp, 'custom', $format). This should be fully compatible with the current code or am I missing something? The benefit of the change would be that it allows multiple languages on the same drupal site.
Comment #3
giuppe commentedHi,
the php date() function does not translate weekdays' and months' names, (e.g. date("F") will output "February" even when drupal is translated). As Joackim said, drupal format_date() can be used as a replacement for php date() using $type='custom'.
So I made a patch that changes the various date() to format_date(), keeping the per-block date format.
I added also various missing t() that I hope will aid the overall module i18n.
P.S.: keep up the good work with this great module! :)
Comment #4
giuppe commentedI forgot to change the status of the issue.
Comment #5
nachenko commentedActually, PHP DOES translate dates, as long as you "tell" the script the country and language you want the date for. Check "setlocale" function for details.
Comment #6
Metasequoia commentedHow do I use the setlocale function exactly? I have no knowledge of PHP, but I want to display the weekdays and month names in a different language than english. I currently use the 7.x version of the module.
Comment #7
jdwfly commentedWill look at soon.
Comment #8
bohemier commentedRecreated the patch for 7.x-1.x-dev