Imported Debian patch 2.23.05-1
[hcoop/zz_old/debian/webalizer.git] / debian / patches / 23_gettext_first_part.diff
diff --git a/debian/patches/23_gettext_first_part.diff b/debian/patches/23_gettext_first_part.diff
new file mode 100644 (file)
index 0000000..350482b
--- /dev/null
@@ -0,0 +1,1503 @@
+From: Julien Viard de Galbert <julien@vdg.blogsite.org>
+Subject: Convert to use gettext [first part]
+
+If you apply this patch you MUST apply the next patch as this patch is not self
+contained. The reason is that the second patch can be regenerated by running a
+script.
+
+This patch is based on 17_gettext.dpatch by Jose Carlos Medeiros <debian@psabs.com.br>
+He described his patch as follows:
+#############################################
+# To create this patch I did follow:
+# 1. Created and ran script lang_po.sh ,  see it above below.
+#    This script create a new .c file and a .diff file t each source .c file
+# 2. Changed these arrays strings from ex. l_month[] to _(l_month[])
+#    l_month[], s_month[], h_msg[], language, response[], top_ctrys[]
+# 3. Changed "language" string to _("locale")
+# 4. After ran lang_po.sh script, it change another strings that cant be
+#    translated. Then I need to change wrong substituitions like:
+#    -        case 't': msg_title=optarg;          break;  /* Report title        */
+#    +        case 't': _("Usage Statistics for")=optarg;          break;  /* Report title        */
+#    To do it, just look at .diff files and after remove these one.
+# 5. Looked for strings that arent msg_*, like new string put with fprintf, ex.
+#    fprintf(stderr,"%s %s!\n","Error: File is a symlink",log_fname);
+#    in webalizer.c file
+#    grep \" *.c |grep -v "_(\"" |less
+# 6. Found and change string that arent msg_* .  Patch of Geolizer is an example.
+#    It put messages like "Error, something..." and we need to change to _("Error, som...")
+# 7. Created webalizer.pot file with the follow command:
+#    xgettext --default-domain=webalizer --directory=. -o po/webalizer.pot \
+#             --language=C --add-comments="TRANS:" --escape --sort-by-file \
+#             --keyword=_ --keyword=N_ --keyword=Q_ --keyword=PL_:1,2 *.c *.h
+# 8. Merged old .po files.
+#    for i in po/*.po;do echo -n $i;msgmerge -U $i po/webalizer.pot;done;
+#    rm -f po/*.po~;
+
+# lang_po.sh
+# --- cut here and strip all first "#" ---
+##!/bin/bash
+## create  lang.txt file with vars and strings from webalizer_lang.english file
+#cat lang/webalizer_lang.english | grep ^char | sed \
+#      -e 's/^char//' -e 's/ \*//' -e 's/= /=/' -e 's/ *=/=/' \
+#      -e 's/="/=/' -e 's/;$//' -e 's/"$//' -e 's/!/\\!/' | \
+#      grep -v "^l_month" | grep -v "^s_month" | grep -v "^h_msg" | \
+#      grep -v "^language=" | sort -r > lang.txt
+## create a sed line with -e options that subst msg_* strings to _("string")
+## take strings from lang.txt file.
+#SED_E="";
+#for i in $(cat lang.txt |cut -f1 -d=); do
+#  SUBST=$(cat lang.txt | grep ^$i=| cut -f2 -d=);
+#  SED_E="$SED_E -e "'"'"s/$i/_("'\"'$SUBST'\"'")/"'"'
+#done;
+## create a script file with commands to subst and create a diff file
+## I create this script because had errors when I tried to run commands here.
+#echo "" > lang_po_exec.sh
+#for i in *.c; do
+#  echo "cat $i | sed $SED_E > $i.new;" >> lang_po_exec.sh;
+#  echo "diff -uNad $i $i.new > $i.diff;" >> lang_po_exec.sh;
+#  echo "cat $i.new > $i;" >> lang_po_exec.sh;
+#  echo "rm -f $i.new;" >> lang_po_exec.sh;
+#done;
+#bash ./lang_po_exec.sh;
+#rm -f lang_po_exec.sh lang.txt;
+# --- cut here ---
+
+###########################################
+# debian package won't compile
+# http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=252541
+# From: Paolo <pp@ieee.org>
+# Patch to resolve little problem in gettextize
+
+###########################################
+# some messages & variables are missed while gettextize
+# http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=201697
+# From: Tatsuki Sugiura <sugi@nemui.org>
+
+###########################################
+# Webalizer doesn't display 'language' anymore
+# http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=202293
+# From: Fabien Chevalier <fabien@juliana-multimedia.com>
+
+
+Based on this, I applied the original patch without any part that will be
+corrected by the script.
+Also I partially regenerated the lang2.h file by using the strings from
+the new version of 'lang/webalizer_lang.english'
+This patch also generate a fixed version of the above script.
+
+It handles the following bugs as well:
+
+  * Fix report title translation handling
+    gettext patch was making ReportTitle (and -t) useless.
+    Also the fix is done in a way so that the script no longer generate wrong
+    substitutions (see point 4 above).
+
+  * Fix month translations
+    From: Gerome Fournier <gerome.fournier@infomaniak.ch>
+    http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=520408
+
+Index: webalizer/Makefile.in
+===================================================================
+--- webalizer.orig/Makefile.in 2011-01-07 19:11:55.000000000 +0100
++++ webalizer/Makefile.in      2011-01-07 19:13:13.000000000 +0100
+@@ -23,10 +23,11 @@
+ BINDIR          = @bindir@
+ MANDIR          = ${datadir}/man/man1
+ ETCDIR          = @sysconfdir@
++LOCALEDIR       = @localedir@
+ GEODB           = @GEODB_LOC@
+ CC              = @CC@
+ CFLAGS          = @CFLAGS@ @CPPFLAGS@
+-LIBS            = @LIBS@
++LIBS            = @LIBS@ -ldb
+ WCMGR_LIBS      = @WCMGR_LIBS@
+ DEFS            = -DETCDIR=\"${ETCDIR}\" -DGEODB_LOC=\"${GEODB}\" @DEFS@ @OPTS@
+ LDFLAGS         = @LDFLAGS@
+@@ -35,6 +36,9 @@
+ INSTALL_DATA    = @INSTALL_DATA@
+ DEFLANG         = @DEFAULT_LANG@
++LANGS=$(shell for a in po/*.po; do basename $${a%.po}; done)
++
++
+ # Shouldn't have to touch below here!
+ all: webalizer wcmgr
+@@ -43,13 +47,13 @@
+               linklist.o linklist.h preserve.o preserve.h  \
+                 dns_resolv.o dns_resolv.h parser.o parser.h  \
+                 output.o output.h graphs.o graphs.h lang.h   \
+-              webalizer_lang.h
++              $(LANGS:%=po/%.mo)
+       $(CC) ${LDFLAGS} -o webalizer webalizer.o hashtab.o linklist.o preserve.o parser.o output.o dns_resolv.o graphs.o ${LIBS}
+       rm -f webazolver
+       @LN_S@ webalizer webazolver
+ webalizer.o:  webalizer.c webalizer.h parser.h output.h preserve.h \
+-              graphs.h dns_resolv.h webalizer_lang.h
++              graphs.h dns_resolv.h
+       $(CC) ${CFLAGS} ${DEFS} -c webalizer.c
+ parser.o:     parser.c parser.h webalizer.h lang.h
+@@ -81,14 +85,16 @@
+ wcmgr.o:      wcmgr.c
+       $(CC) ${CFLAGS} ${DEFS} -c wcmgr.c
++$(LANGS:%=po/%.mo): %.mo: %.po
++      msgfmt $< -o $@
++
+ clean:
+       rm -f webalizer webazolver wcmgr *.o usage*.png daily*.png hourly*.png
+       rm -f ctry*.png *.html *.hist *.current core *.gif
+ distclean: clean
+       rm -f webalizer.conf *.tar *.tgz *.Z *.tar.gz
+-      rm -f Makefile webalizer_lang.h config.cache config.log config.status
+-      @LN_S@ lang/webalizer_lang.@DEFAULT_LANG@ webalizer_lang.h
++      rm -f Makefile config.cache config.log config.status $(LANGS:%=po/%.mo)
+ install: all
+       mkdir -p ${DESTDIR}${BINDIR}
+@@ -103,6 +109,7 @@
+       rm -f ${DESTDIR}${MANDIR}/webazolver.1
+       @LN_S@ webalizer.1 ${DESTDIR}${MANDIR}/webazolver.1
+       $(INSTALL_DATA) sample.conf ${DESTDIR}${ETCDIR}/webalizer.conf.sample
++      for a in $(LANGS); do $(INSTALL_DATA) po/$$a.mo ${DESTDIR}/$(LOCALEDIR)/$$a/LC_MESSAGES/webalizer.mo; done
+ uninstall:
+       rm -f ${DESTDIR}${BINDIR}/webalizer
+@@ -112,5 +119,4 @@
+       rm -f ${DESTDIR}${MANDIR}/webazolver.1
+       rm -f ${DESTDIR}${MANDIR}/wcmgr.1
+       rm -f ${DESTDIR}${ETCDIR}/webalizer.conf.sample
+-      rm -f webalizer_lang.h
+-      @LN_S@ lang/webalizer_lang.${DEFLANG} webalizer_lang.h
++      for a in $(LANGS); do rm -f $(LOCALEDIR)/$$a/LC_MESSAGES/webalizer.mo; done
+Index: webalizer/configure.in
+===================================================================
+--- webalizer.orig/configure.in        2011-01-07 19:12:51.000000000 +0100
++++ webalizer/configure.in     2011-01-07 19:13:13.000000000 +0100
+@@ -281,43 +281,16 @@
+   if test "$OLDHASH" = "yes"; then OPTS="-DUSE_OLDHASH"; fi
+ dnl ------------------------------------------
+-dnl check language to use (default is english)
++dnl language with gettext
+ dnl ------------------------------------------
+-LANG_CACHE=yes
+-AC_ARG_WITH(language,
+-  [  --with-language=name    Use language 'name' (default is english)], 
+-  WEBALIZER_LANG="${withval}"; LANG_CACHE=no, LANG_CACHE=yes)
+-if test "$WEBALIZER_LANG" = "no"; then WEBALIZER_LANG=english; fi
++dnl keep datadir, it is needed for "bindtextdomain" since we use gettext
++OPTS="-DDATADIR=\\\"${datadir}\\\" ${OPTS}"
+-dnl ------------------------------------------
+-dnl check if specfied language is valid
+-dnl ------------------------------------------
+-
+-AC_MSG_CHECKING(for language file)
+-if test "$LANG_CACHE" = "yes"; then
+-  AC_CACHE_VAL(ac_cv_language, ac_cv_language=$DEFAULT_LANG)
+-  WEBALIZER_LANG=$ac_cv_language
+-fi
+-
+-if test -f lang/webalizer_lang.${WEBALIZER_LANG}; then
+-AC_MSG_RESULT(yes - ${WEBALIZER_LANG})
+-else
+- if test -f lang/webalizer_lang.${DEFAULT_LANG}; then
+-  AC_MSG_RESULT('${WEBALIZER_LANG}' not found - using ${DEFAULT_LANG})
+-  WEBALIZER_LANG=${DEFAULT_LANG}
+- else
+-  AC_MSG_RESULT(no)
+-  AC_MSG_ERROR(language files not found... fix before continuing)
+- fi
+-fi
+-ac_cv_language=${WEBALIZER_LANG}
+-
+-dnl ------------------------------------------
+-dnl create link to language file
+-dnl ------------------------------------------
++#AM_GNU_GETTEXT
+-AC_LINK_FILES(lang/webalizer_lang.${WEBALIZER_LANG}, webalizer_lang.h)
++localedir=${datadir}/locale
++AC_SUBST(localedir)
+ dnl ------------------------------------------
+ dnl done.. write out our Makefile
+Index: webalizer/dns_resolv.c
+===================================================================
+--- webalizer.orig/dns_resolv.c        2011-01-07 19:11:55.000000000 +0100
++++ webalizer/dns_resolv.c     2011-01-07 19:13:13.000000000 +0100
+@@ -120,7 +120,7 @@
+    query.data = log_rec->hostname;
+    query.size = strlen(log_rec->hostname);
+-   if (debug_mode) fprintf(stderr,"Checking %s...", log_rec->hostname);
++   if (debug_mode) fprintf(stderr,_("Checking %s..."), log_rec->hostname);
+    if ( (i=dns_db->get(dns_db, NULL, &query, &response, 0)) == 0)
+    {
+@@ -130,15 +130,15 @@
+                MAXHOST);
+       log_rec->hostname[MAXHOST-1]=0;
+       if (debug_mode)
+-         fprintf(stderr," found: %s (%ld)\n",
++         fprintf(stderr,_(" found: %s (%ld)\n"),
+            log_rec->hostname, alignedRecord.timeStamp);
+    }
+-   else  /* not found or error occured during get */
++   else  /* not found or error occurred during get */
+    {
+       if (debug_mode)
+       {
+-         if (i==DB_NOTFOUND) fprintf(stderr," not found\n");
+-         else                fprintf(stderr," error (%d)\n",i);
++         if (i==DB_NOTFOUND) fprintf(stderr,_(" not found\n"));
++         else                fprintf(stderr,_(" error (%d)\n"),i);
+       }
+    }
+ }
+@@ -328,7 +328,7 @@
+          i=( (int)((float)listEntries/temp_time) );
+       else i=0;
+-      if ( (i>0) && (i<=listEntries) ) printf(", %d/sec\n", i);
++      if ( (i>0) && (i<=listEntries) ) printf(_(", %d/sec\n"), i);
+          else  printf("\n");
+    }
+@@ -371,13 +371,13 @@
+    {
+       if(pipe(child[i].inpipe))
+       {
+-         if (verbose) fprintf(stderr,"INPIPE creation error");
++         if (verbose) fprintf(stderr,_("INPIPE creation error"));
+          return;   /* exit(1) */
+       }
+       if(pipe(child[i].outpipe))
+       {
+-         if (verbose) fprintf(stderr,"OUTPIPE creation error");
++         if (verbose) fprintf(stderr,_("OUTPIPE creation error"));
+          return;   /* exit(1); */
+       }
+@@ -386,7 +386,7 @@
+       {
+          case -1:
+          {
+-            if (verbose) fprintf(stderr,"FORK error");
++            if (verbose) fprintf(stderr,_("FORK error"));
+             return;  /* exit(1); */
+          }
+         
+@@ -402,7 +402,7 @@
+             {
+                if(size < 0)
+                {
+-                  perror("read error");
++                  perror(_("read error"));
+                   exit(1);
+                }
+                else
+@@ -425,18 +425,18 @@
+                      else
+                      {
+                         if (debug_mode)
+-                           printf("Child %d getnameinfo bad hbuf!\n",i);
++                           printf(_("Child %d getnameinfo bad hbuf!\n"),i);
+                      }
+                   }
+                   else
+                   {
+                      if(debug_mode)
+-                       printf("Child %d getnameinfo failed!\n",i);
++                       printf(_("Child %d getnameinfo failed!\n"),i);
+                   }
+                   if (write(child[i].inpipe[1], child_buf, size) == -1)
+                   {
+-                     perror("write error");
++                     perror(_("write error"));
+                      exit(1);
+                   }
+                }
+@@ -445,7 +445,7 @@
+             close(child[i].outpipe[0]);
+               
+             if(debug_mode)
+-               printf( "Child %d got closed input, shutting down\n", i);  
++               printf( _("Child %d got closed input, shutting down\n"), i);  
+             fflush(stdout);
+             exit(0);
+@@ -490,7 +490,7 @@
+                   nof_children--;
+                   if(debug_mode)
+-                  printf("Reaped Child %d\n", pid);
++                  printf(_("Reaped Child %d\n"), pid);
+                   break;
+                }
+@@ -519,7 +519,7 @@
+                      max_fd = MAX(max_fd, child[i].inpipe[0]);
+                      if(debug_mode)
+-                        printf("Giving %d bytes to Child %d\n",
++                        printf(_("Giving %d bytes to Child %d\n"),
+                         trav->addrlen, i);
+                      trav = trav->llist;
+@@ -528,7 +528,7 @@
+                   {
+                      if(errno != EINTR)           /* Could be a signal */
+                      {
+-                        perror("Could not write to pipe");
++                        perror(_("Could not write to pipe"));
+                         close(child[i].outpipe[1]);           /* kill     */
+                         child[i].flags &= ~DNS_CHILD_RUNNING; /* child    */
+                      }
+@@ -557,7 +557,7 @@
+          case -1:
+          {
+             if(errno != EINTR)   /* Could be a signal */
+-            perror("Error in select");
++            perror(_("Error in select"));
+             break;
+          }
+@@ -565,7 +565,7 @@
+          case 0:   /* Timeout, just fall once through the child loop */
+          {
+             if(debug_mode)
+-            printf("tick\n");
++            printf(_("tick\n"));
+               
+             break;
+          }
+@@ -600,7 +600,7 @@
+                         child[i].flags &= ~DNS_CHILD_RUNNING;
+                         if(debug_mode)
+-                           printf("Child %d wants to be reaped\n", i);
++                           printf(_("Child %d wants to be reaped\n"), i);
+                         break;
+                      }
+@@ -613,14 +613,14 @@
+                                     sizeof(child[i].cur->addr)))
+                         {
+                            if(debug_mode)
+-                              printf("Child %d Got a result: %s -> %s\n",
++                              printf(_("Child %d Got a result: %s -> %s\n"),
+                                      i, child[i].cur->string, dns_buf);
+                            db_put(child[i].cur->string, dns_buf, 0);
+                         }
+                         else
+                         {
+                            if(debug_mode)
+-                              printf("Child %d could not resolve: %s (%s)\n",
++                              printf(_("Child %d could not resolve: %s (%s)\n"),
+                                      i, child[i].cur->string,
+                                      (cache_ips)?"cache":"no cache");
+                            if (cache_ips)      /* Cache non-resolved? */
+@@ -629,7 +629,7 @@
+                         }
+                         if(debug_mode)
+-                           printf("Child %d back in task pool\n", i);
++                           printf(_("Child %d back in task pool\n"), i);
+                         /* Child is back in the task pool */
+                         child[i].flags |= DNS_CHILD_READY;
+@@ -721,7 +721,7 @@
+          v.data = recPtr;
+          if ( dns_db->put(dns_db, NULL, &k, &v, 0) != 0 )
+-            if (verbose>1) fprintf(stderr,"db_put fail!\n");
++            if (verbose>1) fprintf(stderr,_("db_put fail!\n"));
+          free(recPtr);
+       }
+    }
+Index: webalizer/graphs.c
+===================================================================
+--- webalizer.orig/graphs.c    2011-01-07 19:12:51.000000000 +0100
++++ webalizer/graphs.c 2011-01-07 19:13:13.000000000 +0100
+@@ -217,12 +217,12 @@
+       if (graph_mths<16)
+       {
+          gdImageString(im,gdFontSmall,ci+((i-s_mth)*cs)+(((cw+co+co)-18)/2)+1,
+-                     236,(unsigned char *)s_month[data[i].month-1],black);
++                     236,(unsigned char *)Q_(s_month[data[i].month-1]),black);
+       }
+       else if (graph_mths<36)
+       {
+          gdImageChar(im,gdFontSmall,ci+((i-s_mth)*cs)+(((cw+co+co)-6)/2)+1,
+-                     236,s_month[data[i].month-1][0],
++                     236,Q_(s_month[data[i].month-1])[0],
+                      (data[i].month==1)?blue:black);
+       }
+       else
+Index: webalizer/lang.h
+===================================================================
+--- webalizer.orig/lang.h      2011-01-07 19:12:27.000000000 +0100
++++ webalizer/lang.h   2011-01-07 19:13:13.000000000 +0100
+@@ -1,187 +1,20 @@
+ #ifndef _LANG_H
+ #define _LANG_H
+-extern char *language    ;
+-extern char *langcode    ;
++#include <libintl.h>
++#include <locale.h>
+-extern char *msg_records ;
+-extern char *msg_addresses;
+-extern char *msg_ignored ;
+-extern char *msg_bad     ;
+-extern char *msg_in      ;
+-extern char *msg_seconds ;
+-
+-extern char *msg_log_err ;
+-extern char *msg_log_use ;
+-extern char *msg_dir_err ;
+-extern char *msg_dir_use ;
+-extern char *msg_cur_dir ;
+-extern char *msg_hostname;
+-extern char *msg_ign_hist;
+-extern char *msg_no_hist ;
+-extern char *msg_get_hist;
+-extern char *msg_put_hist;
+-extern char *msg_hist_err;
+-extern char *msg_bad_hist;
+-extern char *msg_bad_conf;
+-extern char *msg_bad_key ;
+-extern char *msg_bad_date;
+-extern char *msg_ign_nscp;
+-extern char *msg_bad_rec ;
+-extern char *msg_no_vrec ;
+-extern char *msg_gen_rpt ;
+-extern char *msg_gen_sum ;
+-extern char *msg_get_data;
+-extern char *msg_put_data;
+-extern char *msg_no_data ;
+-extern char *msg_bad_data;
+-extern char *msg_data_err;
+-extern char *msg_dup_data;
+-
+-extern char *msg_dns_nocf;
+-extern char *msg_dns_nodb;
+-extern char *msg_dns_nolk;
+-extern char *msg_dns_usec;
+-extern char *msg_dns_rslf;
+-extern char *msg_dns_none;
+-extern char *msg_dns_abrt;
+-
+-extern char *msg_geo_open;
+-extern char *msg_geo_use ;
+-extern char *msg_geo_nolu;
+-extern char *msg_geo_dflt;
+-
+-extern char *msg_nomem_ts;
+-extern char *msg_nomem_tr;
+-extern char *msg_nomem_tu;
+-extern char *msg_nomem_tc;
+-extern char *msg_nomem_ta;
+-extern char *msg_nomem_tsr;
+-extern char *msg_nomem_ti;
+-extern char *msg_nomem_dh;
+-extern char *msg_nomem_mh;
+-extern char *msg_nomem_u ;
+-extern char *msg_nomem_a ;
+-extern char *msg_nomem_r ;
+-extern char *msg_nomem_sc;
+-extern char *msg_nomem_i ;
+-
+-extern char *msg_big_rec ;
+-extern char *msg_big_host;
+-extern char *msg_big_date;
+-extern char *msg_big_req ;
+-extern char *msg_big_ref ;
+-extern char *msg_big_user;
+-extern char *msg_big_one ;
++#define _(String) gettext (String)
++#define gettext_noop(String) String
++#define N_(String) gettext_noop (String)
++#define Q_(String) intl_strip_context (String)
+-extern char *msg_no_open ;
+-
+-extern char *h_usage1    ;
+-extern char *h_usage2    ;
+ extern char *h_msg[];
+-/* HTML Strings */
+-
+-extern char *msg_hhdr_sp ;
+-extern char *msg_hhdr_gt ;
+-
+-extern char *msg_main_us ;
+-extern char *msg_main_per;
+-extern char *msg_main_sum;
+-extern char *msg_main_da ;
+-extern char *msg_main_mt ;
+-
+-extern char *msg_hmth_du ;
+-extern char *msg_hmth_hu ;
+-
+-extern char *msg_h_by    ;
+-extern char *msg_h_avg   ;
+-extern char *msg_h_max   ;
+-extern char *msg_h_total ;
+-extern char *msg_h_totals;
+-extern char *msg_h_day   ;
+-extern char *msg_h_mth   ;
+-extern char *msg_h_hour  ;
+-extern char *msg_h_hits  ;
+-extern char *msg_h_pages ;
+-extern char *msg_h_visits;
+-extern char *msg_h_files ;
+-extern char *msg_h_sites ;
+-extern char *msg_h_xfer  ;
+-extern char *msg_h_ixfer ;
+-extern char *msg_h_oxfer ;
+-extern char *msg_h_hname ;
+-extern char *msg_h_url   ;
+-extern char *msg_h_agent ;
+-extern char *msg_h_ref   ;
+-extern char *msg_h_ctry  ;
+-extern char *msg_h_search;
+-extern char *msg_h_uname ;
+-
+-extern char *msg_hlnk_ds ;
+-extern char *msg_hlnk_hs ;
+-extern char *msg_hlnk_u  ;
+-extern char *msg_hlnk_s  ;
+-extern char *msg_hlnk_a  ;
+-extern char *msg_hlnk_c  ;
+-extern char *msg_hlnk_r  ;
+-extern char *msg_hlnk_en ;
+-extern char *msg_hlnk_ex ;
+-extern char *msg_hlnk_sr ;
+-extern char *msg_hlnk_i  ;
+-
+-extern char *msg_mtot_ms ;
+-extern char *msg_mtot_th ;
+-extern char *msg_mtot_tf ;
+-extern char *msg_mtot_tx ;
+-extern char *msg_mtot_ix ;
+-extern char *msg_mtot_ox ;
+-extern char *msg_mtot_us ;
+-extern char *msg_mtot_ur ;
+-extern char *msg_mtot_ua ;
+-extern char *msg_mtot_uu ;
+-extern char *msg_mtot_ui ;
+-extern char *msg_mtot_mhd;
+-extern char *msg_mtot_mhh;
+-extern char *msg_mtot_mfd;
+-extern char *msg_mtot_mpd;
+-extern char *msg_mtot_msd;
+-extern char *msg_mtot_mvd;
+-extern char *msg_mtot_mkd;
+-extern char *msg_mtot_ikd;
+-extern char *msg_mtot_okd;
+-extern char *msg_mtot_rc ;
+-
+-extern char *msg_dtot_ds ;
+-
+-extern char *msg_htot_hs ;
+-
+-extern char *msg_ctry_use;
+-
+-extern char *msg_top_top ;
+-extern char *msg_top_of  ;
+-extern char *msg_top_s   ;
+-extern char *msg_top_u   ;
+-extern char *msg_top_r   ;
+-extern char *msg_top_a   ;
+-extern char *msg_top_c   ;
+-extern char *msg_top_en  ;
+-extern char *msg_top_ex  ;
+-extern char *msg_top_sr  ;
+-extern char *msg_top_i   ;
+-extern char *msg_v_sites ;
+-extern char *msg_v_urls  ;
+-extern char *msg_v_refs  ;
+-extern char *msg_v_agents;
+-extern char *msg_v_search;
+-extern char *msg_v_users ;
+-
+-extern char *msg_title   ;
+-extern char *msg_h_other ;
+-
+ extern char *s_month[12];
+ extern char *l_month[12];
++extern char *report_title;
+ extern struct response_code response[];
+ extern struct country_code ctry[];
+Index: webalizer/lang2.h
+===================================================================
+--- /dev/null  1970-01-01 00:00:00.000000000 +0000
++++ webalizer/lang2.h  2011-01-07 19:13:13.000000000 +0100
+@@ -0,0 +1,435 @@
++/*
++   webalizer_lang.english
++
++   Webalizer V2.0x Language Support file for English.
++   15-May-1998 by Bradford L. Barrett (brad@mrunix.net)
++   31-May-1998 Modified for level 1.1 support (brad@mrunix.net)
++   23-Jul-1998 Modified for level 1.2 support (brad@mrunix.net)
++   08-Mar-1999 Updated HTTP 1.1 response codes by Yves Lafon (ylafon@w3.org)
++   28-Jun-1999 Modified for level 1.3 support (brad@mrunix.net)
++   16-Feb-2000 Modified for level 2.0 support (brad@mrunix.net)
++   26-Mar-2008 Updated to current IANA TLDs (brad@mrunix.net)
++   26-May-2008 Modified for level 2.2 support (brad@mrunix.net)
++
++
++   Language files are named using the following convention:
++
++   webalizer_lang.LANGUAGE
++
++   where 'LANGUAGE' is the name of the language the file is
++   translated into (ie: webalizer_lang.russian for russian).
++   Either copy the desired language file to webalizer_lang.h
++   or create a symbolic link, then re-compile.
++
++   If you translate this file into a different language, please
++   send a copy to brad@mrunix.net.
++
++*/
++
++/* lib gettext */
++#include <libintl.h>
++#include <locale.h>
++
++#define _(String) gettext (String)
++#define gettext_noop(String) String
++#define N_(String) gettext_noop (String)
++#define Q_(String) intl_strip_context (String)
++
++/* Help display... */
++char *h_msg[]= {
++         gettext_noop("-h        = print this help message")             ,
++         gettext_noop("-V        = print version information")           ,
++         gettext_noop("-v        = be verbose")                          ,
++         gettext_noop("-d        = print additional debug info")         ,
++         gettext_noop("-F type   = Log type.  type= (clf | ftp | squid | w3c)"),
++         gettext_noop("-f        = Fold sequence errors")                ,
++         gettext_noop("-i        = ignore history file")                 ,
++         gettext_noop("-p        = preserve state (incremental)")        ,
++         gettext_noop("-b        = ignore state (incremental)")          ,
++         gettext_noop("-q        = supress informational messages")      ,
++         gettext_noop("-Q        = supress _ALL_ messages")              ,
++         gettext_noop("-Y        = supress country graph")               ,
++         gettext_noop("-G        = supress hourly graph")                ,
++         gettext_noop("-H        = supress hourly stats")                ,
++         gettext_noop("-L        = supress color coded graph legends")   ,
++         gettext_noop("-l num    = use num background lines on graph")   ,
++         gettext_noop("-m num    = Visit timout value (seconds)")        ,
++         gettext_noop("-T        = print timing information")            ,
++         gettext_noop("-c file   = use configuration file 'file'")       ,
++         gettext_noop("-n name   = hostname to use")                     ,
++         gettext_noop("-o dir    = output directory to use")             ,
++         gettext_noop("-t name   = report title 'name'")                 ,
++         gettext_noop("-a name   = hide user agent 'name'")              ,
++         gettext_noop("-r name   = hide referrer 'name'")                ,
++         gettext_noop("-s name   = hide site 'name'")                    ,
++         gettext_noop("-u name   = hide URL 'name'")                     ,
++         gettext_noop("-x name   = Use filename extension 'name'")       ,
++         gettext_noop("-O name   = Omit page 'name'")                    ,
++         gettext_noop("-P name   = Page type extension 'name'")          ,
++         gettext_noop("-I name   = Index alias 'name'")                  ,
++         gettext_noop("-K num    = num months in summary table")         ,
++         gettext_noop("-k num    = num months in summary graph")         ,
++         gettext_noop("-A num    = Display num top agents")              ,
++         gettext_noop("-C num    = Display num top countries")           ,
++         gettext_noop("-R num    = Display num top referrers")           ,
++         gettext_noop("-S num    = Display num top sites")               ,
++         gettext_noop("-U num    = Display num top URLs")                ,
++         gettext_noop("-e num    = Display num top Entry Pages")         ,
++         gettext_noop("-E num    = Display num top Exit Pages")          ,
++         gettext_noop("-g num    = Group Domains to 'num' levels")       ,
++         gettext_noop("-X        = Hide individual sites")               ,
++         gettext_noop("-z dir    = Use country flags in 'dir'")          ,
++#ifdef USE_DNS
++         gettext_noop("-D name   = Use DNS Cache file 'name'")           ,
++         gettext_noop("-N num    = Number of DNS processes (0=disable)") ,
++         gettext_noop("-j        = Enable native GeoDB lookups")         ,
++         gettext_noop("-J name   = Use GeoDB database 'name'")           ,
++#endif
++#ifdef USE_GEOIP
++         gettext_noop("-w        = Enable GeoIP lookups")                ,
++         gettext_noop("-W name   = Use GeoIP database 'name'")           ,
++#endif
++         NULL};
++
++/* short month names MUST BE 3 CHARS in size... pad if needed*/
++char *s_month[12]={ gettext_noop("Jan"), gettext_noop("Feb"), gettext_noop("Mar"),
++                    gettext_noop("Apr"), gettext_noop("short|May"), gettext_noop("Jun"),
++                    gettext_noop("Jul"), gettext_noop("Aug"), gettext_noop("Sep"),
++                    gettext_noop("Oct"), gettext_noop("Nov"), gettext_noop("Dec")};
++
++/* long month names - can be any length */
++char *l_month[12]={ gettext_noop("January"), gettext_noop("February"), gettext_noop("March"),
++                    gettext_noop("April"), gettext_noop("long|May"), gettext_noop("June"),
++                    gettext_noop("July"),    gettext_noop("August"), gettext_noop("September"),
++                  gettext_noop("October"),  gettext_noop("November"),gettext_noop("December")};
++
++/* response code descriptions... order IS important!      */
++struct response_code response[] =
++       { { gettext_noop("Undefined response code"),                    0 },
++         { gettext_noop("Code 100 - Continue"),                        0 },
++         { gettext_noop("Code 101 - Switching Protocols"),             0 },
++         { gettext_noop("Code 200 - OK"),                              0 },
++         { gettext_noop("Code 201 - Created"),                         0 },
++         { gettext_noop("Code 202 - Accepted"),                        0 },
++         { gettext_noop("Code 203 - Non-Authoritative Information"),   0 },
++         { gettext_noop("Code 204 - No Content"),                      0 },
++         { gettext_noop("Code 205 - Reset Content"),                   0 },
++         { gettext_noop("Code 206 - Partial Content"),                 0 },
++         { gettext_noop("Code 300 - Multiple Choices"),                0 },
++         { gettext_noop("Code 301 - Moved Permanently"),               0 },
++         { gettext_noop("Code 302 - Found"),                           0 },
++         { gettext_noop("Code 303 - See Other"),                       0 },
++         { gettext_noop("Code 304 - Not Modified"),                    0 },
++         { gettext_noop("Code 305 - Use Proxy"),                       0 },
++         { gettext_noop("Code 307 - Moved Temporarily"),               0 },
++         { gettext_noop("Code 400 - Bad Request"),                     0 },
++         { gettext_noop("Code 401 - Unauthorized"),                    0 },
++         { gettext_noop("Code 402 - Payment Required"),                0 },
++         { gettext_noop("Code 403 - Forbidden"),                       0 },
++         { gettext_noop("Code 404 - Not Found"),                       0 },
++         { gettext_noop("Code 405 - Method Not Allowed"),              0 },
++         { gettext_noop("Code 406 - Not Acceptable"),                  0 },
++         { gettext_noop("Code 407 - Proxy Authentication Required"),   0 },
++         { gettext_noop("Code 408 - Request Timeout"),                 0 },
++         { gettext_noop("Code 409 - Conflict"),                        0 },
++         { gettext_noop("Code 410 - Gone"),                            0 },
++         { gettext_noop("Code 411 - Length Required"),                 0 },
++         { gettext_noop("Code 412 - Precondition Failed"),             0 },
++         { gettext_noop("Code 413 - Request Entity Too Large"),        0 },
++         { gettext_noop("Code 414 - Request-URI Too Long"),            0 },
++         { gettext_noop("Code 415 - Unsupported Media Type"),          0 },
++         { gettext_noop("Code 416 - Requested Range Not Satisfiable"), 0 },
++         { gettext_noop("Code 417 - Expectation Failed"),              0 },
++         { gettext_noop("Code 500 - Internal Server Error"),           0 },
++         { gettext_noop("Code 501 - Not Implemented"),                 0 },
++         { gettext_noop("Code 502 - Bad Gateway"),                     0 },
++         { gettext_noop("Code 503 - Service Unavailable"),             0 },
++         { gettext_noop("Code 504 - Gateway Timeout"),                 0 },
++         { gettext_noop("Code 505 - HTTP Version Not Supported"),      0 } };
++
++char *report_title;
++
++/* Country codes (previously in ctry.h header file) */
++
++struct  country_code ctry[] = {
++{ 0,                      gettext_noop("Unresolved/Unknown"),               0,0,0 },
++{ IDX_3C('c','o','m'),    gettext_noop("Commercial (com)"),                 0,0,0 },
++{ IDX_3C('e','d','u'),    gettext_noop("Educational (edu)"),                0,0,0 },
++{ IDX_3C('g','o','v'),    gettext_noop("US Government (gov)"),              0,0,0 },
++{ IDX_3C('i','n','t'),    gettext_noop("International (int)"),              0,0,0 },
++{ IDX_3C('m','i','l'),    gettext_noop("US Military (mil)"),                0,0,0 },
++{ IDX_3C('n','e','t'),    gettext_noop("Network (net)"),                    0,0,0 },
++{ IDX_3C('o','r','g'),    gettext_noop("Non-Profit (org)"),                 0,0,0 },
++{ IDX_3C('b','i','z'),    gettext_noop("Generic Business (biz)"),           0,0,0 },
++{ IDX_3C('c','a','t'),    gettext_noop("Catalan Community (cat)"),          0,0,0 },
++{ IDX_3C('p','r','o'),    gettext_noop("Professional (pro)"),               0,0,0 },
++{ IDX_3C('t','e','l'),    gettext_noop("Ind. Contact Data (tel)"),          0,0,0 },
++{ IDX_4C('a','e','r','o'),gettext_noop("Air Transport Industry (aero)"),    0,0,0 },
++{ IDX_4C('a','s','i','a'),gettext_noop("Asia Pacific Community (asia)"),    0,0,0 },
++{ IDX_4C('c','o','o','p'),gettext_noop("Cooperative Association (coop)"),   0,0,0 },
++{ IDX_4C('i','n','f','o'),gettext_noop("Generic TLD (info)"),               0,0,0 },
++{ IDX_4C('j','o','b','s'),gettext_noop("Human Resources (jobs)"),           0,0,0 },
++{ IDX_4C('m','o','b','i'),gettext_noop("Generic Mobile TLD (mobi)"),        0,0,0 },
++{ IDX_4C('n','a','m','e'),gettext_noop("Individual (name)"),                0,0,0 },
++{ IDX_4C('a','r','p','a'),gettext_noop("Address Routing (arpa)"),           0,0,0 },
++{ IDX_4C('n','a','t','o'),gettext_noop("Nato field (nato)"),                0,0,0 },
++{ IDX_6C('m','u','s','e','u','m'), gettext_noop("Museums (museum)"),        0,0,0 },
++{ IDX_6C('t','r','a','v','e','l'), gettext_noop("Travel Ind. (travel)"),    0,0,0 },
++{ IDX_2C('a','c'),        gettext_noop("Ascension Island"),                 0,0,0 },
++{ IDX_2C('a','d'),        gettext_noop("Andorra"),                          0,0,0 },
++{ IDX_2C('a','e'),        gettext_noop("United Arab Emirates"),             0,0,0 },
++{ IDX_2C('a','f'),        gettext_noop("Afghanistan"),                      0,0,0 },
++{ IDX_2C('a','g'),        gettext_noop("Antigua and Barbuda"),              0,0,0 },
++{ IDX_2C('a','i'),        gettext_noop("Anguilla"),                         0,0,0 },
++{ IDX_2C('a','l'),        gettext_noop("Albania"),                          0,0,0 },
++{ IDX_2C('a','m'),        gettext_noop("Armenia"),                          0,0,0 },
++{ IDX_2C('a','n'),        gettext_noop("Netherlands Antilles"),             0,0,0 },
++{ IDX_2C('a','o'),        gettext_noop("Angola"),                           0,0,0 },
++{ IDX_2C('a','q'),        gettext_noop("Antarctica"),                       0,0,0 },
++{ IDX_2C('a','r'),        gettext_noop("Argentina"),                        0,0,0 },
++{ IDX_2C('a','s'),        gettext_noop("American Samoa"),                   0,0,0 },
++{ IDX_2C('a','t'),        gettext_noop("Austria"),                          0,0,0 },
++{ IDX_2C('a','u'),        gettext_noop("Australia"),                        0,0,0 },
++{ IDX_2C('a','w'),        gettext_noop("Aruba"),                            0,0,0 },
++{ IDX_2C('a','x'),        gettext_noop("Aland Islands"),                    0,0,0 },
++{ IDX_2C('a','z'),        gettext_noop("Azerbaijan"),                       0,0,0 },
++{ IDX_2C('b','a'),        gettext_noop("Bosnia and Herzegovina"),           0,0,0 },
++{ IDX_2C('b','b'),        gettext_noop("Barbados"),                         0,0,0 },
++{ IDX_2C('b','d'),        gettext_noop("Bangladesh"),                       0,0,0 },
++{ IDX_2C('b','e'),        gettext_noop("Belgium"),                          0,0,0 },
++{ IDX_2C('b','f'),        gettext_noop("Burkina Faso"),                     0,0,0 },
++{ IDX_2C('b','g'),        gettext_noop("Bulgaria"),                         0,0,0 },
++{ IDX_2C('b','h'),        gettext_noop("Bahrain"),                          0,0,0 },
++{ IDX_2C('b','i'),        gettext_noop("Burundi"),                          0,0,0 },
++{ IDX_2C('b','j'),        gettext_noop("Benin"),                            0,0,0 },
++{ IDX_2C('b','l'),        gettext_noop("Saint Barthelemy"),                 0,0,0 },
++{ IDX_2C('b','m'),        gettext_noop("Bermuda"),                          0,0,0 },
++{ IDX_2C('b','n'),        gettext_noop("Brunei Darussalam"),                0,0,0 },
++{ IDX_2C('b','o'),        gettext_noop("Bolivia"),                          0,0,0 },
++{ IDX_2C('b','r'),        gettext_noop("Brazil"),                           0,0,0 },
++{ IDX_2C('b','s'),        gettext_noop("Bahamas"),                          0,0,0 },
++{ IDX_2C('b','t'),        gettext_noop("Bhutan"),                           0,0,0 },
++{ IDX_2C('b','v'),        gettext_noop("Bouvet Island"),                    0,0,0 },
++{ IDX_2C('b','w'),        gettext_noop("Botswana"),                         0,0,0 },
++{ IDX_2C('b','y'),        gettext_noop("Belarus"),                          0,0,0 },
++{ IDX_2C('b','z'),        gettext_noop("Belize"),                           0,0,0 },
++{ IDX_2C('c','a'),        gettext_noop("Canada"),                           0,0,0 },
++{ IDX_2C('c','c'),        gettext_noop("Cocos (Keeling) Islands"),          0,0,0 },
++{ IDX_2C('c','d'),        gettext_noop("Congo, Democratic Republic"),       0,0,0 },
++{ IDX_2C('c','f'),        gettext_noop("Central African Republic"),         0,0,0 },
++{ IDX_2C('c','g'),        gettext_noop("Congo"),                            0,0,0 },
++{ IDX_2C('c','h'),        gettext_noop("Switzerland"),                      0,0,0 },
++{ IDX_2C('c','i'),        gettext_noop("Cote D'Ivoire (Ivory Coast)"),      0,0,0 },
++{ IDX_2C('c','k'),        gettext_noop("Cook Islands"),                     0,0,0 },
++{ IDX_2C('c','l'),        gettext_noop("Chile"),                            0,0,0 },
++{ IDX_2C('c','m'),        gettext_noop("Cameroon"),                         0,0,0 },
++{ IDX_2C('c','n'),        gettext_noop("China"),                            0,0,0 },
++{ IDX_2C('c','o'),        gettext_noop("Colombia"),                         0,0,0 },
++{ IDX_2C('c','r'),        gettext_noop("Costa Rica"),                       0,0,0 },
++{ IDX_2C('c','u'),        gettext_noop("Cuba"),                             0,0,0 },
++{ IDX_2C('c','v'),        gettext_noop("Cape Verde"),                       0,0,0 },
++{ IDX_2C('c','x'),        gettext_noop("Christmas Island"),                 0,0,0 },
++{ IDX_2C('c','y'),        gettext_noop("Cyprus"),                           0,0,0 },
++{ IDX_2C('c','z'),        gettext_noop("Czech Republic"),                   0,0,0 },
++{ IDX_2C('d','e'),        gettext_noop("Germany"),                          0,0,0 },
++{ IDX_2C('d','j'),        gettext_noop("Djibouti"),                         0,0,0 },
++{ IDX_2C('d','k'),        gettext_noop("Denmark"),                          0,0,0 },
++{ IDX_2C('d','m'),        gettext_noop("Dominica"),                         0,0,0 },
++{ IDX_2C('d','o'),        gettext_noop("Dominican Republic"),               0,0,0 },
++{ IDX_2C('d','z'),        gettext_noop("Algeria"),                          0,0,0 },
++{ IDX_2C('e','c'),        gettext_noop("Ecuador"),                          0,0,0 },
++{ IDX_2C('e','e'),        gettext_noop("Estonia"),                          0,0,0 },
++{ IDX_2C('e','g'),        gettext_noop("Egypt"),                            0,0,0 },
++{ IDX_2C('e','h'),        gettext_noop("Western Sahara"),                   0,0,0 },
++{ IDX_2C('e','r'),        gettext_noop("Eritrea"),                          0,0,0 },
++{ IDX_2C('e','s'),        gettext_noop("Spain"),                            0,0,0 },
++{ IDX_2C('e','t'),        gettext_noop("Ethiopia"),                         0,0,0 },
++{ IDX_2C('e','u'),        gettext_noop("European Union"),                   0,0,0 },
++{ IDX_2C('f','i'),        gettext_noop("Finland"),                          0,0,0 },
++{ IDX_2C('f','j'),        gettext_noop("Fiji"),                             0,0,0 },
++{ IDX_2C('f','k'),        gettext_noop("Falkland Islands (Malvinas)"),      0,0,0 },
++{ IDX_2C('f','m'),        gettext_noop("Micronesia"),                       0,0,0 },
++{ IDX_2C('f','o'),        gettext_noop("Faroe Islands"),                    0,0,0 },
++{ IDX_2C('f','r'),        gettext_noop("France"),                           0,0,0 },
++{ IDX_2C('g','a'),        gettext_noop("Gabon"),                            0,0,0 },
++{ IDX_2C('g','b'),        gettext_noop("Great Britain (UK)"),               0,0,0 },
++{ IDX_2C('g','d'),        gettext_noop("Grenada"),                          0,0,0 },
++{ IDX_2C('g','e'),        gettext_noop("Georgia"),                          0,0,0 },
++{ IDX_2C('g','f'),        gettext_noop("French Guiana"),                    0,0,0 },
++{ IDX_2C('g','g'),        gettext_noop("Guernsey"),                         0,0,0 },
++{ IDX_2C('g','h'),        gettext_noop("Ghana"),                            0,0,0 },
++{ IDX_2C('g','i'),        gettext_noop("Gibraltar"),                        0,0,0 },
++{ IDX_2C('g','l'),        gettext_noop("Greenland"),                        0,0,0 },
++{ IDX_2C('g','m'),        gettext_noop("Gambia"),                           0,0,0 },
++{ IDX_2C('g','n'),        gettext_noop("Guinea"),                           0,0,0 },
++{ IDX_2C('g','p'),        gettext_noop("Guadeloupe"),                       0,0,0 },
++{ IDX_2C('g','q'),        gettext_noop("Equatorial Guinea"),                0,0,0 },
++{ IDX_2C('g','r'),        gettext_noop("Greece"),                           0,0,0 },
++{ IDX_2C('g','s'),        gettext_noop("S. Georgia and S. Sandwich Isls."), 0,0,0 },
++{ IDX_2C('g','t'),        gettext_noop("Guatemala"),                        0,0,0 },
++{ IDX_2C('g','u'),        gettext_noop("Guam"),                             0,0,0 },
++{ IDX_2C('g','w'),        gettext_noop("Guinea-Bissau"),                    0,0,0 },
++{ IDX_2C('g','y'),        gettext_noop("Guyana"),                           0,0,0 },
++{ IDX_2C('h','k'),        gettext_noop("Hong Kong"),                        0,0,0 },
++{ IDX_2C('h','m'),        gettext_noop("Heard and McDonald Islands"),       0,0,0 },
++{ IDX_2C('h','n'),        gettext_noop("Honduras"),                         0,0,0 },
++{ IDX_2C('h','r'),        gettext_noop("Croatia"),                          0,0,0 },
++{ IDX_2C('h','t'),        gettext_noop("Haiti"),                            0,0,0 },
++{ IDX_2C('h','u'),        gettext_noop("Hungary"),                          0,0,0 },
++{ IDX_2C('i','d'),        gettext_noop("Indonesia"),                        0,0,0 },
++{ IDX_2C('i','e'),        gettext_noop("Ireland"),                          0,0,0 },
++{ IDX_2C('i','l'),        gettext_noop("Israel"),                           0,0,0 },
++{ IDX_2C('i','m'),        gettext_noop("Isle of Man"),                      0,0,0 },
++{ IDX_2C('i','n'),        gettext_noop("India"),                            0,0,0 },
++{ IDX_2C('i','o'),        gettext_noop("British Indian Ocean Territory"),   0,0,0 },
++{ IDX_2C('i','q'),        gettext_noop("Iraq"),                             0,0,0 },
++{ IDX_2C('i','r'),        gettext_noop("Iran"),                             0,0,0 },
++{ IDX_2C('i','s'),        gettext_noop("Iceland"),                          0,0,0 },
++{ IDX_2C('i','t'),        gettext_noop("Italy"),                            0,0,0 },
++{ IDX_2C('j','e'),        gettext_noop("Jersey"),                           0,0,0 },
++{ IDX_2C('j','m'),        gettext_noop("Jamaica"),                          0,0,0 },
++{ IDX_2C('j','o'),        gettext_noop("Jordan"),                           0,0,0 },
++{ IDX_2C('j','p'),        gettext_noop("Japan"),                            0,0,0 },
++{ IDX_2C('k','e'),        gettext_noop("Kenya"),                            0,0,0 },
++{ IDX_2C('k','g'),        gettext_noop("Kyrgyzstan"),                       0,0,0 },
++{ IDX_2C('k','h'),        gettext_noop("Cambodia"),                         0,0,0 },
++{ IDX_2C('k','i'),        gettext_noop("Kiribati"),                         0,0,0 },
++{ IDX_2C('k','m'),        gettext_noop("Comoros"),                          0,0,0 },
++{ IDX_2C('k','n'),        gettext_noop("Saint Kitts and Nevis"),            0,0,0 },
++{ IDX_2C('k','p'),        gettext_noop("Korea, Democratic Republic of"),    0,0,0 },
++{ IDX_2C('k','r'),        gettext_noop("Korea, Republic of"),               0,0,0 },
++{ IDX_2C('k','w'),        gettext_noop("Kuwait"),                           0,0,0 },
++{ IDX_2C('k','y'),        gettext_noop("Cayman Islands"),                   0,0,0 },
++{ IDX_2C('k','z'),        gettext_noop("Kazakhstan"),                       0,0,0 },
++{ IDX_2C('l','a'),        gettext_noop("Laos"),                             0,0,0 },
++{ IDX_2C('l','b'),        gettext_noop("Lebanon"),                          0,0,0 },
++{ IDX_2C('l','c'),        gettext_noop("Saint Lucia"),                      0,0,0 },
++{ IDX_2C('l','i'),        gettext_noop("Liechtenstein"),                    0,0,0 },
++{ IDX_2C('l','k'),        gettext_noop("Sri Lanka"),                        0,0,0 },
++{ IDX_2C('l','r'),        gettext_noop("Liberia"),                          0,0,0 },
++{ IDX_2C('l','s'),        gettext_noop("Lesotho"),                          0,0,0 },
++{ IDX_2C('l','t'),        gettext_noop("Lithuania"),                        0,0,0 },
++{ IDX_2C('l','u'),        gettext_noop("Luxembourg"),                       0,0,0 },
++{ IDX_2C('l','v'),        gettext_noop("Latvia"),                           0,0,0 },
++{ IDX_2C('l','y'),        gettext_noop("Libya"),                            0,0,0 },
++{ IDX_2C('m','a'),        gettext_noop("Morocco"),                          0,0,0 },
++{ IDX_2C('m','c'),        gettext_noop("Monaco"),                           0,0,0 },
++{ IDX_2C('m','d'),        gettext_noop("Moldova"),                          0,0,0 },
++{ IDX_2C('m','e'),        gettext_noop("Montenegro"),                       0,0,0 },
++{ IDX_2C('m','f'),        gettext_noop("Saint Martin (French part)"),       0,0,0 },
++{ IDX_2C('m','g'),        gettext_noop("Madagascar"),                       0,0,0 },
++{ IDX_2C('m','h'),        gettext_noop("Marshall Islands"),                 0,0,0 },
++{ IDX_2C('m','k'),        gettext_noop("Macedonia"),                        0,0,0 },
++{ IDX_2C('m','l'),        gettext_noop("Mali"),                             0,0,0 },
++{ IDX_2C('m','m'),        gettext_noop("Myanmar"),                          0,0,0 },
++{ IDX_2C('m','n'),        gettext_noop("Mongolia"),                         0,0,0 },
++{ IDX_2C('m','o'),        gettext_noop("Macau"),                            0,0,0 },
++{ IDX_2C('m','p'),        gettext_noop("Northern Mariana Islands"),         0,0,0 },
++{ IDX_2C('m','q'),        gettext_noop("Martinique"),                       0,0,0 },
++{ IDX_2C('m','r'),        gettext_noop("Mauritania"),                       0,0,0 },
++{ IDX_2C('m','s'),        gettext_noop("Montserrat"),                       0,0,0 },
++{ IDX_2C('m','t'),        gettext_noop("Malta"),                            0,0,0 },
++{ IDX_2C('m','u'),        gettext_noop("Mauritius"),                        0,0,0 },
++{ IDX_2C('m','v'),        gettext_noop("Maldives"),                         0,0,0 },
++{ IDX_2C('m','w'),        gettext_noop("Malawi"),                           0,0,0 },
++{ IDX_2C('m','x'),        gettext_noop("Mexico"),                           0,0,0 },
++{ IDX_2C('m','y'),        gettext_noop("Malaysia"),                         0,0,0 },
++{ IDX_2C('m','z'),        gettext_noop("Mozambique"),                       0,0,0 },
++{ IDX_2C('n','a'),        gettext_noop("Namibia"),                          0,0,0 },
++{ IDX_2C('n','c'),        gettext_noop("New Caledonia"),                    0,0,0 },
++{ IDX_2C('n','e'),        gettext_noop("Niger"),                            0,0,0 },
++{ IDX_2C('n','f'),        gettext_noop("Norfolk Island"),                   0,0,0 },
++{ IDX_2C('n','g'),        gettext_noop("Nigeria"),                          0,0,0 },
++{ IDX_2C('n','i'),        gettext_noop("Nicaragua"),                        0,0,0 },
++{ IDX_2C('n','l'),        gettext_noop("Netherlands"),                      0,0,0 },
++{ IDX_2C('n','o'),        gettext_noop("Norway"),                           0,0,0 },
++{ IDX_2C('n','p'),        gettext_noop("Nepal"),                            0,0,0 },
++{ IDX_2C('n','r'),        gettext_noop("Nauru"),                            0,0,0 },
++{ IDX_2C('n','u'),        gettext_noop("Niue"),                             0,0,0 },
++{ IDX_2C('n','z'),        gettext_noop("New Zealand"),                      0,0,0 },
++{ IDX_2C('o','m'),        gettext_noop("Oman"),                             0,0,0 },
++{ IDX_2C('p','a'),        gettext_noop("Panama"),                           0,0,0 },
++{ IDX_2C('p','e'),        gettext_noop("Peru"),                             0,0,0 },
++{ IDX_2C('p','f'),        gettext_noop("French Polynesia"),                 0,0,0 },
++{ IDX_2C('p','g'),        gettext_noop("Papua New Guinea"),                 0,0,0 },
++{ IDX_2C('p','h'),        gettext_noop("Philippines"),                      0,0,0 },
++{ IDX_2C('p','k'),        gettext_noop("Pakistan"),                         0,0,0 },
++{ IDX_2C('p','l'),        gettext_noop("Poland"),                           0,0,0 },
++{ IDX_2C('p','m'),        gettext_noop("St. Pierre and Miquelon"),          0,0,0 },
++{ IDX_2C('p','n'),        gettext_noop("Pitcairn"),                         0,0,0 },
++{ IDX_2C('p','r'),        gettext_noop("Puerto Rico"),                      0,0,0 },
++{ IDX_2C('p','s'),        gettext_noop("Palestinian Territory, Occupied"),  0,0,0 },
++{ IDX_2C('p','t'),        gettext_noop("Portugal"),                         0,0,0 },
++{ IDX_2C('p','w'),        gettext_noop("Palau"),                            0,0,0 },
++{ IDX_2C('p','y'),        gettext_noop("Paraguay"),                         0,0,0 },
++{ IDX_2C('q','a'),        gettext_noop("Qatar"),                            0,0,0 },
++{ IDX_2C('r','e'),        gettext_noop("Reunion"),                          0,0,0 },
++{ IDX_2C('r','o'),        gettext_noop("Romania"),                          0,0,0 },
++{ IDX_2C('r','s'),        gettext_noop("Serbia"),                           0,0,0 },
++{ IDX_2C('r','u'),        gettext_noop("Russian Federation"),               0,0,0 },
++{ IDX_2C('r','w'),        gettext_noop("Rwanda"),                           0,0,0 },
++{ IDX_2C('s','a'),        gettext_noop("Saudi Arabia"),                     0,0,0 },
++{ IDX_2C('s','b'),        gettext_noop("Solomon Islands"),                  0,0,0 },
++{ IDX_2C('s','c'),        gettext_noop("Seychelles"),                       0,0,0 },
++{ IDX_2C('s','d'),        gettext_noop("Sudan"),                            0,0,0 },
++{ IDX_2C('s','e'),        gettext_noop("Sweden"),                           0,0,0 },
++{ IDX_2C('s','g'),        gettext_noop("Singapore"),                        0,0,0 },
++{ IDX_2C('s','h'),        gettext_noop("St. Helena"),                       0,0,0 },
++{ IDX_2C('s','i'),        gettext_noop("Slovenia"),                         0,0,0 },
++{ IDX_2C('s','j'),        gettext_noop("Svalbard and Jan Mayen Islands"),   0,0,0 },
++{ IDX_2C('s','k'),        gettext_noop("Slovakia"),                         0,0,0 },
++{ IDX_2C('s','l'),        gettext_noop("Sierra Leone"),                     0,0,0 },
++{ IDX_2C('s','m'),        gettext_noop("San Marino"),                       0,0,0 },
++{ IDX_2C('s','n'),        gettext_noop("Senegal"),                          0,0,0 },
++{ IDX_2C('s','o'),        gettext_noop("Somalia"),                          0,0,0 },
++{ IDX_2C('s','r'),        gettext_noop("Suriname"),                         0,0,0 },
++{ IDX_2C('s','t'),        gettext_noop("Sao Tome and Principe"),            0,0,0 },
++{ IDX_2C('s','u'),        gettext_noop("Soviet Union"),                     0,0,0 },
++{ IDX_2C('s','v'),        gettext_noop("El Salvador"),                      0,0,0 },
++{ IDX_2C('s','y'),        gettext_noop("Syrian Arab Republic"),             0,0,0 },
++{ IDX_2C('s','z'),        gettext_noop("Swaziland"),                        0,0,0 },
++{ IDX_2C('t','c'),        gettext_noop("Turks and Caicos Islands"),         0,0,0 },
++{ IDX_2C('t','d'),        gettext_noop("Chad"),                             0,0,0 },
++{ IDX_2C('t','f'),        gettext_noop("French Southern Territories"),      0,0,0 },
++{ IDX_2C('t','g'),        gettext_noop("Togo"),                             0,0,0 },
++{ IDX_2C('t','h'),        gettext_noop("Thailand"),                         0,0,0 },
++{ IDX_2C('t','j'),        gettext_noop("Tajikistan"),                       0,0,0 },
++{ IDX_2C('t','k'),        gettext_noop("Tokelau"),                          0,0,0 },
++{ IDX_2C('t','l'),        gettext_noop("Timor-Leste"),                      0,0,0 },
++{ IDX_2C('t','m'),        gettext_noop("Turkmenistan"),                     0,0,0 },
++{ IDX_2C('t','n'),        gettext_noop("Tunisia"),                          0,0,0 },
++{ IDX_2C('t','o'),        gettext_noop("Tonga"),                            0,0,0 },
++{ IDX_2C('t','p'),        gettext_noop("Portuguese Timor"),                 0,0,0 },
++{ IDX_2C('t','r'),        gettext_noop("Turkey"),                           0,0,0 },
++{ IDX_2C('t','t'),        gettext_noop("Trinidad and Tobago"),              0,0,0 },
++{ IDX_2C('t','v'),        gettext_noop("Tuvalu"),                           0,0,0 },
++{ IDX_2C('t','w'),        gettext_noop("Taiwan"),                           0,0,0 },
++{ IDX_2C('t','z'),        gettext_noop("Tanzania"),                         0,0,0 },
++{ IDX_2C('u','a'),        gettext_noop("Ukraine"),                          0,0,0 },
++{ IDX_2C('u','g'),        gettext_noop("Uganda"),                           0,0,0 },
++{ IDX_2C('u','k'),        gettext_noop("United Kingdom"),                   0,0,0 },
++{ IDX_2C('u','m'),        gettext_noop("US Minor Outlying Islands"),        0,0,0 },
++{ IDX_2C('u','s'),        gettext_noop("United States"),                    0,0,0 },
++{ IDX_2C('u','y'),        gettext_noop("Uruguay"),                          0,0,0 },
++{ IDX_2C('u','z'),        gettext_noop("Uzbekistan"),                       0,0,0 },
++{ IDX_2C('v','a'),        gettext_noop("Vatican City State (Holy See)"),    0,0,0 },
++{ IDX_2C('v','c'),        gettext_noop("Saint Vincent and the Grenadines"), 0,0,0 },
++{ IDX_2C('v','e'),        gettext_noop("Venezuela"),                        0,0,0 },
++{ IDX_2C('v','g'),        gettext_noop("Virgin Islands (British)"),         0,0,0 },
++{ IDX_2C('v','i'),        gettext_noop("Virgin Islands (U.S.)"),            0,0,0 },
++{ IDX_2C('v','n'),        gettext_noop("Vietnam"),                          0,0,0 },
++{ IDX_2C('v','u'),        gettext_noop("Vanuatu"),                          0,0,0 },
++{ IDX_2C('w','f'),        gettext_noop("Wallis and Futuna Islands"),        0,0,0 },
++{ IDX_2C('w','s'),        gettext_noop("Samoa"),                            0,0,0 },
++{ IDX_2C('y','e'),        gettext_noop("Yemen"),                            0,0,0 },
++{ IDX_2C('y','t'),        gettext_noop("Mayotte"),                          0,0,0 },
++{ IDX_2C('y','u'),        gettext_noop("Yugoslavia"),                       0,0,0 },
++{ IDX_2C('z','a'),        gettext_noop("South Africa"),                     0,0,0 },
++{ IDX_2C('z','m'),        gettext_noop("Zambia"),                           0,0,0 },
++{ IDX_2C('z','w'),        gettext_noop("Zimbabwe"),                         0,0,0 },
++{ IDX_2C('a','1'),        gettext_noop("Anonymous Proxy"),                  0,0,0 },
++{ IDX_2C('a','2'),        gettext_noop("Satellite Provider"),               0,0,0 },
++{ IDX_2C('o','1'),        gettext_noop("Other"),                            0,0,0 },
++{ IDX_2C('a','p'),        gettext_noop("Asia/Pacific Region"),              0,0,0 },
++{ IDX_3C('l','a','n'),    gettext_noop("Local Network (lan)"),              0,0,0 },
++{ 0              ,        NULL,                               0,0,0 }};
+Index: webalizer/lang_po.sh
+===================================================================
+--- /dev/null  1970-01-01 00:00:00.000000000 +0000
++++ webalizer/lang_po.sh       2011-01-07 19:13:13.000000000 +0100
+@@ -0,0 +1,24 @@
++#!/bin/bash
++# create  lang.txt file with vars and strings from webalizer_lang.english file
++cat lang/webalizer_lang.english | grep ^char | sed \
++      -e 's/^char//' -e 's/ \*//' -e 's/= /=/' -e 's/ *=/=/' \
++      -e 's/="/=/' -e 's/;$//' -e 's/"$//' -e 's/!/\\!/' | \
++      grep -v "^l_month" | grep -v "^s_month" | grep -v "^h_msg" | \
++      grep -v "^language=" | sort -r > lang.txt
++# create a sed line with -e options that subst msg_* strings to _("string")
++# take strings from lang.txt file.
++SED_E="";
++for i in $(cat lang.txt |cut -f1 -d=); do
++  SUBST=$(cat lang.txt | grep ^$i=| cut -f2 -d=);
++  SED_E="$SED_E -e "'"'"s/\<$i\>/_("'\"'$SUBST'\"'")/"'"'
++done;
++# create a script file with commands to subst and create a diff file
++# I create this script because had errors when I tried to run commands here.
++echo "" > lang_po_exec.sh
++for i in *.c; do
++  echo "cat $i | sed $SED_E > $i.new;" >> lang_po_exec.sh;
++  echo "cat $i.new > $i;" >> lang_po_exec.sh;
++  echo "rm -f $i.new;" >> lang_po_exec.sh;
++done;
++bash ./lang_po_exec.sh;
++rm -f lang_po_exec.sh lang.txt;
+Index: webalizer/output.c
+===================================================================
+--- webalizer.orig/output.c    2011-01-07 19:12:31.000000000 +0100
++++ webalizer/output.c 2011-01-07 19:13:13.000000000 +0100
+@@ -191,7 +191,7 @@
+    fprintf(out_fp,"<HTML lang=\"%s\">\n<HEAD>\n",langcode);
+    fprintf(out_fp," <TITLE>%s %s - %s</TITLE>\n",
+-                  msg_title, hname, (period)?period:msg_main_per);
++                  report_title, hname, (period)?period:msg_main_per);
+    lptr=html_head;
+    while (lptr!=NULL)
+    {
+@@ -213,7 +213,7 @@
+          lptr=lptr->next;
+       }
+    }
+-   fprintf(out_fp,"<H2>%s %s</H2>\n",msg_title, hname);
++   fprintf(out_fp,"<H2>%s %s</H2>\n",report_title, hname);
+    if (period)
+       fprintf(out_fp,"<SMALL><STRONG>\n%s: %s<BR>\n",msg_hhdr_sp,period);
+    else
+@@ -289,7 +289,7 @@
+    char htitle[256];
+    if (verbose>1)
+-      printf("%s %s %d\n",msg_gen_rpt, l_month[cur_month-1], cur_year); 
++      printf("%s %s %d\n",msg_gen_rpt, Q_(l_month[cur_month-1]), cur_year); 
+    /* fill in filenames */
+    snprintf(html_fname,sizeof(html_fname),"usage_%04d%02d.%s",
+@@ -301,7 +301,7 @@
+    if (daily_graph)
+    {
+       snprintf(dtitle,sizeof(dtitle),"%s %s %d",
+-               msg_hmth_du,l_month[cur_month-1],cur_year);
++               msg_hmth_du,Q_(l_month[cur_month-1]),cur_year);
+       month_graph6 (  png1_fname,          /* filename          */
+                       dtitle,              /* graph title       */
+                       cur_month,           /* graph month       */
+@@ -319,7 +319,7 @@
+    if (hourly_graph)
+    {
+       snprintf(htitle,sizeof(htitle),"%s %s %d",
+-               msg_hmth_hu,l_month[cur_month-1],cur_year);
++               msg_hmth_hu,Q_(l_month[cur_month-1]),cur_year);
+       day_graph3(    png2_fname,
+                      htitle,
+                      th_hit,
+@@ -331,7 +331,7 @@
+    /* first, open the file */
+    if ( (out_fp=open_out_file(html_fname))==NULL ) return 1;
+-   snprintf(buffer,sizeof(buffer),"%s %d",l_month[cur_month-1],cur_year);
++   snprintf(buffer,sizeof(buffer),"%s %d",Q_(l_month[cur_month-1]),cur_year);
+    write_html_head(buffer, out_fp);
+    month_links();
+    month_total_table();
+@@ -529,7 +529,7 @@
+    fprintf(out_fp,"<TABLE WIDTH=510 BORDER=2 CELLSPACING=1 CELLPADDING=1>\n");
+    fprintf(out_fp,"<TR><TH HEIGHT=4></TH></TR>\n");
+    fprintf(out_fp,"<TR><TH COLSPAN=3 ALIGN=center BGCOLOR=\"%s\">"           \
+-      "%s %s %d</TH></TR>\n",GREY,msg_mtot_ms,l_month[cur_month-1],cur_year);
++      "%s %s %d</TH></TR>\n",GREY,msg_mtot_ms,Q_(l_month[cur_month-1]),cur_year);
+    fprintf(out_fp,"<TR><TH HEIGHT=4></TH></TR>\n");
+    /* Total Hits */
+    fprintf(out_fp,"<TR><TD WIDTH=380><FONT SIZE=\"-1\">%s</FONT></TD>\n"     \
+@@ -694,7 +694,7 @@
+    /* Daily statistics for ... */
+    fprintf(out_fp,"<TR><TH BGCOLOR=\"%s\" COLSPAN=%d ALIGN=center>"          \
+            "%s %s %d</TH></TR>\n",
+-           GREY,(dump_inout==0)?13:17,msg_dtot_ds,l_month[cur_month-1], cur_year);
++           GREY,(dump_inout==0)?13:17,msg_dtot_ds,Q_(l_month[cur_month-1]), cur_year);
+    fprintf(out_fp,"<TR><TH HEIGHT=4></TH></TR>\n");
+    fprintf(out_fp,"<TR><TH ALIGN=center BGCOLOR=\"%s\">"                     \
+                   "<FONT SIZE=\"-1\">%s</FONT></TH>\n"                       \
+@@ -807,7 +807,7 @@
+    fprintf(out_fp,"<TR><TH HEIGHT=4></TH></TR>\n");
+    fprintf(out_fp,"<TR><TH BGCOLOR=\"%s\" COLSPAN=%d ALIGN=center>"\
+            "%s %s %d</TH></TR>\n",
+-           GREY,(dump_inout==0)?13:19,msg_htot_hs,l_month[cur_month-1], cur_year);
++           GREY,(dump_inout==0)?13:19,msg_htot_hs,Q_(l_month[cur_month-1]), cur_year);
+    fprintf(out_fp,"<TR><TH HEIGHT=4></TH></TR>\n");
+    fprintf(out_fp,"<TR><TH ALIGN=center ROWSPAN=2 BGCOLOR=\"%s\">" \
+                   "<FONT SIZE=\"-1\">%s</FONT></TH>\n"             \
+@@ -1085,7 +1085,7 @@
+    if ( (out_fp=open_out_file(site_fname))==NULL ) return 0;
+    snprintf(buffer,sizeof(buffer),"%s %d - %s",
+-            l_month[cur_month-1],cur_year,msg_h_sites);
++            Q_(l_month[cur_month-1]),cur_year,msg_h_sites);
+    write_html_head(buffer, out_fp);
+    fprintf(out_fp,"<FONT SIZE=\"-1\"></CENTER><PRE>\n");
+@@ -1344,7 +1344,7 @@
+    if ( (out_fp=open_out_file(url_fname))==NULL ) return 0;
+    snprintf(buffer,sizeof(buffer),"%s %d - %s",
+-            l_month[cur_month-1],cur_year,msg_h_url);
++            Q_(l_month[cur_month-1]),cur_year,msg_h_url);
+    write_html_head(buffer, out_fp);
+    fprintf(out_fp,"<FONT SIZE=\"-1\"></CENTER><PRE>\n");
+@@ -1644,7 +1644,7 @@
+    if ( (out_fp=open_out_file(ref_fname))==NULL ) return 0;
+    snprintf(buffer,sizeof(buffer),"%s %d - %s",
+-            l_month[cur_month-1],cur_year,msg_h_ref);
++            Q_(l_month[cur_month-1]),cur_year,msg_h_ref);
+    write_html_head(buffer, out_fp);
+    fprintf(out_fp,"<FONT SIZE=\"-1\"></CENTER><PRE>\n");
+@@ -1798,7 +1798,7 @@
+    if ( (out_fp=open_out_file(agent_fname))==NULL ) return 0;
+    snprintf(buffer,sizeof(buffer),"%s %d - %s",
+-            l_month[cur_month-1],cur_year,msg_h_agent);
++            Q_(l_month[cur_month-1]),cur_year,msg_h_agent);
+    write_html_head(buffer, out_fp);
+    fprintf(out_fp,"<FONT SIZE=\"-1\"></CENTER><PRE>\n");
+@@ -1934,7 +1934,7 @@
+    if ( (out_fp=open_out_file(search_fname))==NULL ) return 0;
+    snprintf(buffer,sizeof(buffer),"%s %d - %s",
+-            l_month[cur_month-1],cur_year,msg_h_search);
++            Q_(l_month[cur_month-1]),cur_year,msg_h_search);
+    write_html_head(buffer, out_fp);
+    fprintf(out_fp,"<FONT SIZE=\"-1\"></CENTER><PRE>\n");
+@@ -2098,7 +2098,7 @@
+    if ( (out_fp=open_out_file(user_fname))==NULL ) return 0;
+    snprintf(buffer,sizeof(buffer),"%s %d - %s",
+-            l_month[cur_month-1],cur_year,msg_h_uname);
++            Q_(l_month[cur_month-1]),cur_year,msg_h_uname);
+    write_html_head(buffer, out_fp);
+    fprintf(out_fp,"<FONT SIZE=\"-1\"></CENTER><PRE>\n");
+@@ -2226,7 +2226,7 @@
+                   if (geo_ctry[0]=='-')
+                   {
+                      if (debug_mode)
+-                        fprintf(stderr,"GeoDB: %s unknown!\n",hptr->string);
++                        fprintf(stderr,_("GeoDB: %s unknown!\n"),hptr->string);
+                   }
+                   else idx=ctry_idx(geo_ctry);
+                }
+@@ -2239,7 +2239,7 @@
+                   if (geo_rc==NULL||geo_rc[0]=='\0'||geo_rc[0]=='-')
+                   {
+                      if (debug_mode)
+-                        fprintf(stderr,"GeoIP: %s unknown (returns '%s')\n",
++                        fprintf(stderr,_("GeoIP: %s unknown (returns '%s')\n"),
+                                 hptr->string,(geo_rc==NULL)?"null":geo_rc);
+                   }
+                   else
+@@ -2321,10 +2321,10 @@
+       for (i=0;i<j;i++)
+       {
+          pie_data[i]=top_ctrys[i]->count;           /* load the array       */
+-         pie_legend[i]=top_ctrys[i]->desc;
++         pie_legend[i]=_(top_ctrys[i]->desc);
+       }
+       snprintf(pie_title,sizeof(pie_title),"%s %s %d",
+-               msg_ctry_use,l_month[cur_month-1],cur_year);
++               msg_ctry_use,Q_(l_month[cur_month-1]),cur_year);
+       sprintf(pie_fname,"ctry_usage_%04d%02d.png",cur_year,cur_month);
+       pie_chart(pie_fname,pie_title,t_hit,pie_data,pie_legend);  /* do it   */
+@@ -2741,7 +2741,7 @@
+       else
+       {
+          if (errno!=EEXIST && verbose)
+-            fprintf(stderr,"Error: Failed to create .htaccess file: %s\n",
++            fprintf(stderr,_("Error: Failed to create .htaccess file: %s\n"),
+                     strerror(errno));
+       }
+    }
+@@ -2849,10 +2849,10 @@
+          fprintf(out_fp,"<A HREF=\"usage_%04d%02d.%s\">"                  \
+                         "<FONT SIZE=\"-1\">%s %d</FONT></A></TD>\n",
+                          hist[i].year, hist[i].month, html_ext,
+-                         s_month[hist[i].month-1], hist[i].year);
++                         Q_(s_month[hist[i].month-1]), hist[i].year);
+       else
+          fprintf(out_fp,"<FONT SIZE=\"-1\">%s %d</FONT></A></TD>\n",      \
+-                         s_month[hist[i].month-1], hist[i].year);
++                         Q_(s_month[hist[i].month-1]), hist[i].year);
+                      
+       fprintf(out_fp,"<TD ALIGN=right><FONT SIZE=\"-1\">%llu</FONT></TD>\n",
+                       hist[i].hit/days_in_month);
+Index: webalizer/update_po.sh
+===================================================================
+--- /dev/null  1970-01-01 00:00:00.000000000 +0000
++++ webalizer/update_po.sh     2011-01-07 19:13:13.000000000 +0100
+@@ -0,0 +1,9 @@
++# 7. Created webalizer.pot file with the follow command:
++    xgettext --default-domain=webalizer --directory=. -o po/webalizer.pot \
++             --language=C --add-comments="TRANS:" --escape --sort-by-file \
++             --keyword=_ --keyword=N_ --keyword=Q_ --keyword=PL_:1,2 *.c *.h
++# 8. Merged old .po files.
++    for i in po/*.po;do echo -n $i;msgmerge -U $i po/webalizer.pot;done;
++    rm -f po/*.po~;
++
++
+Index: webalizer/webalizer.c
+===================================================================
+--- webalizer.orig/webalizer.c 2011-01-07 19:12:51.000000000 +0100
++++ webalizer/webalizer.c      2011-01-07 19:13:13.000000000 +0100
+@@ -86,7 +86,7 @@
+ #include "preserve.h"
+ #include "hashtab.h"
+ #include "linklist.h"
+-#include "webalizer_lang.h"                    /* lang. support            */
++#include "lang2.h"                             /* lang. support            */
+ #ifdef USE_DNS
+ #include "dns_resolv.h"
+ #endif
+@@ -96,7 +96,7 @@
+ void    clear_month();                              /* clear monthly stuff */
+ char    *unescape(char *);                          /* unescape URLs       */
+ void    print_opts(char *);                         /* print options       */
+-void    print_version();                            /* duhh...             */
++void    print_version(char * locale);               /* duhh...             */
+ int     isurlchar(unsigned char, int);              /* valid URL char fnc. */
+ void    get_config(char *);                         /* Read a config file  */
+ static  char *save_opt(char *);                     /* save conf option    */
+@@ -299,6 +299,7 @@
+    time_t start_time, end_time;          /* program timers              */
+    float  temp_time;                     /* temporary time storage      */
++   char *current_locale;
+    int    rec_year,rec_month=1,rec_day,rec_hour,rec_min,rec_sec;
+@@ -317,10 +318,16 @@
+    /* stat struct for files */
+    struct stat log_stat;
++   current_locale = setlocale (LC_ALL, "");
++   bindtextdomain ("webalizer", DATADIR"/locale");
++   textdomain ("webalizer");
+    /* Assume that LC_CTYPE is what the user wants for non-ASCII chars   */
+    setlocale(LC_CTYPE,"");
++   /* Initialise report_title with the default localized value          */
++   report_title = msg_title;
++
+    /* initalize epoch */
+    epoch=jdate(1,1,1970);                /* used for timestamp adj.     */
+@@ -377,12 +384,12 @@
+         case 'R': ntop_refs=atoi(optarg);    break;  /* Top referrers       */
+         case 's': add_nlist(optarg,&hidden_sites);  break; /* Hide site     */
+         case 'S': ntop_sites=atoi(optarg);   break;  /* Top sites           */
+-        case 't': msg_title=optarg;          break;  /* Report title        */
++        case 't': report_title=optarg;       break;  /* Report title        */
+         case 'T': time_me=1;                 break;  /* TimeMe              */
+         case 'u': add_nlist(optarg,&hidden_urls);   break; /* hide URL      */
+         case 'U': ntop_urls=atoi(optarg);    break;  /* Top urls            */
+         case 'v': verbose=2; debug_mode=1;   break;  /* Verbose             */
+-        case 'V': print_version();           break;  /* Version             */
++        case 'V': print_version(current_locale); break;  /* Version         */
+ #ifdef USE_GEOIP
+         case 'w': geoip=1;                   break;  /* Enable GeoIP        */
+         case 'W': geoip_db=optarg;           break;  /* GeoIP database name */
+@@ -482,9 +489,9 @@
+    if (verbose>1)
+    {
+       uname(&system_info);
+-      printf("Webalizer V%s-%s (%s %s %s) %s\n", version,editlvl,
++      printf("Webalizer V%s-%s (%s %s %s) %s: %s\n", version,editlvl,
+               system_info.sysname, system_info.release,
+-              system_info.machine,language);
++              system_info.machine, _("locale"), current_locale);
+    }
+ #ifndef USE_DNS
+@@ -697,7 +704,7 @@
+       total_rec++;
+       if (strlen(buffer) == (BUFSIZE-1))
+       {
+-         if (verbose)
++         if (verbose>1)
+          {
+             fprintf(stderr,"%s",msg_big_rec);
+             if (debug_mode) fprintf(stderr,":\n%s",buffer);
+@@ -1728,7 +1735,7 @@
+       {
+         case 1:  out_dir=save_opt(value);          break; /* OutputDir      */
+         case 2:  log_fname=save_opt(value);        break; /* LogFile        */
+-        case 3:  msg_title=save_opt(value);        break; /* ReportTitle    */
++        case 3:  report_title=save_opt(value);     break; /* ReportTitle    */
+         case 4:  hname=save_opt(value);            break; /* HostName       */
+         case 5:  ignore_hist=
+                     (tolower(value[0])=='y')?1:0;  break; /* IgnoreHist     */
+@@ -1989,7 +1996,7 @@
+    int i;
+    printf("%s: %s %s\n",h_usage1,pname,h_usage2);
+-   for (i=0;h_msg[i];i++) printf("%s\n",h_msg[i]);
++   for (i=0;h_msg[i];i++) printf("%s\n",_(h_msg[i]));
+    exit(1);
+ }
+@@ -1997,7 +2004,7 @@
+ /* PRINT_VERSION                             */
+ /*********************************************/
+-void print_version()
++void print_version(char *locale)
+ {
+    char buf[128]="";
+    uname(&system_info);
+@@ -2005,7 +2012,7 @@
+    printf("Webalizer V%s-%s (%s %s %s) %s\n%s\n",
+       version,editlvl,
+       system_info.sysname,system_info.release,system_info.machine,
+-      language,copyright);
++      _("locale"),copyright);
+ #ifdef USE_DNS
+    strncpy(&buf[strlen(buf)],"DNS/GeoDB ",11);
+@@ -2024,9 +2031,9 @@
+       else           printf("none");
+       printf("\n");
+ #if USE_DNS
+-      printf("Default GeoDB dir : %s\n",GEODB_LOC);
++      printf(_("Default GeoDB dir : %s\n"),GEODB_LOC);
+ #endif
+-      printf("Default config dir: %s\n",ETCDIR);
++      printf(_("Default config dir: %s\n"),ETCDIR);
+       printf("\n");
+    }
+    else printf("\n");
+@@ -2532,3 +2539,33 @@
+    return(days+5);
+ }
++
++/*****************************************************************/
++/*                                                               */
++/* intl_strip_context - Strip Context in gettext                 */
++/*                                                               */
++/* Strip "|" string from a string that will be translated        */
++/*                                                               */
++/* Originally copied from gettext info page.                     */
++/* Returns a translated string witout nothing before the first   */
++/* "|" character.                                                */
++/*                                                               */
++/* Usage: string = intl_strip_context(string)                    */
++/*    Or: string = Q_(string)                                    */
++/*                                                               */
++/* This function is useful to help translation of strings like   */
++/* month "May" that its forms is equal in Short and Long         */
++/*****************************************************************/
++
++char *intl_strip_context (const char *msgid)
++{
++   char *msgval = gettext (msgid);
++   char *pipe;
++
++   pipe = strchr(msgval, '|');
++   if (pipe != NULL)
++      return (char*)(pipe + 1);
++
++   return (char*)msgval;
++}
++
+Index: webalizer/webalizer.h
+===================================================================
+--- webalizer.orig/webalizer.h 2011-01-07 19:12:31.000000000 +0100
++++ webalizer/webalizer.h      2011-01-07 19:13:13.000000000 +0100
+@@ -301,7 +301,7 @@
+ extern char    pie_color3[];                  /* pie additionnal color 3  */
+ extern char    pie_color4[];                  /* pie additionnal color 4  */
+-/* define our externally visable functions */
++/* define our externally visible functions */
+ extern char      *cur_time();
+ extern u_int64_t ctry_idx(char *);
+@@ -311,5 +311,6 @@
+ extern u_int64_t jdate(int,int,int);
+ extern char      from_hex(char);
+ extern int       isipaddr(char *);
++extern char      *intl_strip_context();
+ #endif  /* _WEBALIZER_H */