Skip to content

Commit

Permalink
Properly initialize gettext
Browse files Browse the repository at this point in the history
  • Loading branch information
v1993 committed Nov 11, 2023
1 parent d3c7d6b commit 86ad961
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/main.vala
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,17 @@
*/

internal string argv0;
extern const string GETTEXT_PACKAGE;
extern const string NXDC_LOCALE_DIR;

int main(string[] args) {
argv0 = args[0] ?? "nxdumpclient";

Intl.setlocale();
Intl.bindtextdomain(GETTEXT_PACKAGE, NXDC_LOCALE_DIR);
Intl.bind_textdomain_codeset(GETTEXT_PACKAGE, "UTF-8");
Intl.textdomain(GETTEXT_PACKAGE);

var app = new NXDumpClient.Application();
return app.run(args);
}
1 change: 1 addition & 0 deletions src/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ executable('nxdumpclient', nxdc_sources,
'-DGETTEXT_PACKAGE="nxdumpclient"',
'-DG_LOG_DOMAIN="nxdumpclient"',
'-DNXDC_VERSION="@0@"'.format(meson.project_version()),
'-DNXDC_LOCALE_DIR="@0@"'.format(get_option('prefix') / get_option('localedir')),
'-DNXDC_ICONS_PATH="@0@"'.format(get_option('prefix') / get_option('datadir') / 'icons'),
'-DNXDC_EXECUTABLE="@0@"'.format(get_option('prefix') / get_option('bindir') / 'nxdumpclient'),
],
Expand Down

0 comments on commit 86ad961

Please sign in to comment.