GNOME Bugzilla – Bug 50676
Translation of aisleriot doesn't work properly
Last modified: 2012-01-31 23:17:24 UTC
The translation of aisleriot doesn't work properly. SCHEME_GAMES.h contains N_() of all terms used in the scheme games (or could at least potentially do so), but the strings are concatenated by the game before getting passed to _() by dialog.c This occurs when asking for a hint, possibly on more places. The solution to this is either to have a more general hint description mechanism, or to somehow call gettext from the .scm file before concatenating the strings. Another thing is that the wording may well be reversed when translating For instance "Queen of Hearts" is translated to "hjärter dam", where hjärter is Hearts and dam is Queen. Only by using some sort of printf which can accept positional %s this can be solved. Simple concatenation won't do.
*** Bug 50677 has been marked as a duplicate of this bug. ***
*** Bug 2422 has been marked as a duplicate of this bug. ***
Ariel was looking at a guile gettext biding to solve this.
I think gettext has support for this now, I could be mistaken though.
Could any i18n guru look at the current status, and mail me what to do ?
A status report on this hideously old bug: I've written a scheme wrapper for gettext and as a result have shuffled the point where gettext is called down to the scheme level. This doesn't yet solve any of the problems (in the short term it potentially makes it worse), but it provides a framework that allows them to be fixed. Once it's got to the C level its too late. This will all appear in 2.3.2. Unfortunately the scheme code does everything the i18n people tell you not to do.
*** Bug 113366 has been marked as a duplicate of this bug. ***
*** Bug 106697 has been marked as a duplicate of this bug. ***
Finally this is fixed. Aisleriot now uses gettext properly and there are hopefully no more nasty concatenated strings.
#: aisleriot/eagle_wing.scm.h:7 msgid "Move the ~a to an empty foundation" #: aisleriot/fortunes.scm.h:3 msgid "Move the ~a off the board" #: aisleriot/plait.scm.h:2 msgid "Move the ~a to an empty field" #: aisleriot/sol.scm.h:23 msgid "~a of ~a" These ones seems weird. What's with the ~a? Is it some variable? Would it be possible to somehow use regular C printf-style syntax instead? #: aisleriot/first_law.scm.h:2 msgid "Remove the " This one still seems to be concatenated.
In answer to the ~a question, I've already posted an answer to the gnome-i18 list (as you have noticed). The reason for ~a rather than %s is that that is what the standard guile (and common lisp) format module uses. In principle I could copy the module into aisleriot and mutilate it to change the format character, but I'd prefer not to do anything so ugly unless translators get seriously confused. I missed that first law string, thanks. Given that I fixed the code immediately below that one this is brown paper bag territory. Marking as fixed again, feel free to reopen if new issues crop up.
The "~a of ~a" string in sol.scm still has the issue I mentioned in my original comment: "Queen of Hearts" is translated (into Swedish) to "hjärter dam", where hjärter is Hearts and dam is Queen. This is exactly the case here. Is there any support for reordering arguments to guile's "format"? If there is, can this be put in a comment that will appear in the po file?
Martin, I explained how to get around the reordering in a message to gnome-18n. In short if you want to reorder the string, use something like "~1*~a of ~@*~a~1*". This is documented in the source, I'm not sure how to get it into the po file. Hopefully it will be irrelevant since there are other problems that have cropped up and I'm just going to put all 54 combinations of card and suit into separate strings for translation (not tonight though). In short, aisleriot is a mess with respect to i18n. Keep yelling at me until I get it right.
This bug is being reassigned to the "general" component so we can close the aisleriot bugzilla component. Apologies for the mass email!