Re: [Tuxpaint-i18n] Lots of new Magic tools coming to 0.9.34!
An award-winning drawing program for children of all ages
Brought to you by:
wkendrick
|
From: Bill K. <nb...@so...> - 2024-10-08 04:40:29
|
On Tue, Oct 08, 2024 at 12:09:37AM +0200, Pere Pujal i Carabantes wrote:
> Hi Bill, and all,
>
> I started the Catalan update and noticed that translations for Fractal strings don't show up.
Yes, I was getting a bit complicated with the string
construction, and everything being returned as the "tool tip"
(description) was being wrapped in `gettext_noop()` instead
of `gettext()`.
This _normally_ works alright, surprisingly, because the
text rendering routine inside Tux Paint does its own call
to `gettext()` around the string it receives. But in this
case, it's a _constructed_ string, made out of the various
`sprintf()`'d string ("%s") parts, so by the time it gets
in there, the gettext routines don't recognize it.
I'm correcting that, and also making sure that all of the
magic tools _only_ use `gettext_noop()` when wrapping a
string inside an array, e.g.
char * my_descriptions[NUM_TOOLS] = {
gettext_noop("I am tool #1"),
gettext_noop("I am tool #2"),
};
And then when we return the string back to Tux Paint,
making sure `gettext()` (and NOT `gettext_noop()`) is
always used, e.g.:
return strdup(gettext(my_descriptions[which]));
This makes me worry that behavior might change, but it's
apparently been pretty messy and inconsistent all this
time anyway. :-/ So it's _probably_ fine...?
Please let me know if you notice any more oddness, though!
-bill!
PS - After playing with Sprials and Square Spirals, I'm
going to try and make two more tools which are variants:
Concentric Circles and Concentric Squares. Sorry for more
strings! ;-)
|