Initialize gettext

This commit is contained in:
Guido Günther
2021-12-03 18:57:59 +01:00
parent 9fbb974ce4
commit 964f1da305
6 changed files with 19 additions and 2 deletions

View File

@ -36,8 +36,6 @@ add_project_arguments(
i18n = import('i18n')
conf_data = configuration_data()
if get_option('buildtype').startswith('debug')
add_project_arguments('-DDEBUG=1', language : 'c')
endif
@ -63,6 +61,7 @@ endif
prefix = get_option('prefix')
bindir = join_paths(prefix, get_option('bindir'))
datadir = join_paths(prefix, get_option('datadir'))
localedir = join_paths(prefix, get_option('localedir'))
desktopdir = join_paths(datadir, 'applications')
pkgdatadir = join_paths(datadir, meson.project_name())
if get_option('depdatadir') == ''
@ -72,6 +71,10 @@ else
endif
dbusdir = join_paths(depdatadir, 'dbus-1/interfaces')
conf_data = configuration_data()
conf_data.set_quoted('GETTEXT_PACKAGE', 'squeekboard')
conf_data.set_quoted('LOCALEDIR', localedir)
summary = [
'',
'------------------',
@ -114,6 +117,7 @@ cargo_script = find_program('cargo.sh')
cargo_build = find_program('cargo_build.py')
subdir('data')
subdir('po')
subdir('protocols')
subdir('src')
subdir('tools')

0
po/LINGUAS Normal file
View File

1
po/POTFILES.in Normal file
View File

@ -0,0 +1 @@
data/popup.ui

2
po/meson.build Normal file
View File

@ -0,0 +1,2 @@
i18n = import('i18n')
i18n.gettext('squeekboard', preset : 'glib')

View File

@ -2,3 +2,9 @@
* Autogenerated by the Meson build system.
* Do not edit, your changes will be lost.
*/
#pragma once
#mesondefine GETTEXT_PACKAGE
#mesondefine LOCALEDIR

View File

@ -326,6 +326,10 @@ main (int argc, char **argv)
return 1;
}
textdomain (GETTEXT_PACKAGE);
bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR);
if (!gtk_init_check (&argc, &argv)) {
g_printerr ("Can't init GTK\n");
exit (1);