After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 150926 - Perhaps degree symbol should be used in gnome-applets messages
Perhaps degree symbol should be used in gnome-applets messages
Status: RESOLVED FIXED
Product: gnome-applets
Classification: Other
Component: gweather
git master
Other All
: High normal
: 2.12
Assigned To: gnome-applets Maintainers
gnome-applets Maintainers
Depends on:
Blocks: 150905
 
 
Reported: 2004-08-24 09:13 UTC by Christian Rose
Modified: 2005-08-07 16:19 UTC
See Also:
GNOME target: ---
GNOME version: 2.11/2.12


Attachments
Proposed patch (3.52 KB, patch)
2005-01-15 20:08 UTC, Michael Terry
needs-work Details | Review
Using escaped characters (3.67 KB, patch)
2005-03-16 18:17 UTC, Michael Terry
committed Details | Review

Description Christian Rose 2004-08-24 09:13:11 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.
Comment 1 Danielle Madeley 2004-10-30 04:46:27 UTC
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?
Comment 2 Michael Terry 2005-01-15 20:08:36 UTC
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 3 Danielle Madeley 2005-01-24 14:11:26 UTC
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.
Comment 4 Michael Terry 2005-03-16 18:17:23 UTC
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.
Comment 5 Danielle Madeley 2005-08-03 17:26:07 UTC
Needs reviewing.
Comment 6 Danielle Madeley 2005-08-07 16:19:40 UTC
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>.