From 5e05f998761c669e3e995051d658268b3d8e3a0d Mon Sep 17 00:00:00 2001 From: Isaque Galdino Date: Tue, 26 Apr 2016 23:14:32 -0300 Subject: [PATCH] build: define first week day in the build script MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Calendar is not handling locale correctly, e.g. user’ set language to English (en-us) and format to Norwegian (nb-no), but Calendar assumes English format rather than Norwegian. Calendar code was ready to use the correct format, just like Shell and GtkCalendar. The issue was in the build script which was setting the correct locale variable responsible to make that code work. This patch fixes the build script. https://bugzilla.gnome.org/show_bug.cgi?id=762428 --- configure.ac | 11 +++++++++++ src/gcal-utils.c | 2 ++ 2 files changed, 13 insertions(+) diff --git a/configure.ac b/configure.ac index c6317588..815260e4 100644 --- a/configure.ac +++ b/configure.ac @@ -26,6 +26,17 @@ AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE", [GETTEXT package name]) AS_IF([test "x$USE_NLS" != "xno"], [AC_DEFINE([ENABLE_NLS], [1], [Native language support is enabled])]) +# _NL_TIME_FIRST_WEEKDAY is an enum and not a define +AC_MSG_CHECKING([for _NL_TIME_FIRST_WEEKDAY]) +AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include ]], + [[nl_langinfo(_NL_TIME_FIRST_WEEKDAY);]])], + [langinfo_ok=yes], [langinfo_ok=no]) +AC_MSG_RESULT($langinfo_ok) +if test "$langinfo_ok" = "yes"; then + AC_DEFINE([HAVE__NL_TIME_FIRST_WEEKDAY], [1], + [Define if _NL_TIME_FIRST_WEEKDAY is available]) +fi + ## don't rerun to this point if we abort AC_CACHE_SAVE diff --git a/src/gcal-utils.c b/src/gcal-utils.c index 267f192c..9b664371 100644 --- a/src/gcal-utils.c +++ b/src/gcal-utils.c @@ -18,6 +18,8 @@ * along with this program. If not, see . */ +#include "config.h" + #include "gcal-utils.h" #include "gcal-event-widget.h" #include "gcal-view.h"