GNOME Bugzilla – Bug 647045
Problems with GLib's DateTime (aka. GDateTime)
Last modified: 2012-01-04 11:05:09 UTC
After create a GDateTime with now_local, or any other, I tray to print it using g_date_time_format and I have several problems: - I can retrieve the date in locale format (dd/MM/yy) using %x - Some C99 date format commands doesn't work (i.e: '%Ex' for alternative representation of dates). It is implemented the use of locales as say the documentation? P.D.: the same result after setlocale(LC_ALL,"")
locale in example: es_ES
The format specifiers supported by g_date_time_format are listed in the docs. http://developer.gnome.org/glib/2.28/glib-GDateTime.html#g-date-time-format
(In reply to comment #2) > The format specifiers supported by g_date_time_format are listed in the docs. > http://developer.gnome.org/glib/2.28/glib-GDateTime.html#g-date-time-format Yes I know. But Try with parameter %x and it doesn't output in the locale format, while console 'date' commmand and gnome clock output is OK. Try also if You want %a or %A, and I get always english name not in my locale.
That is because there are no translations for these strings in glib's es.po: #. Translators: this is the preferred format for expressing the time #: ../glib/gdatetime.c:167 msgctxt "GDateTime" msgid "%H:%M:%S" msgstr "%H:%M:%S"
As I can see in es.po, every day a month's name are translated (full and short names). For example: #: ../glib/gdatetime.c:193 msgctxt "full month name" msgid "January" msgstr "Enero" #: ../glib/gdatetime.c:267 msgctxt "full weekday name" msgid "Monday" msgstr "Lunes" In the other hand, %H:%M:%S just returns numbers, no days or month names... I really don't understand where is the problem :(
(In reply to comment #5) > I really don't understand where is the problem :( lgg2lgg2: Is this still a problem? If yes, can you please provide 1) a testcase 2) the expected outcome 3) the actual outcome?
ping?
As of 2.30, glib is using libc for these translations, and respects LC_TIME for them. This may be part of the problem here ? In any case, more information on the exact nature and circumstances of the problem is needed.
Closing this bug report as no further information has been provided. Please feel free to reopen this bug if you can provide the information asked for in comment 6 and 8. Thanks!