Code

r10820@tres: ted | 2006-01-29 16:56:50 -0800
authorgouldtj <gouldtj@users.sourceforge.net>
Mon, 30 Jan 2006 05:12:51 +0000 (05:12 +0000)
committergouldtj <gouldtj@users.sourceforge.net>
Mon, 30 Jan 2006 05:12:51 +0000 (05:12 +0000)
 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.

15 files changed:
src/extension/internal/bluredge.cpp
src/extension/internal/clear-n_.h [new file with mode: 0644]
src/extension/internal/eps-out.cpp
src/extension/internal/gdkpixbuf-input.cpp
src/extension/internal/gimpgrad.cpp
src/extension/internal/gnome.cpp
src/extension/internal/grid.cpp
src/extension/internal/latex-pstricks-out.cpp
src/extension/internal/latex-pstricks.cpp
src/extension/internal/pov-out.cpp
src/extension/internal/ps-out.cpp
src/extension/internal/ps.cpp
src/extension/internal/svg.cpp
src/extension/internal/svgz.cpp
src/extension/internal/win32.cpp

index 3f230439a4e868352fb21412d30b082ccf6be663..3ae78b91fcbdb23750acc6c7932dbb6353649c8b 100644 (file)
@@ -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 (file)
index 0000000..21017f9
--- /dev/null
@@ -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 :
index 849f9cfa436c1acfc086ddbe7b47e311a8dfd7eb..c6feac8d49de49e78b723be7ab68c07ce73cf79e 100644 (file)
@@ -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());
 
index ee9fc408637de5e03e1622bcf647026d5b147add..34e6c09fd3d42ecf61c95827336f779ec7e5cd9e 100644 (file)
@@ -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"
index 9560c5df6e55e2fbedb682ffbb892bb0adcd3a5f..ac3b807d14411dcf5120c3e7aa735a0bffbacf18 100644 (file)
@@ -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;
index d81dfa95e65f36a27220e9d7aa817383c88b6948..adeb36ef657107b5d137a7dd3437ceff633c98b5 100644 (file)
@@ -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());
index f74c652aa20f7f870d39c453c7a41bbf3121f2f2..e37aa977446acb51f993e77c41049be7fb9af5b7 100644 (file)
@@ -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;
index d9db73fe6948f811a4ede122600af2b53071a2a5..eaab462c79a7d3c17f0a62403ef84a56fa8e6588 100644 (file)
@@ -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());
 
index 90a2128b6f9132d0e227a6f96fac85a42c1d88c4..3c3cf6682dc25ce1f5288ac848810f44f568e888 100644 (file)
@@ -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"
index 29d6d48d5a02c8b91191d1e6ed1fc7b55aa029a6..05811604038f727e39f842ed5eb65e044b463e0e 100644 (file)
@@ -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());
index a41b900070f985f0eec741dc9f95d2119688d652..31f5f241ec683b7810c2a1d6b9c4252c76685525 100644 (file)
@@ -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());
 
index 2b3103f40a7e7ba52cfcc1101803bcb820c64417..b2675c3e7d1c5a8d2d835959c47b742555180a66 100644 (file)
@@ -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"
index e6d02b62dbf5db759328d644dcaa2135267f4398..5f8517c3d33fcfd8905d3ec99b38d95b232b552b 100644 (file)
@@ -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());
 
index d56ac31b29adf6ab808d1625e973525ad3f6da95..49d37f082e83d3db804685778465f2b8ca13d8e3 100644 (file)
@@ -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());
 
index 7f1774d21e65f3182a5927abb2036c206e988319..335a77a09c1c18db71f14fdee6543174ecd4cfa6 100644 (file)
@@ -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"