Skip to content

Commit

Permalink
Fixed the gettext & locale initialization
Browse files Browse the repository at this point in the history
  • Loading branch information
dfandrich committed Nov 28, 2012
1 parent e9f8f11 commit c1ebee5
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
3 changes: 3 additions & 0 deletions i18n.h
Expand Up @@ -38,6 +38,9 @@
# define dgettext(Domain,Message) (Message) # define dgettext(Domain,Message) (Message)
# define dcgettext(Domain,Message,Type) (Message) # define dcgettext(Domain,Message,Type) (Message)
# define bindtextdomain(Domain,Directory) (Domain) # define bindtextdomain(Domain,Directory) (Domain)
# define bind_textdomain_codeset(Domain,Codeset) (Domain)
# define _(String) (String) # define _(String) (String)
# define N_(String) (String) # define N_(String) (String)
#endif #endif

#define TEXTDOMAIN "gpscorrelate"
6 changes: 3 additions & 3 deletions main-command.c
Expand Up @@ -207,9 +207,9 @@ static void FixDatestamp(const char* File, int AdjustmentHours, int AdjustmentMi


int main(int argc, char** argv) int main(int argc, char** argv)
{ {
/* Initialize gettext */ /* Initialize locale & gettext */
setlocale (LC_MESSAGES, ""); setlocale (LC_ALL, "");
textdomain("gpscorrelate"); textdomain(TEXTDOMAIN);


/* If you didn't pass any arguments... */ /* If you didn't pass any arguments... */
if (argc == 1) if (argc == 1)
Expand Down
7 changes: 3 additions & 4 deletions main-gui.c
Expand Up @@ -32,7 +32,6 @@


#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <locale.h>


#include <gtk/gtk.h> #include <gtk/gtk.h>


Expand All @@ -41,9 +40,9 @@


int main(int argc, char* argv[]) int main(int argc, char* argv[])
{ {
/* Initialize gettext */ /* Initialize gettext (gtk_init initializes the locale) */
setlocale (LC_MESSAGES, ""); textdomain(TEXTDOMAIN);
textdomain("gpscorrelate"); bind_textdomain_codeset(TEXTDOMAIN, "UTF-8");


/* Get GTK ready, as appropriate. /* Get GTK ready, as appropriate.
* (We ignore passed parameters) */ * (We ignore passed parameters) */
Expand Down

0 comments on commit c1ebee5

Please sign in to comment.