diff options
-rw-r--r-- | data/lang.txt | 18 | ||||
-rw-r--r-- | lib/VNDB/L10N.pm | 6 |
2 files changed, 20 insertions, 4 deletions
diff --git a/data/lang.txt b/data/lang.txt index 43c8d6f2..cd102a9b 100644 --- a/data/lang.txt +++ b/data/lang.txt @@ -104,6 +104,24 @@ ends with ']'. The following options are supported: # data/global.pl - used in many places +# Date/time format +# See http://www.opengroup.org/onlinepubs/007908799/xsh/strftime.html for the formatting code +# (I recommend to keep the yyyy-mm-dd format, though, see http://www.cl.cam.ac.uk/~mgk25/iso-time.html) + + +:_datetime_compact +en : %Y-%m-%d +ru*: +cs*: +hu*: + +:_datetime_full +en : %Y-%m-%d at %R +ru*: +cs*: +hu*: + + # Age display :_age_years diff --git a/lib/VNDB/L10N.pm b/lib/VNDB/L10N.pm index 8698cb74..9b9d2a82 100644 --- a/lib/VNDB/L10N.pm +++ b/lib/VNDB/L10N.pm @@ -73,12 +73,10 @@ use warnings; } # argument: unix timestamp and optional format (compact/full) - # return value: yyyy-mm-dd - # (maybe an idea to use cgit-style ages for recent timestamps) sub date { my($s, $t, $f) = @_; - return strftime '%Y-%m-%d', gmtime $t if !$f || $f eq 'compact'; - return strftime '%Y-%m-%d at %R', gmtime $t; + return strftime $s->maketext('_datetime_compact'), gmtime $t if !$f || $f eq 'compact'; + return strftime $s->maketext('_datetime_full'), gmtime $t; } # argument: database release date format (yyyymmdd) |