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 647045 - Problems with GLib's DateTime (aka. GDateTime)
Problems with GLib's DateTime (aka. GDateTime)
Status: RESOLVED INCOMPLETE
Product: l10n
Classification: Infrastructure
Component: Spanish [es]
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gnome-es-list@gnome.org
gnome-es-list@gnome.org
Depends on:
Blocks:
 
 
Reported: 2011-04-07 14:58 UTC by lgg2lgg2
Modified: 2012-01-04 11:05 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description lgg2lgg2 2011-04-07 14:58:59 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,"")
Comment 1 lgg2lgg2 2011-04-07 15:08:33 UTC
locale in example: es_ES
Comment 2 Matthias Clasen 2011-04-08 23:42:50 UTC
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
Comment 3 lgg2lgg2 2011-04-09 08:11:55 UTC
(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.
Comment 4 Matthias Clasen 2011-04-11 16:52:08 UTC
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"
Comment 5 Daniel Mustieles 2011-04-11 17:08:38 UTC
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 :(
Comment 6 André Klapper 2011-11-08 15:17:05 UTC
(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?
Comment 7 Fabio Durán Verdugo 2011-11-30 05:30:21 UTC
ping?
Comment 8 Matthias Clasen 2011-11-30 13:00:33 UTC
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.
Comment 9 André Klapper 2012-01-04 11:05:09 UTC
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!