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 113366 - Don't split sentences in gnome-games messages
Don't split sentences in gnome-games messages
Status: RESOLVED DUPLICATE of bug 50676
Product: gnome-games-superseded
Classification: Deprecated
Component: general
2.3.x
Other All
: Normal normal
: ---
Assigned To: Rosanna Yuen
GNOME Games maintainers
Depends on:
Blocks:
 
 
Reported: 2003-05-20 15:48 UTC by Christian Rose
Modified: 2012-01-31 23:32 UTC
See Also:
GNOME target: ---
GNOME version: 2.3/2.4



Description Christian Rose 2003-05-20 15:48:37 UTC
From aisleriot/first_law.scm:

       (list 0 (string-append (_"Remove the ")
			      (cond ((= (get-value (get-top-card 1)) 1)
				     (_"aces"))
				    ((= (get-value (get-top-card 1)) 11)
				     (_"jacks"))
				    ((= (get-value (get-top-card 1)) 12)
				     (_"queens"))
				    ((= (get-value (get-top-card 1)) 13)
				     (_"kings"))
				    (#t
				     (string-append (number->string (get-value (get-top-card 1)))
						    (_"'s"))))))))


This message design is horribly broken from a L10N point of view. Quote
from
http://developer.gnome.org/doc/tutorials/gnome-i18n/developer.html#split-sentences:

---
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 Christian Rose 2003-05-21 00:09:00 UTC
Also a problem in ten_across.scm:

      (begin
        (display (_"Testing ")) (display card-list) (display (_" for
num "))
        (display num) (newline)
        (same-stack-smaller card-list num))))


(define (prepare-move-response card)
  (list 2 (string-append (get-name card) (_" and all cards below it"))
        (_"empty slot(s)")))
Comment 2 Callum McKenzie 2003-05-21 06:44:11 UTC
Yes, I know. Aisleriot has been this way for some time (see bug
#50676), it's just that now you can see where these bad strings are
coming from. Aisleriot is halfway through a reworking to allow it to
be fixed, you're seeing the results of part a (note that there aren't
actually ny new bad strings). The framework is now in place, I will be
fixing these over the next week.

Actually I'm suprised only three examples have been provided.

*** This bug has been marked as a duplicate of 50676 ***
Comment 3 Christian Rose 2003-05-21 08:45:16 UTC
About only three examples being provided -- those were the most
obvious ones. It's actually quite difficult to spot from the pot/po
files which messages get concatenated with others. After the fact that
such split sentences are often very difficult or even impossible to
translate correctly, this probably makes the third important reason
such constructions should be avoided.

I'm happy you're fixing this. Thanks.
Comment 4 Robert Ancell 2012-01-31 23:32:02 UTC
This bug is being reassigned to the "general" component so we can close the aisleriot bugzilla component.  Apologies for the mass email!