Re: portability issues with hildon-1 (latest maemo svn version)



On Mon, Aug 04, 2008, Thomas Delaet wrote:
> #  ifdef ENABLE_GTK2
> #     ifdef HAVE__NL_TIME_FIRST_WEEKDAY
>          /* GTK 2.8 libraries */
>          langinfo = nl_langinfo(_NL_TIME_FIRST_WEEKDAY);
>          first_weekday = langinfo[0];
>          langinfo = nl_langinfo(_NL_TIME_WEEK_1STDAY);
>          week_origin = GPOINTER_TO_INT(langinfo);
>          if (week_origin == 19971130)      /* Sunday */
>             week_1stday = 0;
>          else if (week_origin == 19971201) /* Monday */
>             week_1stday = 1;
>          else
>             g_warning ("Unknown value of _NL_TIME_WEEK_1STDAY.\n");
> 
>          pref_fdow = (week_1stday + first_weekday - 1) % 7;
> #     else
>          /* GTK 2.6 libraries */
> #        if defined(ENABLE_NLS)
>             week_start = dgettext("gtk20", "calendar:week_start:0");
>             if (strncmp("calendar:week_start:", week_start, 20) == 0) {
>                pref_fdow = *(week_start + 20) - '0';
>             } else {
>                pref_fdow = -1;
>             }
> #        endif
> #     endif

 Perhaps something to propose for glib promotion, with new API to
 retrieve first day of week?

-- 
Loïc Minier


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]