Skip to content

Commit

Permalink
i18n: Use glib's gettext support macros
Browse files Browse the repository at this point in the history
  • Loading branch information
rbuj authored and raveit65 committed Mar 6, 2021
1 parent bc5c7f0 commit 8cb3a02
Show file tree
Hide file tree
Showing 24 changed files with 41 additions and 15 deletions.
1 change: 0 additions & 1 deletion po/POTFILES.in
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ src/core/bell.c
src/core/core.c
src/core/delete.c
src/core/display.c
src/core/errors.c
src/core/keybindings.c
src/core/main.c
src/core/prefs.c
Expand Down
2 changes: 2 additions & 0 deletions src/core/bell.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@
*/

#include <config.h>
#include <glib/gi18n-lib.h>

#include "bell.h"
#include "screen-private.h"
#include "prefs.h"
Expand Down
2 changes: 2 additions & 0 deletions src/core/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
*/

#include <config.h>
#include <glib/gi18n-lib.h>

#include "core.h"
#include "frame-private.h"
#include "workspace.h"
Expand Down
2 changes: 2 additions & 0 deletions src/core/delete.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@
#define _XOPEN_SOURCE /* for gethostname() and kill() */

#include <config.h>
#include <glib/gi18n-lib.h>

#include "util.h"
#include "window-private.h"
#include "errors.h"
Expand Down
2 changes: 2 additions & 0 deletions src/core/display.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@
*/

#include <config.h>
#include <glib/gi18n-lib.h>

#include "display-private.h"
#include "util.h"
#include "main.h"
Expand Down
1 change: 0 additions & 1 deletion src/core/errors.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,3 @@ meta_error_trap_pop_with_return (MetaDisplay *display,
{
return gdk_x11_display_error_trap_pop (gdk_x11_lookup_xdisplay (meta_display_get_xdisplay (display)));
}

2 changes: 2 additions & 0 deletions src/core/keybindings.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
#define _XOPEN_SOURCE /* for putenv() */

#include <config.h>
#include <glib/gi18n-lib.h>

#include "keybindings.h"
#include "workspace.h"
#include "errors.h"
Expand Down
2 changes: 2 additions & 0 deletions src/core/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@
#define _XOPEN_SOURCE /* for putenv() and some signal-related functions */

#include <config.h>
#include <glib/gi18n-lib.h>

#include "main.h"
#include "util.h"
#include "display-private.h"
Expand Down
2 changes: 2 additions & 0 deletions src/core/prefs.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
*/

#include <config.h>
#include <glib/gi18n-lib.h>

#include "prefs.h"
#include "ui.h"
#include "util.h"
Expand Down
2 changes: 2 additions & 0 deletions src/core/screen.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
*/

#include <config.h>
#include <glib/gi18n-lib.h>

#include "screen-private.h"
#include "util.h"
#include "errors.h"
Expand Down
1 change: 1 addition & 0 deletions src/core/session.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
*/

#include <config.h>
#include <glib/gi18n-lib.h>

#include "session.h"
#include <X11/Xatom.h>
Expand Down
2 changes: 2 additions & 0 deletions src/core/util.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@
#define _POSIX_C_SOURCE 200112L /* for fdopen() */

#include <config.h>
#include <glib/gi18n-lib.h>

#include "util.h"
#include "main.h"

Expand Down
2 changes: 2 additions & 0 deletions src/core/window-props.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@
#define _XOPEN_SOURCE /* for gethostname() */

#include <config.h>
#include <glib/gi18n-lib.h>

#include "window-props.h"
#include "errors.h"
#include "xprops.h"
Expand Down
2 changes: 2 additions & 0 deletions src/core/window.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@
*/

#include <config.h>
#include <glib/gi18n-lib.h>

#include "window-private.h"
#include "edge-resistance.h"
#include "util.h"
Expand Down
2 changes: 2 additions & 0 deletions src/core/xprops.c
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,8 @@ from The Open Group.
*/

#include <config.h>
#include <glib/gi18n-lib.h>

#include "xprops.h"
#include "errors.h"
#include "util.h"
Expand Down
4 changes: 0 additions & 4 deletions src/include/util.h
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,6 @@ void meta_print_backtrace (void);

const char* meta_gravity_to_string (int gravity);

#include <libintl.h>
#define _(x) dgettext (GETTEXT_PACKAGE, x)
#define N_(x) x

char* meta_g_utf8_strndup (const gchar *src, gsize n);

GPid meta_show_dialog (const char *type,
Expand Down
5 changes: 1 addition & 4 deletions src/tools/marco-message.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,12 @@
*/

#include <config.h>
#include <glib/gi18n.h>
#include <gtk/gtk.h>
#include <gdk/gdkx.h>
#include <stdlib.h>
#include <string.h>

#include <libintl.h>
#define _(x) dgettext (GETTEXT_PACKAGE, x)
#define N_(x) x

static void
send_restart (void)
{
Expand Down
2 changes: 2 additions & 0 deletions src/ui/frames.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
*/

#include <config.h>
#include <glib/gi18n-lib.h>

#include <math.h>
#include <string.h>
#include "boxes.h"
Expand Down
4 changes: 3 additions & 1 deletion src/ui/menu.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,10 @@
* 02110-1301, USA.
*/

#include <gdk/gdkx.h>
#include <config.h>
#include <glib/gi18n-lib.h>

#include <gdk/gdkx.h>
#include <stdio.h>
#include <string.h>
#include "menu.h"
Expand Down
2 changes: 2 additions & 0 deletions src/ui/metaaccellabel.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@
*/

#include <config.h>
#include <glib/gi18n-lib.h>

#include "metaaccellabel.h"
#include <gtk/gtk.h>
#include <string.h>
Expand Down
2 changes: 2 additions & 0 deletions src/ui/resizepopup.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
*/

#include <config.h>
#include <glib/gi18n-lib.h>

#include "resizepopup.h"
#include "util.h"
#include <gtk/gtk.h>
Expand Down
2 changes: 2 additions & 0 deletions src/ui/theme-parser.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
*/

#include <config.h>
#include <glib/gi18n-lib.h>

#include "theme-parser.h"
#include "util.h"
#include <string.h>
Expand Down
6 changes: 2 additions & 4 deletions src/ui/theme-viewer.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
*/

#include <config.h>
#include <glib/gi18n.h>

#include "util.h"
#include "theme.h"
#include "theme-parser.h"
Expand All @@ -31,10 +33,6 @@
#include <stdlib.h>
#include <string.h>

#include <libintl.h>
#define _(x) dgettext (GETTEXT_PACKAGE, x)
#define N_(x) x

/* We need to compute all different button arrangements
* in terms of button location. We don't care about
* different arrangements in terms of button function.
Expand Down
2 changes: 2 additions & 0 deletions src/ui/theme.c
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@
*/

#include <config.h>
#include <glib/gi18n-lib.h>

#include "prefs.h"
#include "theme.h"
#include "theme-parser.h"
Expand Down

0 comments on commit 8cb3a02

Please sign in to comment.