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 102416 - location for elements of GtkCalendar, by locale
location for elements of GtkCalendar, by locale
Status: RESOLVED WONTFIX
Product: gtk+
Classification: Platform
Component: Widget: GtkCalendar
unspecified
Other other
: Normal enhancement
: Small feature
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2003-01-04 04:52 UTC by kz
Modified: 2014-05-23 10:45 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
patch (6.47 KB, patch)
2003-05-07 22:48 UTC, Matthias Clasen
none Details | Review
better calendar flipping (16.01 KB, patch)
2003-07-20 22:01 UTC, Matthias Clasen
committed Details | Review

Description kz 2003-01-03 14:51:56 UTC
Package: gtk+
Severity: trivial
Version: 2.2.0
Synopsis: location for elements of GtkCalendar, by locale
Bugzilla-Product: gtk+
Bugzilla-Component: gtk

Description:
GtkCalendar has month navigation on left and year navigation on right,
on top of box.
It's not fit to Korean locale convention for calendar.

Korean locale convention prefer year left, month right.

I dunno how it's done in other locales. but it must be differ to en and
some other locales.

sorry for cannot exactly suggesting the detail of implementation or
patch.




------- Bug moved to this database by unknown@bugzilla.gnome.org 2003-01-03 09:51 -------

Reassigning to the default owner of the component, gtk-bugs@gtk.org.

Comment 1 Owen Taylor 2003-01-22 20:32:44 UTC
You'd probably do this with a magic translated string like
default:LTR.
Comment 2 Matthias Clasen 2003-05-07 22:47:58 UTC
Here is a patch. 

Do you think year_left should be explicitly settable in addition to
the magic "calendar:YM" string technique ? 
Comment 3 Matthias Clasen 2003-05-07 22:48:32 UTC
Created attachment 16346 [details] [review]
patch
Comment 4 Owen Taylor 2003-07-18 21:07:03 UTC
* How does this interact with RTL flipping? I'm thinking
  that the interpretation of MY/YM should be dependent
  on the current widget direction. 

  It seems easiest to do RTL flipping at the same time
  as doing this?

* There are some misplaced braces

* I'd really like to see things cleaned up to avoid duplication
  of calculations between realize() and size_allocate()
 
Comment 5 Matthias Clasen 2003-07-20 19:37:06 UTC
I actually thought of this as being the "RTL-flipping" for GtkCalendar.
Do RTL speakers expect the calendar table itself to be flipped ?
Comment 6 Matthias Clasen 2003-07-20 22:01:36 UTC
Created attachment 18465 [details] [review]
better calendar flipping
Comment 7 Matthias Clasen 2003-07-20 22:05:25 UTC
I found that GtkCalendar already did RTL flipping, but it had some issues:

- arrow key movement was flipped as well
- week numbers were not flipped
- header was not flipped

I've fixed these and added my header-flipping-by-magic-translation 
on top of it. I guess this is what you meant by  "MY/YM should be
dependent on the current widget direction".
Comment 8 Matthias Clasen 2003-08-08 22:18:02 UTC
	* gtk/gtkcalendar.c: Complete the RTL flipping support for
GtkCalendar, make it
	possible to flip the headings using the "magic translated string"
technique. 
	Translators, note the comment in gtk_calendar_init() explaining this.
Comment 9 Guille -bisho- 2004-02-04 00:17:49 UTC
As I comment in bug #87977 :
----------------
I have a problem with this patch.
I have:
LANG=en
LC_ALL=es_ES

That's because I want to read the strings of the programs in its
original english, but I want other formats (Numeric, monetary, time)
set to spanish.

The days of the week are shown correctly in spanish, but the week
starts on Sunday, as opposed to spanish time format, that begins on
monday.

A friend told me that you are not using nl_langinfo() to discover the
time properties, because is not portable, and using instead a strings
translation method.

I think it could be solved using the strings translation method, but
using as LANG the language set in LC_TIME, in spite of the original
LANG setting of the user.

In that way, one could use LANG=en and LC_TIME=es without problems.
----------------

This patch could be affected by the same problem, having diferent LANG
and LC_TIME settings.
Comment 10 Owen Taylor 2004-02-24 21:50:42 UTC
Hmmm, maybe actually a valid use for dcgettext!
Comment 11 Matthias Clasen 2004-03-01 11:52:06 UTC
Indeed. I'll try dcgettext for this. Are there any systems with 
gettext, but without dcgettext, or do they always come together ?
Comment 12 Matthias Clasen 2004-03-02 01:50:26 UTC
I tried this:

+++ gtkcalendar.c       2 Mar 2004 01:37:12 -0000
@@ -706,17 +706,18 @@ gtk_calendar_init (GtkCalendar *calendar
    * so if you have a default text direction of RTL and YM, then
    * the year will appear on the right.
    */
-  year_before = _("calendar:MY");
+  year_before = dcgettext (GETTEXT_PACKAGE, N_("calendar:MY"), LC_TIME);
   if (strcmp (year_before, "calendar:YM") == 0)
     private_data->year_before = 1;
   else if (strcmp (year_before, "calendar:MY") != 0)
     g_warning ("Whoever translated calendar:MY did so wrongly.\n");
  
+  g_print ("calendar:YM %d\n", private_data->year_before);
   /* Translate to calendar:week_start:0 if you want Sunday to be the
    * first day of the week to calendar:week_start:1 if you want Monday
    * to be the first day of the week, and so on.
    */
-  week_start = _("calendar:week_start:0");
+  week_start = dcgettext (GETTEXT_PACKAGE,
N_("calendar:week_start:0"), LC_TIME);
  
   if (strncmp (week_start, "calendar:week_start:", 20) == 0)
 

but unfortunately, it doesn't work. straceing testcalendar reveals
that it actually tries to open 
/usr/share/locale/de_DE/LC_TIME/gtk20.mo
now. So in order for this idea to work, I have to at least
link LC_MESSAGES to LC_TIME. Doing that makes it work, more or less.
It also reveals that strftime apparently also uses LC_TIME for the
month names, since they change as well. Doing this more correctly
would require us to split messages again, this time by destination
category.
Comment 13 Matthias Clasen 2004-12-22 19:12:03 UTC
I think we should consider using nl_langinfo() on systems where it provides the
information, and fall back to the magic translated string.
Comment 14 Matthias Clasen 2014-05-23 10:45:51 UTC
closing out old bugs