i18n: ensure we setup i18n/l10n during application startup

Historically, Sysprof never supported translations. When revamping the
Sysprof implementation we didn't fix that, even though we were able to
start accepting translations.

This ensures we setup the translation tooling at startup.

Fixes #3
This commit is contained in:
Christian Hergert
2018-09-25 14:37:03 -07:00
parent 0b81a30313
commit a827b61d63
3 changed files with 11 additions and 40 deletions

View File

@ -16,9 +16,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#include "config.h"
#include <glib/gi18n.h>
@ -320,6 +318,14 @@ sp_application_init (SpApplication *self)
{ "quit", sysprof_quit },
};
setlocale (LC_ALL, "");
bindtextdomain (GETTEXT_PACKAGE, PACKAGE_LOCALE_DIR);
bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
textdomain (GETTEXT_PACKAGE);
g_set_application_name (_("Sysprof"));
g_action_map_add_action_entries (G_ACTION_MAP (self), actions, G_N_ELEMENTS (actions), self);
g_application_set_default (G_APPLICATION (self));