[Freeciv-Dev] Re: Is it possible...
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
Date: Sun, 14 Nov 1999 20:42:52 +0100 (MET)
From: Stig Erik Sandoe <stig@xxxxxxxxx>
[...] 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).
Xconq puts a bunch of text generation, such as the algorithm for
making an ordinal number string ("1st") out of a number, into a
special file of C code. The strategy is untested, however, as no one
has yet mustered the energy to write one of these for a second
language.
Other text uses a technique borrowed from the Mac, which uses format
strings with *positional* directives, so the format string says "^0
attacks ^1", where ^0 becomes the first argument to the formatting
function, and ^1 becomes the second. One could expand on the idea
with additional format specifiers, for instance something like
"^p0 attack^ga0 ^1" to indicate that ^0 is a plural, and to attach
an ending of the appropriate gender, in active voice, to the verb.
It's also worth considering whether you want to get tangled up with
that degree of generality, and think about simplifying the textual
component so the translation problems become less formidable. Xconq
has gone the route of extreme generality, for good reasons, but as a
result, only a few people have the talent and energy to work on its
code, and improvements come slower than they might have otherwise.
Stan
- [Freeciv-Dev] Re: We Love the Mr. Day; was Re: BUG REPORT, (continued)
- [Freeciv-Dev] Re: We Love the Mr. Day; was Re: BUG REPORT, Chris Lawrence, 1999/11/12
- [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, 1999/11/14
- [Freeciv-Dev] Re: Is it possible...,
Stan Shebs <=
- [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
|
|