summaryrefslogtreecommitdiffstats
path: root/src/main.cpp
diff options
context:
space:
mode:
authorEduard Braun <eduard.braun2@gmx.de>2017-05-07 22:14:37 +0000
committerEduard Braun <eduard.braun2@gmx.de>2017-05-07 22:14:37 +0000
commitf5ab987943d3d54291dfe9369b7cb9855ddb7d8f (patch)
tree83420f2a77f02f0b093bf267d82c8970baabc14d /src/main.cpp
parentMove functions for switching gettext charset to helper/gettext.h (diff)
downloadinkscape-f5ab987943d3d54291dfe9369b7cb9855ddb7d8f.tar.gz
inkscape-f5ab987943d3d54291dfe9369b7cb9855ddb7d8f.zip
Properly handle ENABLE_NLS define
(bzr r15675.1.4)
Diffstat (limited to 'src/main.cpp')
-rw-r--r--src/main.cpp19
1 files changed, 8 insertions, 11 deletions
diff --git a/src/main.cpp b/src/main.cpp
index b2817fa97..4c63402fb 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -80,8 +80,10 @@
#include "debug/log-display-config.h"
#include "helper/action-context.h"
-#include "helper/gettext.h"
#include "helper/png-write.h"
+#ifdef ENABLE_NLS
+#include "helper/gettext.h"
+#endif
#include <extension/extension.h>
#include <extension/db.h>
@@ -108,10 +110,6 @@
#include <gtkmm/main.h>
#include <gtkmm/window.h>
-#ifndef HAVE_BIND_TEXTDOMAIN_CODESET
-#define bind_textdomain_codeset(p,c)
-#endif
-
#include "main-cmdlineact.h"
#include "main-cmdlinexact.h"
#include "widgets/icon.h"
@@ -851,13 +849,10 @@ static GSList *fixupFilenameEncoding( GSList* fl )
static int sp_common_main( int argc, char const **argv, GSList **flDest )
{
- /// \todo fixme: Move these to some centralized location (Lauris)
- //sp_object_type_register("sodipodi:namedview", SP_TYPE_NAMEDVIEW);
- //sp_object_type_register("sodipodi:guide", SP_TYPE_GUIDE);
-
-
+#ifdef ENABLE_NLS
// temporarily switch gettext encoding to locale, so that help messages can be output properly
Inkscape::bind_textdomain_codeset_console();
+#endif
poptContext ctx = poptGetContext(NULL, argc, argv, options, 0);
poptSetOtherOptionHelp(ctx, _("[OPTIONS...] [FILE...]\n\nAvailable options:"));
@@ -866,9 +861,11 @@ static int sp_common_main( int argc, char const **argv, GSList **flDest )
/* Collect own arguments */
GSList *fl = sp_process_args(ctx);
poptFreeContext(ctx);
-
+
+#ifdef ENABLE_NLS
// now switch gettext back to UTF-8 (for GUI)
Inkscape::bind_textdomain_codeset_utf8();
+#endif
// Now let's see if the file list still holds up
if ( needToRecodeParams )