From: gouldtj Date: Mon, 30 Jan 2006 05:12:51 +0000 (+0000) Subject: r10820@tres: ted | 2006-01-29 16:56:50 -0800 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=a6988c83e9af8585b15319bf204be9382260b739;p=inkscape.git 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. --- 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( "\n" - "Blur Edge\n" + "" N_("Blur Edge") "\n" "org.inkscape.effect.bluredge\n" - "1.0\n" - "11\n" + "1.0\n" + "11\n" "\n" "all\n" + "\n" + "\n" + "\n" "\n" "\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 + * + * 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( "\n" - "Encapsulated Postscript Output\n" + "" N_("Encapsulated Postscript Output") "\n" "org.inkscape.output.eps\n" - "FALSE\n" - "TRUE\n" + "FALSE\n" + "TRUE\n" "\n" ".eps\n" "image/x-e-postscript\n" - "Encapsulated Postscript (*.eps)\n" - "Encapsulated Postscript File\n" + "" N_("Encapsulated Postscript (*.eps)") "\n" + "" N_("Encapsulated Postscript File") "\n" "\n" "", 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( "\n" - "%s GDK pixbuf Input\n" + "" N_("%s GDK pixbuf Input") "\n" "org.inkscape.input.gdkpixbuf.%s\n" "\n" ".%s\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( "\n" - "GIMP Gradients\n" + "" N_("GIMP Gradients") "\n" "org.inkscape.input.gimpgrad\n" - "gimpgrad\n" "\n" ".ggr\n" "application/x-gimp-gradient\n" - "GIMP Gradient (*.ggr)\n" - "Gradients used in GIMP\n" + "" N_("GIMP Gradient (*.ggr)") "\n" + "" N_("Gradients used in GIMP") "\n" "\n" "\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( "\n" - "GNOME Print\n" + "" N_("GNOME Print") "\n" "" SP_MODULE_KEY_PRINT_GNOME "\n" "\n" "", 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( "\n" - "Grid\n" + "" N_("Grid") "\n" "org.inkscape.effect.grid\n" "1.0\n" "10.0\n" @@ -251,6 +253,9 @@ Grid::init (void) "5.0\n" "\n" "all\n" + "\n" + "\n" + "\n" "\n" "\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( "\n" - "LaTeX Output\n" + "" N_("LaTeX Output") "\n" "org.inkscape.output.latex\n" "\n" ".tex\n" "text/plain\n" - "LaTeX With PSTricks macros (*.tex)\n" - "LaTeX PSTricks File\n" + "" N_("LaTeX With PSTricks macros (*.tex)") "\n" + "" N_("LaTeX PSTricks File") "\n" "\n" "", 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( "\n" - "LaTeX Print\n" + "" N_("LaTeX Print") "\n" "" SP_MODULE_KEY_PRINT_LATEX "\n" "\n" "TRUE\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( "\n" - "PovRay Output\n" + "" N_("PovRay Output") "\n" "org.inkscape.output.pov\n" "\n" ".pov\n" "text/x-povray-script\n" - "PovRay (*.pov) (export splines)\n" - "PovRay Raytracer File\n" + "" N_("PovRay (*.pov) (export splines)") "\n" + "" N_("PovRay Raytracer File") "\n" "\n" "", 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( "\n" - "Postscript Output\n" + "" N_("Postscript Output") "\n" "org.inkscape.output.ps\n" - "true\n" + "true\n" "\n" ".ps\n" "image/x-postscript\n" - "Postscript (*.ps)\n" - "Postscript File\n" + "" N_("Postscript (*.ps)") "\n" + "" N_("Postscript File") "\n" "\n" "", 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( "\n" - "Postscript Print\n" + "" N_("Postscript Print") "\n" "" SP_MODULE_KEY_PRINT_PS "\n" "FALSE\n" "72\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( "\n" - "SVG Input\n" + "" N_("SVG Input") "\n" "" SP_MODULE_KEY_INPUT_SVG "\n" "\n" ".svg\n" "image/x-svg\n" - "Scalable Vector Graphic (*.svg)\n" - "Inkscape native file format and W3C standard\n" + "" N_("Scalable Vector Graphic (*.svg)") "\n" + "" N_("Inkscape native file format and W3C standard") "\n" "" SP_MODULE_KEY_OUTPUT_SVG_INKSCAPE "\n" "\n" "", new Svg()); @@ -63,13 +65,13 @@ Svg::init(void) /* SVG out Inkscape */ ext = Inkscape::Extension::build_from_mem( "\n" - "SVG Output Inkscape\n" + "" N_("SVG Output Inkscape") "\n" "" SP_MODULE_KEY_OUTPUT_SVG_INKSCAPE "\n" "\n" ".svg\n" "image/x-svg\n" - "Inkscape SVG (*.svg)\n" - "SVG format with Inkscape extensions\n" + "" N_("Inkscape SVG (*.svg)") "\n" + "" N_("SVG format with Inkscape extensions") "\n" "FALSE\n" "\n" "", new Svg()); @@ -77,13 +79,13 @@ Svg::init(void) /* SVG out */ ext = Inkscape::Extension::build_from_mem( "\n" - "SVG Output\n" + "" N_("SVG Output") "\n" "" SP_MODULE_KEY_OUTPUT_SVG "\n" "\n" ".svg\n" "image/x-svg\n" - "Plain SVG (*.svg)\n" - "Scalable Vector Graphics format as defined by the W3C\n" + "" N_("Plain SVG (*.svg)") "\n" + "" N_("Scalable Vector Graphics format as defined by the W3C") "\n" "\n" "", 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( "\n" - "SVGZ Input\n" + "" N_("SVGZ Input") "\n" "" SP_MODULE_KEY_INPUT_SVGZ "\n" "" SP_MODULE_KEY_INPUT_SVG "\n" "\n" ".svgz\n" "image/x-svgz\n" - "Compressed Inkscape SVG (*.svgz)\n" - "SVG file format compressed with GZip\n" + "" N_("Compressed Inkscape SVG (*.svgz)") "\n" + "" N_("SVG file format compressed with GZip") "\n" "" SP_MODULE_KEY_OUTPUT_SVGZ_INKSCAPE "\n" "\n" "", new Svgz()); @@ -57,13 +59,13 @@ Svgz::init(void) /* SVGZ out Inkscape */ ext = Inkscape::Extension::build_from_mem( "\n" - "SVGZ Output\n" + "" N_("SVGZ Output") "\n" "" SP_MODULE_KEY_OUTPUT_SVGZ_INKSCAPE "\n" "\n" ".svgz\n" "image/x-svgz\n" - "Compressed Inkscape SVG (*.svgz)\n" - "Inkscape's native file format compressed with GZip\n" + "" N_("Compressed Inkscape SVG (*.svgz)") "\n" + "" N_("Inkscape's native file format compressed with GZip") "\n" "FALSE\n" "\n" "", new Svgz()); @@ -71,13 +73,13 @@ Svgz::init(void) /* SVGZ out */ ext = Inkscape::Extension::build_from_mem( "\n" - "SVGZ Output\n" + "" N_("SVGZ Output") "\n" "" SP_MODULE_KEY_OUTPUT_SVGZ "\n" "\n" ".svgz\n" "image/x-svgz\n" - "Compressed plain SVG (*.svgz)\n" - "Scalable Vector Graphics format compressed with GZip\n" + "" N_("Compressed plain SVG (*.svgz)") "\n" + "" N_("Scalable Vector Graphics format compressed with GZip") "\n" "\n" "\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( "\n" - "Windows 32-bit Print\n" + "" N_("Windows 32-bit Print") "\n" "" SP_MODULE_KEY_PRINT_WIN32 "\n" "TRUE\n" "\n"