Strings to translate in bitmap effects.
Hi!
I was trying to review bitmap effects and found two where translation is not used properly.
In /src/extension/internal/bitmap there are two files: addNoise.cpp and channel.cpp where strings are properly marked for translation (and thus are in the .po files) but do not appear to be used. I thought it would be nice to fix this for 0.46 since the strings are already there but I can't trace where the XML is used to create the UI. It seems like the items for Combo Box are not being created with a call to gettext.
This could potentially benefit more then just those two effects and would also allow for the combox box items in the idx files to be translatable.
Regards, -- Marcin Floryan http://marcin.floryan.pl/ [GPG Key ID: 0D5581C5]
On Tue, Feb 26, 2008 at 11:22:16AM +0100, Marcin Floryan wrote:
Hi!
I was trying to review bitmap effects and found two where translation is not used properly.
In /src/extension/internal/bitmap there are two files: addNoise.cpp and channel.cpp where strings are properly marked for translation (and thus are in the .po files) but do not appear to be used. I thought it would be nice to fix this for 0.46 since the strings are already there but I can't trace where the XML is used to create the UI. It seems like the items for Combo Box are not being created with a call to gettext.
This could potentially benefit more then just those two effects and would also allow for the combox box items in the idx files to be translatable.
If it fixes a detectable bug in the UI, and requires no string changes, it would definitely be a candidate for inclusion. However, if it turns out that further work is needed to get things hooked up properly, it would be best to leave for 0.46.1 or 0.47.
Bryce
On Tue, Feb 26, 2008 at 10:51:48AM -0800, Bryce Harrington wrote:
Bryce,
I was trying to review bitmap effects and found two where translation is not used properly.
This could potentially benefit more then just those two effects and would also allow for the combox box items in the idx files to be translatable.
If it fixes a detectable bug in the UI, and requires no string changes, it would definitely be a candidate for inclusion. However, if it turns out that further work is needed to get things hooked up properly, it would be best to leave for 0.46.1 or 0.47.
I found the culprit and created a patch (attached). I hesitated for a moment as to where to fix the problem, since there are two ways of doing it (in paramenum.cpp and in the extensions files). Since I don't know the reasons behind the particular line in the former I fixed the latter. Should help.
PS. I have a feeling more could be fixed as it seems translations are ignored in some other places for internal (cpp) extensions, but I can see into that as a next step.
Regards, -- Marcin Floryan http://marcin.floryan.pl/ [GPG Key ID: 0D5581C5]
Thanks, applied.
Bryce
On Fri, Feb 29, 2008 at 12:01:28PM +0100, Marcin Floryan wrote:
On Tue, Feb 26, 2008 at 10:51:48AM -0800, Bryce Harrington wrote:
Bryce,
I was trying to review bitmap effects and found two where translation is not used properly.
This could potentially benefit more then just those two effects and would also allow for the combox box items in the idx files to be translatable.
If it fixes a detectable bug in the UI, and requires no string changes, it would definitely be a candidate for inclusion. However, if it turns out that further work is needed to get things hooked up properly, it would be best to leave for 0.46.1 or 0.47.
I found the culprit and created a patch (attached). I hesitated for a moment as to where to fix the problem, since there are two ways of doing it (in paramenum.cpp and in the extensions files). Since I don't know the reasons behind the particular line in the former I fixed the latter. Should help.
PS. I have a feeling more could be fixed as it seems translations are ignored in some other places for internal (cpp) extensions, but I can see into that as a next step.
Regards,
Marcin Floryan http://marcin.floryan.pl/ [GPG Key ID: 0D5581C5]
Index: src/extension/internal/bitmap/addNoise.cpp
--- src/extension/internal/bitmap/addNoise.cpp (revision 17565) +++ src/extension/internal/bitmap/addNoise.cpp (working copy) @@ -44,12 +44,12 @@ "<name>" N_("Add Noise") "</name>\n" "<id>org.inkscape.effect.bitmap.addNoise</id>\n" "<param name="noiseType" gui-text="" N_("Type") "" type="enum" >\n"
"<item value='Uniform Noise'>" N_("Uniform Noise") "</item>\n"
"<item value='Gaussian Noise'>" N_("Gaussian Noise") "</item>\n"
"<item value='Multiplicative Gaussian Noise'>" N_("Multiplicative Gaussian Noise") "</item>\n"
"<item value='Impulse Noise'>" N_("Impulse Noise") "</item>\n"
"<item value='Laplacian Noise'>" N_("Laplacian Noise") "</item>\n"
"<item value='Poisson Noise'>" N_("Poisson Noise") "</item>\n"
"<_item value='Uniform Noise'>" N_("Uniform Noise") "</_item>\n"
"<_item value='Gaussian Noise'>" N_("Gaussian Noise") "</_item>\n"
"<_item value='Multiplicative Gaussian Noise'>" N_("Multiplicative Gaussian Noise") "</_item>\n"
"<_item value='Impulse Noise'>" N_("Impulse Noise") "</_item>\n"
"<_item value='Laplacian Noise'>" N_("Laplacian Noise") "</_item>\n"
"<_item value='Poisson Noise'>" N_("Poisson Noise") "</_item>\n" "</param>\n" "<effect>\n" "<object-type>all</object-type>\n"
Index: src/extension/internal/bitmap/channel.cpp
--- src/extension/internal/bitmap/channel.cpp (revision 17565) +++ src/extension/internal/bitmap/channel.cpp (working copy) @@ -47,15 +47,15 @@ "<name>" N_("Channel") "</name>\n" "<id>org.inkscape.effect.bitmap.channel</id>\n" "<param name="layer" gui-text="" N_("Layer") "" type="enum" >\n"
"<item value='Red Channel'>" N_("Red Channel") "</item>\n"
"<item value='Green Channel'>" N_("Green Channel") "</item>\n"
"<item value='Blue Channel'>" N_("Blue Channel") "</item>\n"
"<item value='Cyan Channel'>" N_("Cyan Channel") "</item>\n"
"<item value='Magenta Channel'>" N_("Magenta Channel") "</item>\n"
"<item value='Yellow Channel'>" N_("Yellow Channel") "</item>\n"
"<item value='Black Channel'>" N_("Black Channel") "</item>\n"
"<item value='Opacity Channel'>" N_("Opacity Channel") "</item>\n"
"<item value='Matte Channel'>" N_("Matte Channel") "</item>\n"
"<_item value='Red Channel'>" N_("Red Channel") "</_item>\n"
"<_item value='Green Channel'>" N_("Green Channel") "</_item>\n"
"<_item value='Blue Channel'>" N_("Blue Channel") "</_item>\n"
"<_item value='Cyan Channel'>" N_("Cyan Channel") "</_item>\n"
"<_item value='Magenta Channel'>" N_("Magenta Channel") "</_item>\n"
"<_item value='Yellow Channel'>" N_("Yellow Channel") "</_item>\n"
"<_item value='Black Channel'>" N_("Black Channel") "</_item>\n"
"<_item value='Opacity Channel'>" N_("Opacity Channel") "</_item>\n"
"<_item value='Matte Channel'>" N_("Matte Channel") "</_item>\n" "</param>\n" "<effect>\n" "<object-type>all</object-type>\n"
Index: src/extension/internal/bitmap/levelChannel.cpp
--- src/extension/internal/bitmap/levelChannel.cpp (revision 17565) +++ src/extension/internal/bitmap/levelChannel.cpp (working copy) @@ -51,15 +51,15 @@ "<name>" N_("Level (with Channel)") "</name>\n" "<id>org.inkscape.effect.bitmap.levelChannel</id>\n" "<param name="channel" gui-text="" N_("Channel") "" type="enum" >\n"
"<item value='Red Channel'>" N_("Red Channel") "</item>\n"
"<item value='Green Channel'>" N_("Green Channel") "</item>\n"
"<item value='Blue Channel'>" N_("Blue Channel") "</item>\n"
"<item value='Cyan Channel'>" N_("Cyan Channel") "</item>\n"
"<item value='Magenta Channel'>" N_("Magenta Channel") "</item>\n"
"<item value='Yellow Channel'>" N_("Yellow Channel") "</item>\n"
"<item value='Black Channel'>" N_("Black Channel") "</item>\n"
"<item value='Opacity Channel'>" N_("Opacity Channel") "</item>\n"
"<item value='Matte Channel'>" N_("Matte Channel") "</item>\n"
"<_item value='Red Channel'>" N_("Red Channel") "</_item>\n"
"<_item value='Green Channel'>" N_("Green Channel") "</_item>\n"
"<_item value='Blue Channel'>" N_("Blue Channel") "</_item>\n"
"<_item value='Cyan Channel'>" N_("Cyan Channel") "</_item>\n"
"<_item value='Magenta Channel'>" N_("Magenta Channel") "</_item>\n"
"<_item value='Yellow Channel'>" N_("Yellow Channel") "</_item>\n"
"<_item value='Black Channel'>" N_("Black Channel") "</_item>\n"
"<_item value='Opacity Channel'>" N_("Opacity Channel") "</_item>\n"
"<_item value='Matte Channel'>" N_("Matte Channel") "</_item>\n" "</param>\n" "<param name=\"blackPoint\" gui-text=\"" N_("Black Point") "\" type=\"float\" min=\"0.0\" max=\"100.0\">0.0</param>\n" "<param name=\"whitePoint\" gui-text=\"" N_("White Point") "\" type=\"float\" min=\"0.0\" max=\"100.0\">100.0</param>\n"
Index: src/extension/internal/cairo-pdf-out.cpp
--- src/extension/internal/cairo-pdf-out.cpp (revision 17565) +++ src/extension/internal/cairo-pdf-out.cpp (working copy) @@ -171,7 +171,7 @@ "<name>" N_("Cairo PDF Output") "</name>\n" "<id>org.inkscape.output.pdf.cairo</id>\n" "<param name="PDFversion" gui-text="" N_("Restrict to PDF version") "" type="enum" >\n"
"<item value='PDF14'>" N_("PDF 1.4") "</item>\n"
"<_item value='PDF14'>" N_("PDF 1.4") "</_item>\n" "</param>\n" "<param name=\"textToPath\" gui-text=\"" N_("Convert texts to paths") "\" type=\"boolean\">false</param>\n" "<param name=\"blurToBitmap\" gui-text=\"" N_("Convert blur effects to bitmaps") "\" type=\"boolean\">false</param>\n"
Index: src/extension/internal/cairo-ps-out.cpp
--- src/extension/internal/cairo-ps-out.cpp (revision 17565) +++ src/extension/internal/cairo-ps-out.cpp (working copy) @@ -222,9 +222,9 @@ "<name>" N_("Cairo PS Output") "</name>\n" "<id>" SP_MODULE_KEY_PRINT_CAIRO_PS "</id>\n" "<param name="PSlevel" gui-text="" N_("Restrict to PS level") "" type="enum" >\n"
"<item value='PS3'>" N_("PostScript level 3") "</item>\n"
"<_item value='PS3'>" N_("PostScript level 3") "</_item>\n"
#if (CAIRO_VERSION >= CAIRO_VERSION_ENCODE(1, 5, 2))
"<item value='PS2'>" N_("PostScript level 2") "</item>\n"
"<_item value='PS2'>" N_("PostScript level 2") "</_item>\n"
#endif "</param>\n" "<param name="textToPath" gui-text="" N_("Convert texts to paths") "" type="boolean">false</param>\n" Index: src/extension/paramenum.cpp =================================================================== --- src/extension/paramenum.cpp (revision 17565) +++ src/extension/paramenum.cpp (working copy) @@ -77,6 +77,8 @@ const char * contents = sp_repr_children(child_repr)->content(); if (contents != NULL) // don't translate when 'item' but do translate when '_item'
// NOTE: internal extensions use build_from_mem and don't need _item but
// still need to include if are to be localized newguitext = new Glib::ustring( !strcmp(chname, "_item") ? _(contents) : contents ); else continue;
participants (2)
-
Bryce Harrington
-
Marcin Floryan