diff options
author | Kjartan Maraas <kmaraas@gnome.org> | 2003-05-01 11:40:51 +0000 |
---|---|---|
committer | Kjartan Maraas <kmaraas@src.gnome.org> | 2003-05-01 11:40:51 +0000 |
commit | f5cead9436dd042e20cce777059b03de119a35f4 (patch) | |
tree | 6871a7295d886efa5e476834d7d237caa4e2ad25 | |
parent | bcabde7cc82dbbaba64537e331d9a9aeeca1327a (diff) | |
download | yelp-f5cead9436dd042e20cce777059b03de119a35f4.tar.gz |
Pull up fixes from
2003-04-29 Kjartan Maraas <kmaraas@gnome.org>
* help-converters/man/gnome-man2html2.c:
* help-converters/man/Makefile.am: Pull up fixes from
-rw-r--r-- | src/man2html/Makefile.am | 7 | ||||
-rw-r--r-- | src/man2html/yelp-man2html.c | 48 |
2 files changed, 52 insertions, 3 deletions
diff --git a/src/man2html/Makefile.am b/src/man2html/Makefile.am index 99d0a1ac..435dab3f 100644 --- a/src/man2html/Makefile.am +++ b/src/man2html/Makefile.am @@ -1,12 +1,15 @@ ## Process this file with automake to produce Makefile.in. -INCLUDES = $(LIBGNOME_CFLAGS) +INCLUDES = $(LIBGNOME_CFLAGS) \ + -I$(top_srcdir) libexec_PROGRAMS = gnome2-man2html gnome2_man2html_SOURCES = gnome-man2html.c -gnome2_man2html_LDADD = $(LIBGNOME_LIBS) $(Z_LIBS) $(BZ_LIBS) +gnome2_man2html_LDADD = \ + $(top_builddir)/libgnome/libgnome-2.la \ + $(LIBGNOME_LIBS) $(Z_LIBS) $(BZ_LIBS) #CFLAGS += -Wall diff --git a/src/man2html/yelp-man2html.c b/src/man2html/yelp-man2html.c index 77914edb..c021fa78 100644 --- a/src/man2html/yelp-man2html.c +++ b/src/man2html/yelp-man2html.c @@ -140,6 +140,7 @@ #include <bzlib.h> #endif #include <glib.h> +#include <libgnome/gnome-i18n.h> static char *URLbasename = NULL; @@ -1904,6 +1905,49 @@ static char return c; } +/* Outputs the <META> tag with the language and charset information */ +static void +output_meta_element (void) +{ + const GList *langs; + GString *str; + const char *lang; + const char *uline_pos; + const char *dot_pos; + const char *p; + + langs = gnome_i18n_get_language_list ("LC_MESSAGES"); + + if (!langs) + return; + + lang = langs->data; + + str = g_string_new (NULL); + + uline_pos = strchr (lang, '_'); + dot_pos = strrchr (lang, '.'); + + g_string_append (str, "<META LANG=\""); + + for (p = lang; + *p && (uline_pos ? p < uline_pos : TRUE) && (dot_pos ? p < dot_pos : TRUE); + p++) + g_string_append_len (str, p, 1); + + g_string_append (str, "\" HTTP-EQUIV=\"Content-Type\" CONTENT=\"text/html"); + + if (dot_pos && *(dot_pos + 1) != '\0') { + g_string_append (str, "; charset="); + g_string_append (str, dot_pos + 1); + } + + g_string_append (str, "\">"); + + out_html (str->str); + g_string_free (str, TRUE); +} + static int ifelseval=0; static char @@ -2578,7 +2622,9 @@ static char wordlist[i][-1]='\0'; *sl='\0'; output_possible=1; - out_html("<HTML><HEAD><TITLE>" + out_html("<HTML><HEAD>"); + output_meta_element (); + out_html("<TITLE>" "Manpage of "); out_html(wordlist[0]); out_html("</TITLE>\n</HEAD><BODY>" |