M gtkgreet/main.c => gtkgreet/main.c +8 -0
@@ 6,6 6,9 @@
#include "window.h"
#include "gtkgreet.h"
+#include <glib/gi18n.h>
+#include <locale.h>
+
struct GtkGreet *gtkgreet = NULL;
static char* command = NULL;
@@ 119,6 122,11 @@ static void attach_custom_style(const char* path) {
}
int main (int argc, char **argv) {
+ setlocale(LC_ALL, "");
+ bindtextdomain(GETTEXT_PACKAGE, LOCALEDIR);
+ bind_textdomain_codeset(GETTEXT_PACKAGE, "UTF-8");
+ textdomain(GETTEXT_PACKAGE);
+
GError *error = NULL;
GOptionContext *option_context = g_option_context_new("- GTK-based greeter for greetd");
g_option_context_add_main_entries(option_context, entries, NULL);
M meson.build => meson.build +3 -0
@@ 14,6 14,9 @@ project(
add_project_arguments('-Wno-unused-parameter', language: 'c')
add_project_arguments('-Wno-missing-braces', language: 'c')
+prefix = get_option('prefix')
+localedir = join_paths(prefix, get_option('localedir'))
+
subdir('po')
subdir('gtkgreet')
M po/meson.build => po/meson.build +1 -1
@@ 1,6 1,6 @@
i18n = import('i18n')
# define GETTEXT_PACKAGE
-add_project_arguments('-DGETTEXT_PACKAGE="gtkgreet"', '-DLOCALEDIR="/usr/local/share/locale"', language:'c')
+add_project_arguments('-DGETTEXT_PACKAGE="'+meson.project_name()+'"', '-DLOCALEDIR="'+localedir+'"', language:'c')
i18n.gettext(meson.project_name(),
args: '--directory=' + meson.source_root(),
preset: 'glib'