[gnome-photos] main: Locale fix
- From: Debarshi Ray <debarshir src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-photos] main: Locale fix
- Date: Mon, 22 Sep 2014 15:18:01 +0000 (UTC)
commit 4215c2463072aa86bc0214271dcacdf799e284e9
Author: Debarshi Ray <debarshir gnome org>
Date: Mon Sep 22 17:12:59 2014 +0200
main: Locale fix
Ensure that each part of the locale is set according to the current
environment variables. Otherwise we leave ourselves open to locale
mismatches between the Tracker database and the application.
This can lead to the DB's locale changing on start; or failure to use
Tracker's 'direct' backend and falling back to 'bus'.
We were quite reliably hitting this problem when running the test
suite.
src/photos-main.c | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
---
diff --git a/src/photos-main.c b/src/photos-main.c
index ba30387..203d1b1 100644
--- a/src/photos-main.c
+++ b/src/photos-main.c
@@ -25,6 +25,8 @@
#include "config.h"
+#include <locale.h>
+
#include <glib.h>
#include <glib/gi18n.h>
@@ -39,6 +41,8 @@ main (gint argc, gchar *argv[])
PhotosRemoteDisplayManager *remote_display_mngr;
gint exit_status;
+ setlocale (LC_ALL, "");
+
bindtextdomain (GETTEXT_PACKAGE, PACKAGE_LOCALE_DIR);
bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
textdomain (GETTEXT_PACKAGE);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]