static void i18n_init (void) { #ifdef ENABLE_NLS char *locale_dir; #ifdef HAVE_LC_MESSAGES setlocale (LC_TIME, ""); setlocale (LC_MESSAGES, ""); #else # ifndef HAVE_W32_SYSTEM setlocale (LC_ALL, "" ); # endif #endif /* Note that for this program we would only need the textdomain call because libgpg-error already initializes itself to its locale dir (via gpg_err_init or a constructor). However this is only done for the static standard locale and thus if the above setlocale calls select a different locale the bindtext below will do something else. */ locale_dir = get_locale_dir (); if (locale_dir) { bindtextdomain (PACKAGE, locale_dir); drop_locale_dir (locale_dir); } textdomain (PACKAGE); #endif }
static void real_init (void) { #ifdef ENABLE_NLS char *locale_dir; /* We only have to bind our locale directory to our text domain. */ locale_dir = get_locale_dir (); if (locale_dir) { bindtextdomain (PACKAGE, locale_dir); drop_locale_dir (locale_dir); } #endif }
/* * Small hack since we don't have a proper place where * do gettext initialization. */ const gchar * _gtksourceview_gettext (const gchar *msgid) { static gboolean initialized = FALSE; G_GNUC_UNUSED const char translator_credits[] = N_("translator-credits"); /* above is a dummy variable to get the string into po files */ if (G_UNLIKELY (!initialized)) { gchar *locale_dir; locale_dir = get_locale_dir (); bindtextdomain (GETTEXT_PACKAGE, locale_dir); g_free (locale_dir); bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8"); initialized = TRUE; } return g_dgettext (GETTEXT_PACKAGE, msgid); }
gboolean claws_init(int *argc, char ***argv) { if (claws_initialized) return TRUE; #ifdef USE_GNUTLS ssl_init(); #endif startup_dir = g_get_current_dir(); parse_parameter(argc, argv); debug_print("Starting Claws Mail version %s\n", PROG_VERSION); setlocale(LC_ALL, ""); #ifdef ENABLE_NLS bindtextdomain(PACKAGE, get_locale_dir () ); bind_textdomain_codeset (PACKAGE, "UTF-8"); textdomain(PACKAGE); #endif /*ENABLE_NLS*/ putenv("G_BROKEN_FILENAMES=1"); putenv("LIBOVERLAY_SCROLLBAR=0"); /* backup if old rc file exists */ if (is_file_exist(RC_DIR)) { if (g_rename(RC_DIR, RC_DIR ".bak") < 0) { FILE_OP_ERROR(RC_DIR, "rename"); return FALSE; } } srand((gint) time(NULL)); claws_initialized = TRUE; return TRUE; }