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 110416 - Don't split sentences in gcalctool
Don't split sentences in gcalctool
Status: RESOLVED FIXED
Product: gnome-calculator
Classification: Core
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: Rich Burridge
Rich Burridge
Depends on:
Blocks:
 
 
Reported: 2003-04-09 21:32 UTC by Christian Rose
Modified: 2004-12-22 21:47 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Christian Rose 2003-04-09 21:32:17 UTC
#: gcalctool/mp.c:3323
msgid "CALL TO SUBROUTINE MPPWR ***\n"

#: gcalctool/mp.c:3554 gcalctool/mp.c:3761
msgid "NOT CONVERGING PROPERLY ***\n"

#: gcalctool/mp.c:3874
#, c-format
msgid "TO AT LEAST %d ***\n"

#: gcalctool/mp.c:887
msgid "TO AN MP ROUTINE ***\n"

#: gcalctool/mp.c:886
msgid "*** MXR TOO SMALL OR NOT SET TO DIM(R) BEFORE CALL "

#: gcalctool/mp.c:3322
msgid "*** ATTEMPT TO RAISE ZERO TO NEGATIVE POWER IN\n"

#: gcalctool/mp.c:3553
msgid "*** ERROR OCCURRED IN MPREC, NEWTON ITERATION\n"

#: gcalctool/mp.c:3760
msgid "*** ERROR OCCURRED IN MPROOT, NEWTON ITERATION\n"

#: gcalctool/mp.c:3873
msgid "*** INCREASE ITMAX2 AND DIMENSIONS OF MP ARRAYS \n"

The above sentences seem split into several messages. This is, very, very
bad for localization and the net effect is in most cases that the result is
not at all properly translatable. Below is the full story, taken from
http://developer.gnome.org/doc/tutorials/gnome-i18n/developer.html#split-sentences.
There are probably more examples like this in mp.c, I'm not sure I got all
examples listed above.

---
Never split sentences in several gettext calls. This splits the sentence
into several messages, and a sentence can only be properly translated in
its entirety, since word order, proper terminology and grammar vary a lot
between languages. Unfortunately, it's too common to see something like
these frightening fictual examples in the source code:

   g_printf (_("There are "),
             NO_FROBNICATORS,
             _(" frobnicators available."));
   

   g_printf (_("You chose a yellow "));
   if (choice == FISH_CHOICE) {
     g_printf (_("fish."));
   } else {
     g_printf (_("cat."));
   }
   

Remember that each and every call to _() will result in a message that can
end up at any place and in any order in the po file. " frobnicators
available." and "There are " won't make much sense for themselves and can
easily be accidentally mistranslated when out of context. Even though these
messages may look suspicious, putting together this puzzle of which message
belongs to which other one is a form of source code reverse engineering
that most translators don't want to spend time on. Even worse, sometimes
these splitups make proper translation not only extremely difficult but
even impossible. This can be the case if the splitup results in the same
sentence fragments used in several places but the words need different
tenses or gender in the different cases, which may not be the case in English.

The proper solution is, as stated previously, to change the code so that
the sentences can be marked for translation in their entirety:

   g_printf (_("There are %d frobnicators available."),
             NO_FROBNICATORS);
   

   if (choice == FISH_CHOICE) {
     g_printf (_("You chose a yellow fish."));
   } else {
     g_printf (_("You chose a yellow cat."));
   }
   
---
Comment 1 Rich Burridge 2003-04-09 21:53:04 UTC
Note that none of the warning/error messages in mp.c are
output by default. Only if the user has started gcalctool
with the -E command line options.

Having said that, I'll see what I can do to improve this.
Comment 2 Rich Burridge 2003-04-10 16:35:26 UTC
I've concatenated the error message strings in mp.c 
as you have suggested. Fixed in v4.2.80.

Thanks!
Comment 3 Christian Rose 2003-04-15 15:11:55 UTC
This appears not to have been fixed (these messages are taken directly
from gcalctool cvs HEAD):

#: gcalctool/mp.c:182 gcalctool/mp.c:2812 gcalctool/mp.c:3090
msgid "POSSIBLE OVERWRITING PROBLEM ***\n"

#: gcalctool/mp.c:2618
msgid "NEWTON ITERATION NOT CONVERGING PROPERLY ***\n"
Comment 4 Rich Burridge 2003-04-15 15:44:26 UTC
Ahh, silly me. I assumed you'd listed all the
offending cases. No problem. I'll go through
that file and see if there are any others (apart
from the two you've just mentioned) that do this.
Comment 5 Rich Burridge 2003-04-15 20:06:58 UTC
All the remaining split mp.c error messages should 
now be concatenated together. Fixed in v4.2.82. 
Thanks!