[recipes] Fallback to metric if non-standard _NL_MEASUREMENT_MEASUREMENT isn't defined
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [recipes] Fallback to metric if non-standard _NL_MEASUREMENT_MEASUREMENT isn't defined
- Date: Sat, 27 May 2017 23:02:10 +0000 (UTC)
commit c4640281d2a31b27ce026137cea2e1666015c40b
Author: Jasper Lievisse Adriaanse <jasper humppa nl>
Date: Sat May 27 17:41:42 2017 +0200
Fallback to metric if non-standard _NL_MEASUREMENT_MEASUREMENT isn't defined
Fixes #783153
src/gr-recipe-formatter.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
---
diff --git a/src/gr-recipe-formatter.c b/src/gr-recipe-formatter.c
index 0299562..1b07eb0 100644
--- a/src/gr-recipe-formatter.c
+++ b/src/gr-recipe-formatter.c
@@ -48,12 +48,14 @@ get_temperature_unit (void)
GSettings *settings = gr_settings_get ();
unit = g_settings_get_enum (settings, "temperature-unit");
if (unit == GR_TEMPERATURE_UNIT_LOCALE) {
+#ifdef _NL_MEASUREMENT_MEASUREMENT
const gchar *fmt;
fmt = nl_langinfo (_NL_MEASUREMENT_MEASUREMENT);
if (fmt && *fmt == 2)
unit = GR_TEMPERATURE_UNIT_FAHRENHEIT;
else
+#endif
unit = GR_TEMPERATURE_UNIT_CELSIUS;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]