diff options
| author | Ted Gould <ted@gould.cx> | 2006-01-30 05:12:51 +0000 |
|---|---|---|
| committer | gouldtj <gouldtj@users.sourceforge.net> | 2006-01-30 05:12:51 +0000 |
| commit | d797170d50c65d8791198c709359b58af8d974fd (patch) | |
| tree | af8ef32d16e6fe13e42cfb71a062af7fee4f0084 /src | |
| parent | r10819@tres: ted | 2006-01-29 16:08:29 -0800 (diff) | |
| download | inkscape-d797170d50c65d8791198c709359b58af8d974fd.tar.gz inkscape-d797170d50c65d8791198c709359b58af8d974fd.zip | |
r10820@tres: ted | 2006-01-29 16:56:50 -0800
Making it so all the important strings in the INX files are
translateable. Also added in a 'clear-n_.h' to change the N_() macro
from an inline function to a pure macro.
Lastly, added in submenus for the effects.
(bzr r55)
Diffstat (limited to 'src')
| -rw-r--r-- | src/extension/internal/bluredge.cpp | 11 | ||||
| -rw-r--r-- | src/extension/internal/clear-n_.h | 32 | ||||
| -rw-r--r-- | src/extension/internal/eps-out.cpp | 12 | ||||
| -rw-r--r-- | src/extension/internal/gdkpixbuf-input.cpp | 3 | ||||
| -rw-r--r-- | src/extension/internal/gimpgrad.cpp | 9 | ||||
| -rw-r--r-- | src/extension/internal/gnome.cpp | 4 | ||||
| -rw-r--r-- | src/extension/internal/grid.cpp | 7 | ||||
| -rw-r--r-- | src/extension/internal/latex-pstricks-out.cpp | 8 | ||||
| -rw-r--r-- | src/extension/internal/latex-pstricks.cpp | 4 | ||||
| -rw-r--r-- | src/extension/internal/pov-out.cpp | 8 | ||||
| -rw-r--r-- | src/extension/internal/ps-out.cpp | 10 | ||||
| -rw-r--r-- | src/extension/internal/ps.cpp | 4 | ||||
| -rw-r--r-- | src/extension/internal/svg.cpp | 20 | ||||
| -rw-r--r-- | src/extension/internal/svgz.cpp | 20 | ||||
| -rw-r--r-- | src/extension/internal/win32.cpp | 4 |
15 files changed, 110 insertions, 46 deletions
diff --git a/src/extension/internal/bluredge.cpp b/src/extension/internal/bluredge.cpp index 3f230439a..3ae78b91f 100644 --- a/src/extension/internal/bluredge.cpp +++ b/src/extension/internal/bluredge.cpp @@ -125,17 +125,22 @@ BlurEdge::prefs_effect(Inkscape::Extension::Effect * module, Inkscape::UI::View: return module->autogui(); } +#include "clear-n_.h" + void BlurEdge::init (void) { Inkscape::Extension::build_from_mem( "<inkscape-extension>\n" - "<name>Blur Edge</name>\n" + "<name>" N_("Blur Edge") "</name>\n" "<id>org.inkscape.effect.bluredge</id>\n" - "<param name=\"blur-width\" gui-text=\"Blur Width\" type=\"float\" min=\"1.0\" max=\"50.0\">1.0</param>\n" - "<param name=\"num-steps\" gui-text=\"Number of Steps\" type=\"int\" min=\"5\" max=\"100\">11</param>\n" + "<param name=\"blur-width\" gui-text=\"" N_("Blur Width") "\" type=\"float\" min=\"1.0\" max=\"50.0\">1.0</param>\n" + "<param name=\"num-steps\" gui-text=\"" N_("Number of Steps") "\" type=\"int\" min=\"5\" max=\"100\">11</param>\n" "<effect>\n" "<object-type>all</object-type>\n" + "<effects-menu>\n" + "<submenu name=\"" N_("Enhance Path") "\" />\n" + "</effects-menu>\n" "</effect>\n" "</inkscape-extension>\n" , new BlurEdge()); return; diff --git a/src/extension/internal/clear-n_.h b/src/extension/internal/clear-n_.h new file mode 100644 index 000000000..21017f9dd --- /dev/null +++ b/src/extension/internal/clear-n_.h @@ -0,0 +1,32 @@ +/** + \file clear-n_.h + + A way to clear the N_ macro, which is defined as an inline function. + Unfortunately, this makes it so it is hard to use in static strings + where you only want to translate a small part. Including this + turns it back into a a macro. +*/ +/* + * Authors: + * Ted Gould <ted@gould.cx> + * + * Copyright (C) 2006 Authors + * + * Released under GNU GPL, read the file 'COPYING' for more information + */ + +#ifdef N_ +#undef N_ +#endif +#define N_(x) x + +/* + Local Variables: + mode:c++ + c-file-style:"stroustrup" + c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +)) + indent-tabs-mode:nil + fill-column:99 + End: +*/ +// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4 : diff --git a/src/extension/internal/eps-out.cpp b/src/extension/internal/eps-out.cpp index 849f9cfa4..c6feac8d4 100644 --- a/src/extension/internal/eps-out.cpp +++ b/src/extension/internal/eps-out.cpp @@ -67,6 +67,8 @@ EpsOutput::save (Inkscape::Extension::Output *mod, SPDocument *doc, const gchar return; } +#include "clear-n_.h" + /** \brief A function allocate a copy of this function. @@ -79,15 +81,15 @@ EpsOutput::init (void) { Inkscape::Extension::build_from_mem( "<inkscape-extension>\n" - "<name>Encapsulated Postscript Output</name>\n" + "<name>" N_("Encapsulated Postscript Output") "</name>\n" "<id>org.inkscape.output.eps</id>\n" - "<param name=\"pageBoundingBox\" type=\"boolean\" gui-text=\"Make bounding box around full page\">FALSE</param>\n" - "<param name=\"textToPath\" type=\"boolean\" gui-text=\"Convert text to path\">TRUE</param>\n" + "<param name=\"pageBoundingBox\" type=\"boolean\" gui-text=\"" N_("Make bounding box around full page") "\">FALSE</param>\n" + "<param name=\"textToPath\" type=\"boolean\" gui-text=\"" N_("Convert text to path") "\">TRUE</param>\n" "<output>\n" "<extension>.eps</extension>\n" "<mimetype>image/x-e-postscript</mimetype>\n" - "<filetypename>Encapsulated Postscript (*.eps)</filetypename>\n" - "<filetypetooltip>Encapsulated Postscript File</filetypetooltip>\n" + "<filetypename>" N_("Encapsulated Postscript (*.eps)") "</filetypename>\n" + "<filetypetooltip>" N_("Encapsulated Postscript File") "</filetypetooltip>\n" "</output>\n" "</inkscape-extension>", new EpsOutput()); diff --git a/src/extension/internal/gdkpixbuf-input.cpp b/src/extension/internal/gdkpixbuf-input.cpp index ee9fc4086..34e6c09fd 100644 --- a/src/extension/internal/gdkpixbuf-input.cpp +++ b/src/extension/internal/gdkpixbuf-input.cpp @@ -97,6 +97,7 @@ GdkpixbufInput::open(Inkscape::Extension::Input *mod, char const *uri) return doc; } +#include "clear-n_.h" void GdkpixbufInput::init(void) @@ -131,7 +132,7 @@ GdkpixbufInput::init(void) gchar *xmlString = g_strdup_printf( "<inkscape-extension>\n" - "<name>%s GDK pixbuf Input</name>\n" + "<name>" N_("%s GDK pixbuf Input") "</name>\n" "<id>org.inkscape.input.gdkpixbuf.%s</id>\n" "<input>\n" "<extension>.%s</extension>\n" diff --git a/src/extension/internal/gimpgrad.cpp b/src/extension/internal/gimpgrad.cpp index 9560c5df6..ac3b807d1 100644 --- a/src/extension/internal/gimpgrad.cpp +++ b/src/extension/internal/gimpgrad.cpp @@ -201,19 +201,20 @@ GimpGrad::open (Inkscape::Extension::Input *module, gchar const *filename) return sp_document_new_from_mem(outsvg.c_str(), outsvg.length(), TRUE); } +#include "clear-n_.h" + void GimpGrad::init (void) { Inkscape::Extension::build_from_mem( "<inkscape-extension>\n" - "<name>GIMP Gradients</name>\n" + "<name>" N_("GIMP Gradients") "</name>\n" "<id>org.inkscape.input.gimpgrad</id>\n" - "<dependency type=\"plugin\" location=\"plugins\">gimpgrad</dependency>\n" "<input>\n" "<extension>.ggr</extension>\n" "<mimetype>application/x-gimp-gradient</mimetype>\n" - "<filetypename>GIMP Gradient (*.ggr)</filetypename>\n" - "<filetypetooltip>Gradients used in GIMP</filetypetooltip>\n" + "<filetypename>" N_("GIMP Gradient (*.ggr)") "</filetypename>\n" + "<filetypetooltip>" N_("Gradients used in GIMP") "</filetypetooltip>\n" "</input>\n" "</inkscape-extension>\n", new GimpGrad()); return; diff --git a/src/extension/internal/gnome.cpp b/src/extension/internal/gnome.cpp index d81dfa95e..adeb36ef6 100644 --- a/src/extension/internal/gnome.cpp +++ b/src/extension/internal/gnome.cpp @@ -388,6 +388,8 @@ PrintGNOME::image (Inkscape::Extension::Print *mod, unsigned char *px, unsigned return 0; } +#include "clear-n_.h" + void PrintGNOME::init (void) { @@ -396,7 +398,7 @@ PrintGNOME::init (void) /* SVG in */ ext = Inkscape::Extension::build_from_mem( "<inkscape-extension>\n" - "<name>GNOME Print</name>\n" + "<name>" N_("GNOME Print") "</name>\n" "<id>" SP_MODULE_KEY_PRINT_GNOME "</id>\n" "<print/>\n" "</inkscape-extension>", new PrintGNOME()); diff --git a/src/extension/internal/grid.cpp b/src/extension/internal/grid.cpp index f74c652aa..e37aa9774 100644 --- a/src/extension/internal/grid.cpp +++ b/src/extension/internal/grid.cpp @@ -237,12 +237,14 @@ Grid::prefs_effect(Inkscape::Extension::Effect *module, Inkscape::UI::View::View return vbox; } +#include "clear-n_.h" + void Grid::init (void) { Inkscape::Extension::build_from_mem( "<inkscape-extension>\n" - "<name>Grid</name>\n" + "<name>" N_("Grid") "</name>\n" "<id>org.inkscape.effect.grid</id>\n" "<param name=\"lineWidth\" type=\"float\">1.0</param>\n" "<param name=\"xspacing\" type=\"float\">10.0</param>\n" @@ -251,6 +253,9 @@ Grid::init (void) "<param name=\"yoffset\" type=\"float\">5.0</param>\n" "<effect>\n" "<object-type>all</object-type>\n" + "<effects-menu>\n" + "<submenu name=\"" N_("Render") "\" />\n" + "</effects-menu>\n" "</effect>\n" "</inkscape-extension>\n", new Grid()); return; diff --git a/src/extension/internal/latex-pstricks-out.cpp b/src/extension/internal/latex-pstricks-out.cpp index d9db73fe6..eaab462c7 100644 --- a/src/extension/internal/latex-pstricks-out.cpp +++ b/src/extension/internal/latex-pstricks-out.cpp @@ -89,6 +89,8 @@ LatexOutput::save (Inkscape::Extension::Output *mod2, SPDocument *doc, const gch return; } +#include "clear-n_.h" + /** \brief A function allocate a copy of this function. @@ -101,13 +103,13 @@ LatexOutput::init (void) { Inkscape::Extension::build_from_mem( "<inkscape-extension>\n" - "<name>LaTeX Output</name>\n" + "<name>" N_("LaTeX Output") "</name>\n" "<id>org.inkscape.output.latex</id>\n" "<output>\n" "<extension>.tex</extension>\n" "<mimetype>text/plain</mimetype>\n" - "<filetypename>LaTeX With PSTricks macros (*.tex)</filetypename>\n" - "<filetypetooltip>LaTeX PSTricks File</filetypetooltip>\n" + "<filetypename>" N_("LaTeX With PSTricks macros (*.tex)") "</filetypename>\n" + "<filetypetooltip>" N_("LaTeX PSTricks File") "</filetypetooltip>\n" "</output>\n" "</inkscape-extension>", new LatexOutput()); diff --git a/src/extension/internal/latex-pstricks.cpp b/src/extension/internal/latex-pstricks.cpp index 90a2128b6..3c3cf6682 100644 --- a/src/extension/internal/latex-pstricks.cpp +++ b/src/extension/internal/latex-pstricks.cpp @@ -327,6 +327,8 @@ PrintLatex::textToPath(Inkscape::Extension::Print * ext) return ext->get_param_bool("textToPath"); } +#include "clear-n_.h" + void PrintLatex::init (void) { @@ -335,7 +337,7 @@ PrintLatex::init (void) /* SVG in */ ext = Inkscape::Extension::build_from_mem( "<inkscape-extension>\n" - "<name>LaTeX Print</name>\n" + "<name>" N_("LaTeX Print") "</name>\n" "<id>" SP_MODULE_KEY_PRINT_LATEX "</id>\n" "<param name=\"destination\" type=\"string\"></param>\n" "<param name=\"textToPath\" type=\"boolean\">TRUE</param>\n" diff --git a/src/extension/internal/pov-out.cpp b/src/extension/internal/pov-out.cpp index 29d6d48d5..058116040 100644 --- a/src/extension/internal/pov-out.cpp +++ b/src/extension/internal/pov-out.cpp @@ -439,6 +439,8 @@ PovOutput::save(Inkscape::Extension::Output *mod, SPDocument *doc, gchar const * fclose(f); } +#include "clear-n_.h" + /** * This is the definition of PovRay output. This function just * calls the extension system with the memory allocated XML that @@ -449,13 +451,13 @@ PovOutput::init() { Inkscape::Extension::build_from_mem( "<inkscape-extension>\n" - "<name>PovRay Output</name>\n" + "<name>" N_("PovRay Output") "</name>\n" "<id>org.inkscape.output.pov</id>\n" "<output>\n" "<extension>.pov</extension>\n" "<mimetype>text/x-povray-script</mimetype>\n" - "<filetypename>PovRay (*.pov) (export splines)</filetypename>\n" - "<filetypetooltip>PovRay Raytracer File</filetypetooltip>\n" + "<filetypename>" N_("PovRay (*.pov) (export splines)") "</filetypename>\n" + "<filetypetooltip>" N_("PovRay Raytracer File") "</filetypetooltip>\n" "</output>\n" "</inkscape-extension>", new PovOutput()); diff --git a/src/extension/internal/ps-out.cpp b/src/extension/internal/ps-out.cpp index a41b90007..31f5f241e 100644 --- a/src/extension/internal/ps-out.cpp +++ b/src/extension/internal/ps-out.cpp @@ -65,6 +65,8 @@ PsOutput::save (Inkscape::Extension::Output *mod, SPDocument *doc, const gchar * return; } +#include "clear-n_.h" + /** \brief A function allocate a copy of this function. @@ -77,14 +79,14 @@ PsOutput::init (void) { Inkscape::Extension::build_from_mem( "<inkscape-extension>\n" - "<name>Postscript Output</name>\n" + "<name>" N_("Postscript Output") "</name>\n" "<id>org.inkscape.output.ps</id>\n" - "<param name=\"textToPath\" gui-text=\"Text to Path\" type=\"boolean\">true</param>\n" + "<param name=\"textToPath\" gui-text=\"" N_("Text to Path") "\" type=\"boolean\">true</param>\n" "<output>\n" "<extension>.ps</extension>\n" "<mimetype>image/x-postscript</mimetype>\n" - "<filetypename>Postscript (*.ps)</filetypename>\n" - "<filetypetooltip>Postscript File</filetypetooltip>\n" + "<filetypename>" N_("Postscript (*.ps)") "</filetypename>\n" + "<filetypetooltip>" N_("Postscript File") "</filetypetooltip>\n" "</output>\n" "</inkscape-extension>", new PsOutput()); diff --git a/src/extension/internal/ps.cpp b/src/extension/internal/ps.cpp index 2b3103f40..b2675c3e7 100644 --- a/src/extension/internal/ps.cpp +++ b/src/extension/internal/ps.cpp @@ -1227,13 +1227,15 @@ PrintPS::textToPath(Inkscape::Extension::Print * ext) return ext->get_param_bool("textToPath"); } +#include "clear-n_.h" + void PrintPS::init(void) { /* SVG in */ (void) Inkscape::Extension::build_from_mem( "<inkscape-extension>\n" - "<name>Postscript Print</name>\n" + "<name>" N_("Postscript Print") "</name>\n" "<id>" SP_MODULE_KEY_PRINT_PS "</id>\n" "<param name=\"bitmap\" type=\"boolean\">FALSE</param>\n" "<param name=\"resolution\" type=\"string\">72</param>\n" diff --git a/src/extension/internal/svg.cpp b/src/extension/internal/svg.cpp index e6d02b62d..5f8517c3d 100644 --- a/src/extension/internal/svg.cpp +++ b/src/extension/internal/svg.cpp @@ -29,6 +29,8 @@ namespace Inkscape { namespace Extension { namespace Internal { +#include "clear-n_.h" + /** \return None \brief What would an SVG editor be without loading/saving SVG @@ -49,13 +51,13 @@ Svg::init(void) /* SVG in */ ext = Inkscape::Extension::build_from_mem( "<inkscape-extension>\n" - "<name>SVG Input</name>\n" + "<name>" N_("SVG Input") "</name>\n" "<id>" SP_MODULE_KEY_INPUT_SVG "</id>\n" "<input>\n" "<extension>.svg</extension>\n" "<mimetype>image/x-svg</mimetype>\n" - "<filetypename>Scalable Vector Graphic (*.svg)</filetypename>\n" - "<filetypetooltip>Inkscape native file format and W3C standard</filetypetooltip>\n" + "<filetypename>" N_("Scalable Vector Graphic (*.svg)") "</filetypename>\n" + "<filetypetooltip>" N_("Inkscape native file format and W3C standard") "</filetypetooltip>\n" "<output_extension>" SP_MODULE_KEY_OUTPUT_SVG_INKSCAPE "</output_extension>\n" "</input>\n" "</inkscape-extension>", new Svg()); @@ -63,13 +65,13 @@ Svg::init(void) /* SVG out Inkscape */ ext = Inkscape::Extension::build_from_mem( "<inkscape-extension>\n" - "<name>SVG Output Inkscape</name>\n" + "<name>" N_("SVG Output Inkscape") "</name>\n" "<id>" SP_MODULE_KEY_OUTPUT_SVG_INKSCAPE "</id>\n" "<output>\n" "<extension>.svg</extension>\n" "<mimetype>image/x-svg</mimetype>\n" - "<filetypename>Inkscape SVG (*.svg)</filetypename>\n" - "<filetypetooltip>SVG format with Inkscape extensions</filetypetooltip>\n" + "<filetypename>" N_("Inkscape SVG (*.svg)") "</filetypename>\n" + "<filetypetooltip>" N_("SVG format with Inkscape extensions") "</filetypetooltip>\n" "<dataloss>FALSE</dataloss>\n" "</output>\n" "</inkscape-extension>", new Svg()); @@ -77,13 +79,13 @@ Svg::init(void) /* SVG out */ ext = Inkscape::Extension::build_from_mem( "<inkscape-extension>\n" - "<name>SVG Output</name>\n" + "<name>" N_("SVG Output") "</name>\n" "<id>" SP_MODULE_KEY_OUTPUT_SVG "</id>\n" "<output>\n" "<extension>.svg</extension>\n" "<mimetype>image/x-svg</mimetype>\n" - "<filetypename>Plain SVG (*.svg)</filetypename>\n" - "<filetypetooltip>Scalable Vector Graphics format as defined by the W3C</filetypetooltip>\n" + "<filetypename>" N_("Plain SVG (*.svg)") "</filetypename>\n" + "<filetypetooltip>" N_("Scalable Vector Graphics format as defined by the W3C") "</filetypetooltip>\n" "</output>\n" "</inkscape-extension>", new Svg()); diff --git a/src/extension/internal/svgz.cpp b/src/extension/internal/svgz.cpp index d56ac31b2..49d37f082 100644 --- a/src/extension/internal/svgz.cpp +++ b/src/extension/internal/svgz.cpp @@ -22,6 +22,8 @@ namespace Inkscape { namespace Extension { namespace Internal { +#include "clear-n_.h" + /** \return None \brief What would an SVG editor be without loading/saving SVG @@ -42,14 +44,14 @@ Svgz::init(void) /* SVGZ in */ ext = Inkscape::Extension::build_from_mem( "<inkscape-extension>\n" - "<name>SVGZ Input</name>\n" + "<name>" N_("SVGZ Input") "</name>\n" "<id>" SP_MODULE_KEY_INPUT_SVGZ "</id>\n" "<dependency type=\"extension\">" SP_MODULE_KEY_INPUT_SVG "</dependency>\n" "<input>\n" "<extension>.svgz</extension>\n" "<mimetype>image/x-svgz</mimetype>\n" - "<filetypename>Compressed Inkscape SVG (*.svgz)</filetypename>\n" - "<filetypetooltip>SVG file format compressed with GZip</filetypetooltip>\n" + "<filetypename>" N_("Compressed Inkscape SVG (*.svgz)") "</filetypename>\n" + "<filetypetooltip>" N_("SVG file format compressed with GZip") "</filetypetooltip>\n" "<output_extension>" SP_MODULE_KEY_OUTPUT_SVGZ_INKSCAPE "</output_extension>\n" "</input>\n" "</inkscape-extension>", new Svgz()); @@ -57,13 +59,13 @@ Svgz::init(void) /* SVGZ out Inkscape */ ext = Inkscape::Extension::build_from_mem( "<inkscape-extension>\n" - "<name>SVGZ Output</name>\n" + "<name>" N_("SVGZ Output") "</name>\n" "<id>" SP_MODULE_KEY_OUTPUT_SVGZ_INKSCAPE "</id>\n" "<output>\n" "<extension>.svgz</extension>\n" "<mimetype>image/x-svgz</mimetype>\n" - "<filetypename>Compressed Inkscape SVG (*.svgz)</filetypename>\n" - "<filetypetooltip>Inkscape's native file format compressed with GZip</filetypetooltip>\n" + "<filetypename>" N_("Compressed Inkscape SVG (*.svgz)") "</filetypename>\n" + "<filetypetooltip>" N_("Inkscape's native file format compressed with GZip") "</filetypetooltip>\n" "<dataloss>FALSE</dataloss>\n" "</output>\n" "</inkscape-extension>", new Svgz()); @@ -71,13 +73,13 @@ Svgz::init(void) /* SVGZ out */ ext = Inkscape::Extension::build_from_mem( "<inkscape-extension>\n" - "<name>SVGZ Output</name>\n" + "<name>" N_("SVGZ Output") "</name>\n" "<id>" SP_MODULE_KEY_OUTPUT_SVGZ "</id>\n" "<output>\n" "<extension>.svgz</extension>\n" "<mimetype>image/x-svgz</mimetype>\n" - "<filetypename>Compressed plain SVG (*.svgz)</filetypename>\n" - "<filetypetooltip>Scalable Vector Graphics format compressed with GZip</filetypetooltip>\n" + "<filetypename>" N_("Compressed plain SVG (*.svgz)") "</filetypename>\n" + "<filetypetooltip>" N_("Scalable Vector Graphics format compressed with GZip") "</filetypetooltip>\n" "</output>\n" "</inkscape-extension>\n", new Svgz()); diff --git a/src/extension/internal/win32.cpp b/src/extension/internal/win32.cpp index 7f1774d21..335a77a09 100644 --- a/src/extension/internal/win32.cpp +++ b/src/extension/internal/win32.cpp @@ -477,6 +477,8 @@ PrintWin32::get_save_filename (unsigned char *dir, unsigned int *spns) return g_strdup (fnbuf); } +#include "clear-n_.h" + void PrintWin32::init (void) { @@ -485,7 +487,7 @@ PrintWin32::init (void) /* SVG in */ ext = Inkscape::Extension::build_from_mem( "<inkscape-extension>\n" - "<name>Windows 32-bit Print</name>\n" + "<name>" N_("Windows 32-bit Print") "</name>\n" "<id>" SP_MODULE_KEY_PRINT_WIN32 "</id>\n" "<param name=\"textToPath\" type=\"boolean\">TRUE</param>\n" "<print/>\n" |
