After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 646735 - About dialog Copyright date should use strftime
About dialog Copyright date should use strftime
Status: RESOLVED FIXED
Product: nautilus
Classification: Core
Component: Internationalization (i18n)
2.91.x
Other Linux
: Normal normal
: 3.2
Assigned To: Nautilus Maintainers
Nautilus Maintainers
Depends on:
Blocks:
 
 
Reported: 2011-04-04 18:25 UTC by Cosimo Cecchi
Modified: 2011-04-06 13:50 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Cosimo Cecchi 2011-04-04 18:25:51 UTC
We don't want to change the translatable string every time we update the current year in the copyright.

Wouter says: "the correct and future proof solution is to use
strftime and this format string: 

  _("Copyright © 1999–%Y The Nautilus authors")

(Note: with a U+2013 EN DASH and not a normal hypen!)"
Comment 1 Wouter Bolsterlee (uws) 2011-04-04 18:33:54 UTC
Fwiw, reference to my original message:
http://mail.gnome.org/archives/gnome-i18n/2011-April/msg00078.html
Comment 2 Wouter Bolsterlee (uws) 2011-04-04 18:41:13 UTC
Oh, and if you don't want "automatic year counting", the solution would involve sprintf and %d:

  sprintf(_("Copyright © 1999–%d The Nautilus authors"), 2011)

It would be really cool to support locale-specific digits:

  sprintf(_("Copyright © %Id–%Id The Nautilus authors"), 1999, 2011)

The combination of both locale-specific number notation and automatic year counting using the current date and time is left as an exercise to the reader. It involves sprintf() with twice a "%Id" format specifier (not strftime()!) and the current year obtained from localtime().
Comment 3 Cosimo Cecchi 2011-04-04 23:14:04 UTC
Wouter, thanks for the suggestions. As I branched nautilus for 3.0 earlier today, I implemented your proposal in the master branch.
Comment 4 Wouter Bolsterlee (uws) 2011-04-05 19:51:04 UTC
This is the relevant commit:

http://git.gnome.org/browse/nautilus/commit/?id=ced6d22409c3a849b86b75bb867f267a3cdad800

Code looks good, thanks for pointing out the GLib way (instead of using localtime() directly). However, you seems to have missed my comment about the U+2013 EN DASH:

  (Note: with a U+2013 EN DASH and not a normal hypen!)"

The UTF-8 form for this character is \xE2\x80\x93. Please fix that to obtain eternal fame! :)
Comment 5 Cosimo Cecchi 2011-04-06 13:50:42 UTC
Oh right; I fixed this in master now.