GNOME Bugzilla – Bug 150926
Perhaps degree symbol should be used in gnome-applets messages
Last modified: 2005-08-07 16:19:40 UTC
#. TRANSLATOR: This is the temperature in degrees fahrenheit, use the degree #. symbol Unicode 00B0 if possible #: gweather/weather.c:2150 gweather/weather.c:2153 #, c-format msgid "%.1f F" #. TRANSLATOR: This is the temperature in degrees fahrenheit, use the degree #. symbol Unicode 00B0 if possible #: gweather/weather.c:2158 gweather/weather.c:2161 #, c-format msgid "%dF" #. TRANSLATOR: This is the temperature in degrees centigrade , use the degree #. symbol Unicode 00B0 if possible #: gweather/weather.c:2169 gweather/weather.c:2172 #, c-format msgid "%.1f C" #. TRANSLATOR: This is the temperature in degrees centigrade , use the degree #. symbol Unicode 00B0 if possible #: gweather/weather.c:2177 gweather/weather.c:2180 #, c-format msgid "%dC" You could theoretically use the degree symbol in the original strings. See http://developer.gnome.org/doc/tutorials/gnome-i18n/developer.html#use-ascii-or-utf8 for the requirements when using UTF-8 in translateable source messages. Note however that gnome-applets is currently in string freeze.
The code here is a bit strange. You have things like: if ( strcmp (_("%.1f F"), "%.1f F") != 0 ) { /* TRANSLATOR: This is the temperature in degrees fahrenheit, use the degree */ /* symbol Unicode 00B0 if possible */ g_snprintf(buf, sizeof (buf), _("%.1f F"), far); } else { g_snprintf(buf, sizeof (buf), "%.1f \302\260F", far); } It would seem that we're only using the translated string if the translated string is in fact translated. Otherwise we are using a string with a degree symbol in it. Evidently this is to allow translators to override the symbol (or not use it I guess). Perhaps a better comment might be helpful?
Created attachment 36070 [details] [review] Proposed patch Here is a patch that cleans up the code for displaying temperature. Even if the original code split up the strings so as to allow the translators to override the degree symbol, it could have just included the symbol and then had them override it. To-be-translated strings should be in the English form, not some English-but-missing-some-characters form. I looked through the translations and there was a lot of disparity in the placement and spacing of the degree symbol (maybe on purpose due to i18n issues), so it would probably be helpful to include the symbol for suggested placement. I think the code was split like it was because the author didn't want translators to see the escaped utf-8. Anyway, this patch doesn't fork on whether the string is translated or not; it always uses the translated form. It also doesn't differ in spacing depending on whether rounding is being used or not. As far as I could tell, the space wasn't being included when rounding to save real estate on the panel. But, the proper form for SI units is to have a space.
Comment on attachment 36070 [details] [review] Proposed patch >+ /* TRANSLATOR: This is the temperature in degrees Fahrenheit */ >+ g_snprintf(buf, sizeof (buf), _("%.1f °F"), far); This looks basically correct, however you should use octal codes (such as \302\260F), they don't get broken by dodgy unicode in Bugzilla.
Created attachment 38798 [details] [review] Using escaped characters Sorry for the delay; here is the patch using escaped octals and an explanation for the translators.
Needs reviewing.
2005-08-08 Davyd Madeley <davyd@madeley.id.au> * weather.c: Use escaped characters for degree symbol and give explanation to the translators. Closes #150926. Patch from Michael Terry <mike@mterry.name>.