Permalink
Browse files

Fixed the gettext & locale initialization

  • Loading branch information...
1 parent e9f8f11 commit c1ebee5c649b9da5306d33b220e5abab54fd9b7e @dfandrich dfandrich committed Nov 28, 2012
Showing with 9 additions and 7 deletions.
  1. +3 −0 i18n.h
  2. +3 −3 main-command.c
  3. +3 −4 main-gui.c
View
3 i18n.h
@@ -38,6 +38,9 @@
# define dgettext(Domain,Message) (Message)
# define dcgettext(Domain,Message,Type) (Message)
# define bindtextdomain(Domain,Directory) (Domain)
+# define bind_textdomain_codeset(Domain,Codeset) (Domain)
# define _(String) (String)
# define N_(String) (String)
#endif
+
+#define TEXTDOMAIN "gpscorrelate"
View
@@ -207,9 +207,9 @@ static void FixDatestamp(const char* File, int AdjustmentHours, int AdjustmentMi
int main(int argc, char** argv)
{
- /* Initialize gettext */
- setlocale (LC_MESSAGES, "");
- textdomain("gpscorrelate");
+ /* Initialize locale & gettext */
+ setlocale (LC_ALL, "");
+ textdomain(TEXTDOMAIN);
/* If you didn't pass any arguments... */
if (argc == 1)
View
@@ -32,7 +32,6 @@
#include <stdio.h>
#include <stdlib.h>
-#include <locale.h>
#include <gtk/gtk.h>
@@ -41,9 +40,9 @@
int main(int argc, char* argv[])
{
- /* Initialize gettext */
- setlocale (LC_MESSAGES, "");
- textdomain("gpscorrelate");
+ /* Initialize gettext (gtk_init initializes the locale) */
+ textdomain(TEXTDOMAIN);
+ bind_textdomain_codeset(TEXTDOMAIN, "UTF-8");
/* Get GTK ready, as appropriate.
* (We ignore passed parameters) */

0 comments on commit c1ebee5

Please sign in to comment.