[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Nano-devel] Don't split sentence in nano

From: Christian Rose
Subject: [Nano-devel] Don't split sentence in nano
Date: 18 Jan 2003 10:55:01 +0100

#: nano.c:775
msgid ""
"compatible.  Please see the nano FAQ for more info on this change...\n"

#: nano.c:774
msgid "compatibility flag has been removed as nano is now fully Pico\n"

#: nano.c:773
msgid ""
"The -p flag now invokes the Pico \"preserve\" flag.  The Pico\n"

Please *DON'T* split sentences into several messages like this. Below is
the rationale:

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 "),
             _(" 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."),

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


reply via email to

[Prev in Thread] Current Thread [Next in Thread]