diff options
author | Kalev Lember <klember@redhat.com> | 2018-10-02 11:53:08 +0200 |
---|---|---|
committer | Kalev Lember <klember@redhat.com> | 2018-10-02 12:19:07 +0200 |
commit | 866805d33d30dc33a50ce34c508ec11db1b8ed69 (patch) | |
tree | 087b8034f8de6cb49c72fbeac8860e507f978a35 /client/pk-offline-update.c | |
parent | bc8c832996dbbe84629cead9b86c2bc21694dfb0 (diff) |
offline update: Fix translations to show up
Do the setlocale stanza in main() to correctly set up gettext.
Fixes: https://github.com/hughsie/PackageKit/issues/280
Diffstat (limited to 'client/pk-offline-update.c')
-rw-r--r-- | client/pk-offline-update.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/client/pk-offline-update.c b/client/pk-offline-update.c index 7bd97c3d1..90ecacd06 100644 --- a/client/pk-offline-update.c +++ b/client/pk-offline-update.c @@ -19,11 +19,14 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ +#include "config.h" + #include <glib.h> #include <glib-unix.h> #include <glib/gi18n.h> #include <glib/gstdio.h> #include <gio/gio.h> +#include <locale.h> #include <packagekit-glib2/packagekit.h> #include <packagekit-glib2/packagekit-private.h> #include <packagekit-glib2/pk-offline-private.h> @@ -432,6 +435,11 @@ main (int argc, char *argv[]) g_autoptr(PkProgressBar) progressbar = NULL; g_autoptr(PkTask) task = NULL; + setlocale (LC_ALL, ""); + bindtextdomain (GETTEXT_PACKAGE, PACKAGE_LOCALE_DIR); + bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8"); + textdomain (GETTEXT_PACKAGE); + /* ensure root user */ if (getuid () != 0 || geteuid () != 0) { retval = EXIT_FAILURE; |