[Freeciv-Dev] Re: Is it possible...
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
On Sun, 14 Nov 1999, Greg Wooledge wrote:
> 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.
[snip]
>
> 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!"....
[snip]
> 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.
Now you're on the right track imho. (see below)
> 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.)
The real problem is gettext; gettext is a simple hack for a
complex problem and doesn't scale. If good translations are wanted,
gettext is not the way to go because all it does is naive
replacing of strings. What you say is however right, one needs
functions which take different arguments and return some object
containing the wanted translation based on the arguments. The
functions will need grammar-knowledge and processing-capabilities
which gettext never can provide. Ie. one calls a function with
proper arguments and get back a generated string.
E.g go from
"Game: A%s %s %s was eliminated while infiltrating %s."
to something like:
translate("Game: %s %s eliminated while infiltrating %s."
nationality and unit-type,
'to be' past sense,
city);
This allows the code to have text in it (to make it readable) which
can be used for hash-lookups, while allowing the
translation-function to reorder as wanted and have actual arguments
to check out when translating. (To reduce speed-overhead the
translation can probably be memoised)
Replacing the simple gettext hack with a proper solution, probably
based on a simple language to implement the functionality that is
needed will take some work but will probably make the language
support better, even for (american) english (a/an, was/were, plural
forms of words).
------------------------------------------------------------------
Stig Erik Sandoe stig@xxxxxxxxx http://www.ii.uib.no/~stig/
- [Freeciv-Dev] Re: We Love the Mr. Day; was Re: BUG REPORT, (continued)
- [Freeciv-Dev] Re: We Love the Mr. Day, Egbert Hinzen, 1999/11/11
- [Freeciv-Dev] Re: We Love the Mr. Day, David Pfitzner, 1999/11/11
- [Freeciv-Dev] Re: We Love the Mr. Day, Jeff Mallatt, 1999/11/12
- [Freeciv-Dev] Is it possible... was: Re: Re: We Love the Mr. Day, Egbert Hinzen, 1999/11/13
- [Freeciv-Dev] Re: Is it possible... was: Re: Re: We Love the Mr. Day, David Pfitzner, 1999/11/14
- [Freeciv-Dev] Re: Is it possible..., Egbert Hinzen, 1999/11/14
- [Freeciv-Dev] Re: Is it possible..., Stig Erik Sandoe, 1999/11/14
- [Freeciv-Dev] Re: Is it possible..., Greg Wooledge, 1999/11/14
- [Freeciv-Dev] Re: Is it possible...,
Stig Erik Sandoe <=
- [Freeciv-Dev] Re: Is it possible..., Stan Shebs, 1999/11/14
- [Freeciv-Dev] Re: Is it possible..., Egbert Hinzen, 1999/11/14
- [Freeciv-Dev] Re: Is it possible..., Stig Erik Sandoe, 1999/11/14
- [Freeciv-Dev] Re: Is it possible..., Egbert Hinzen, 1999/11/14
- [Freeciv-Dev] Re: BUG REPORT, Greg Wooledge, 1999/11/10
|
|