Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,15 @@ i18n = import('i18n')

add_global_arguments('-DGETTEXT_PACKAGE="@0@"'.format (meson.project_name()), language:'c')

config_data = configuration_data()
config_data.set_quoted('LOCALEDIR', get_option('prefix') / get_option('localedir'))
config_data.set_quoted('GETTEXT_PACKAGE', meson.project_name())
config_file = configure_file(
input: 'src/Config.vala.in',
output: '@BASENAME@',
configuration: config_data
)

gresource = gnome.compile_resources(
'as-resources',
'data' / 'iconbrowser.gresource.xml',
Expand All @@ -14,6 +23,7 @@ gresource = gnome.compile_resources(

executable(
meson.project_name(),
config_file,
gresource,
'src/Application.vala',
'src/CategoryView.vala',
Expand Down
5 changes: 5 additions & 0 deletions src/Application.vala
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@ public class IconBrowser.App : Gtk.Application {
protected override void startup () {
base.startup ();

Intl.setlocale (LocaleCategory.ALL, "");
Intl.bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR);
Intl.bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
Intl.textdomain (GETTEXT_PACKAGE);

var quit_action = new SimpleAction ("quit", null);

add_action (quit_action);
Expand Down
2 changes: 2 additions & 0 deletions src/Config.vala.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
public const string GETTEXT_PACKAGE = @GETTEXT_PACKAGE@;
public const string LOCALEDIR = @LOCALEDIR@;