]> git.mdlowis.com Git - proto/labwc.git/commitdiff
Add translate.h for HAVE_NLS includes/defines
authorJohan Malm <jgm323@gmail.com>
Wed, 24 Sep 2025 19:25:27 +0000 (20:25 +0100)
committerJohn Lindgren <john@jlindgren.net>
Fri, 26 Sep 2025 14:43:23 +0000 (10:43 -0400)
...to shrink labwc.h footprint

include/labwc.h
include/translate.h [new file with mode: 0644]
src/action-prompt-command.c
src/config/rcxml.c
src/desktop-entry.c
src/main.c
src/menu/menu.c

index 72dbe687fde70f051a8e76e19dfc75216f8be122..c75b1e39d9708ddac95c57d86d4175c293f89311 100644 (file)
@@ -7,13 +7,6 @@
 #include "common/set.h"
 #include "input/cursor.h"
 #include "overlay.h"
-#if HAVE_NLS
-#include <libintl.h>
-#include <locale.h>
-#define _ gettext
-#else
-#define _(s) (s)
-#endif
 
 #define XCURSOR_DEFAULT "left_ptr"
 #define XCURSOR_SIZE 24
diff --git a/include/translate.h b/include/translate.h
new file mode 100644 (file)
index 0000000..f7fc51e
--- /dev/null
@@ -0,0 +1,14 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+#ifndef LABWC_TRANSLATE_H
+#define LABWC_TRANSLATE_H
+#include "config.h"
+
+#if HAVE_NLS
+#include <libintl.h>
+#include <locale.h>
+#define _ gettext
+#else
+#define _(s) (s)
+#endif
+
+#endif /* LABWC_TRANSLATE_H */
index 65bd0b49926ee236b5e217e4f08e0164935af449..faad41c9e8a4c934498f5d53cc64da0333cffc43 100644 (file)
@@ -5,8 +5,8 @@
 #include <wlr/util/log.h>
 #include "action.h"
 #include "common/buf.h"
-#include "labwc.h" /* for gettext */
 #include "theme.h"
+#include "translate.h"
 
 enum {
        LAB_PROMPT_NONE = 0,
index 162f3f1d1c95e7fbc24223f93dafc4470ded0b6b..89293c43c9cb0cbc88859eb843872d3968b52f81 100644 (file)
@@ -33,6 +33,7 @@
 #include "osd.h"
 #include "regions.h"
 #include "ssd.h"
+#include "translate.h"
 #include "view.h"
 #include "window-rules.h"
 #include "workspaces.h"
index 60cff28ed55ed99183f623a1e20c9effd875286c..7aefa77e6567811fce973d2766d5429e3b33d6cf 100644 (file)
@@ -1,5 +1,6 @@
 // SPDX-License-Identifier: GPL-2.0-only
 #include "desktop-entry.h"
+#include <locale.h>
 #include <sfdo-desktop.h>
 #include <sfdo-icon.h>
 #include <sfdo-basedir.h>
index 068829dce8879f4d10f2fa88982002a431aba734..755a0a0c857e44748fe1d0c3c852c0dd3659833b 100644 (file)
@@ -11,6 +11,7 @@
 #include "config/session.h"
 #include "labwc.h"
 #include "theme.h"
+#include "translate.h"
 #include "menu/menu.h"
 
 struct rcxml rc = { 0 };
index fca755b22810500f08deb1ebe5a6a536a2528f34..0e23e850dd0c046c4128e68adcf212fb44f5e741 100644 (file)
@@ -29,6 +29,7 @@
 #include "scaled-buffer/scaled-font-buffer.h"
 #include "scaled-buffer/scaled-icon-buffer.h"
 #include "theme.h"
+#include "translate.h"
 #include "view.h"
 #include "workspaces.h"