Complete.Org: Mailing Lists: Archives: freeciv-dev: November 1999:
[Freeciv-Dev] Re: Is it possible...
Home

[Freeciv-Dev] Re: Is it possible...

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: Freeciv Developer <freeciv-dev@xxxxxxxxxxx>
Subject: [Freeciv-Dev] Re: Is it possible...
From: Greg Wooledge <wooledge@xxxxxxxxxxx>
Date: Sun, 14 Nov 1999 13:35:15 -0500

Egbert Hinzen (egbert@xxxxxxxxxx) wrote:

> At now the translation list contains about 10 strings with a %s too much
> to translate. In the English text it's used to handle the use of "a" and
> "an". I ignore it in the German translation and that runs fine, but don't
> know if it may cause longterm trouble (not freeing allocated memory etc.).

If you drop a %s from the translated string, it only means that some
variadic function (like printf()) will have an extra argument that will
be ignored.

I hope. :-)

But this is a more serious translation issue.  I'm not sure what the best
way to avoid it would be.  And it's deeper than just "a" vs. "an" -- there
are other problems.

E.g., consider this:

  _("Game: You caught a%s %s %s attempting sabotage in %s!"),

The second %s is a nation_name, so in English this comes out to
"a Babylonian Spy" or "an Egyptian Diplomat".  That's fine -- for English.
But considering romance languages like Spanish (the only foreign language
with which I'm even remotely familiar) the translation should be something
like "un espia Babilonios"(*) or "un diplomatico Egipcio".  As you can
see, there is no difference between "a" and "an" here -- but there *is*
a gender issue.  The choice of "un" vs. "una" is based on the gender of
the noun (unit name) -- and not on the adjective (nation name) at all!

So, after reading Egbert's message, I started writing up some code that
would give whole strings without "a%s" in them -- but quickly realized
that there's a bigger issue, and that just taking out "a%s" won't matter.
The English-based code is assuming there's a switch based on some aspect
(first letter) of the nation name, but in other languages there may be a
switch based on some other part of the string.

With that in mind, I've come up with these ideas:

  (1) In order to get good translations, you have to spit out large
      strings, not small ones.  Ideally we want the translator to get
      the whole sentence "You caught a Babylonian Spy attempting sabotage
      in Paris!", or as much of this sentence as possible.

  (2) On the other hand, we don't want translators getting thousands of
      permuations of similar sentences -- e.g., it would be a horrible
      waste of time and disk space to force people to translate
      "You caught a Babylonian Spy attempting sabotage in Paris!" and
      "You caught a Babylonian Diplomat attempting sabotage in Paris!" and
      "You caught a Babylonian Spy attempting sabotage in London!"....

      So, we have to avoid duplication as well.  But this has to be
      balanced against point (1).

It might be possible to find some middle ground -- or at least, I hope
it's possible.  Perhaps if we could break up the sentence like this:

  "You caught %s attempting sabotage in %s!"

and then we could pass a nation/unit pair in the first string, and a city
name in the second string.  Then, people would still have to translate
"a Babylonian Spy", "a Babylonian Diplomat", "an Egyptian Spy", etc. --
so there's still some waste/duplication, but it's better than the
example in point (2).  And it also helps with the word ordering (i.e.,
"Egyptian Spy" vs. "espia egipcio").

This model would at least cover English and Spanish, for this one case
that I've chosen as an example.  I don't know any other languages well
enough, though, to know whether this is flexible enough.

Would this be worthwhile, or a waste of time?  If it's worthwhile, how
exactly do we go about getting the nation/unit strings into the potfile?
(I can see how to generate the string-to-translate within the game code,
but I don't see how they'd all get into the potfile so that they can be
translated before runtime.)

(*) Using the vocabulary so kindly provided in es.po. :-)  My Spanish
vocabulary is horribly small. :-(

-- 
Greg Wooledge                    | "Truth belongs to everybody."
wooledge@xxxxxxxxxxx             |   Red Hot Chili Peppers
http://www.kellnet.com/wooledge/ |

Attachment: pgpihY5igjMQR.pgp
Description: PGP signature


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