[libgweather] GWeatherWeather: Use non-break space in temperatures
- From: Bastien Nocera <hadess src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libgweather] GWeatherWeather: Use non-break space in temperatures
- Date: Fri, 15 Dec 2017 23:34:23 +0000 (UTC)
commit bbff0f136416f886824f012d1dab9d13b55833fa
Author: Bastien Nocera <hadess hadess net>
Date: Sat Dec 16 00:28:36 2017 +0100
GWeatherWeather: Use non-break space in temperatures
So that the digits aren't split up from the degrees sign.
https://bugzilla.gnome.org/show_bug.cgi?id=789080
libgweather/gweather-weather.c | 30 ++++++++++++++++++------------
1 file changed, 18 insertions(+), 12 deletions(-)
---
diff --git a/libgweather/gweather-weather.c b/libgweather/gweather-weather.c
index ec6906c..6ece656 100644
--- a/libgweather/gweather-weather.c
+++ b/libgweather/gweather-weather.c
@@ -881,29 +881,35 @@ temperature_string (gfloat temp_f, GWeatherTemperatureUnit to_unit, gboolean wan
switch (to_unit) {
case GWEATHER_TEMP_UNIT_FAHRENHEIT:
if (!want_round) {
- /* TRANSLATOR: This is the temperature in degrees Fahrenheit (U+2109 DEGREE FAHRENHEIT) */
- return g_strdup_printf (_("%.1f \u2109"), temp_f);
+ /* TRANSLATOR: This is the temperature in degrees Fahrenheit (U+2109 DEGREE FAHRENHEIT)
+ * with a non-break space (U+00A0) between the digits and the degrees sign */
+ return g_strdup_printf (_("%.1f\u00A0\u2109"), temp_f);
} else {
- /* TRANSLATOR: This is the temperature in degrees Fahrenheit (U+2109 DEGREE FAHRENHEIT) */
- return g_strdup_printf (_("%d \u2109"), (int)floor (temp_f + 0.5));
+ /* TRANSLATOR: This is the temperature in degrees Fahrenheit (U+2109 DEGREE FAHRENHEIT)i
+ * with a non-break space (U+00A0) between the digits and the degrees sign */
+ return g_strdup_printf (_("%d\u00A0\u2109"), (int)floor (temp_f + 0.5));
}
break;
case GWEATHER_TEMP_UNIT_CENTIGRADE:
if (!want_round) {
- /* TRANSLATOR: This is the temperature in degrees Celsius (U+2103 DEGREE CELSIUS) */
- return g_strdup_printf (_("%.1f \u2103"), TEMP_F_TO_C (temp_f));
+ /* TRANSLATOR: This is the temperature in degrees Celsius (U+2103 DEGREE CELSIUS)
+ * with a non-break space (U+00A0) between the digits and the degrees sign */
+ return g_strdup_printf (_("%.1f\u00A0\u2103"), TEMP_F_TO_C (temp_f));
} else {
- /* TRANSLATOR: This is the temperature in degrees Celsius (U+2103 DEGREE CELSIUS) */
- return g_strdup_printf (_("%d \u2103"), (int)floor (TEMP_F_TO_C (temp_f) + 0.5));
+ /* TRANSLATOR: This is the temperature in degrees Celsius (U+2103 DEGREE CELSIUS)
+ * with a non-break space (U+00A0) between the digits and the degrees sign */
+ return g_strdup_printf (_("%d\u00A0\u2103"), (int)floor (TEMP_F_TO_C (temp_f) + 0.5));
}
break;
case GWEATHER_TEMP_UNIT_KELVIN:
if (!want_round) {
- /* TRANSLATOR: This is the temperature in kelvin (U+212A KELVIN SIGN) */
- return g_strdup_printf (_("%.1f \u212A"), TEMP_F_TO_K (temp_f));
+ /* TRANSLATOR: This is the temperature in kelvin (U+212A KELVIN SIGN)
+ * with a non-break space (U+00A0) between the digits and the degrees sign */
+ return g_strdup_printf (_("%.1f\u00A0\u212A"), TEMP_F_TO_K (temp_f));
} else {
- /* TRANSLATOR: This is the temperature in kelvin (U+212A KELVIN SIGN) */
- return g_strdup_printf (_("%d \u212A"), (int)floor (TEMP_F_TO_K (temp_f)));
+ /* TRANSLATOR: This is the temperature in kelvin (U+212A KELVIN SIGN)
+ * with a non-break space (U+00A0) between the digits and the degrees sign */
+ return g_strdup_printf (_("%d\u00A0\u212A"), (int)floor (TEMP_F_TO_K (temp_f)));
}
break;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]