diff options
author | Richard Hult <rhult@codefactory.se> | 2001-12-01 12:00:43 +0000 |
---|---|---|
committer | Richard Hult <rhult@src.gnome.org> | 2001-12-01 12:00:43 +0000 |
commit | 36c73f747bad97497ea3339b42a259a3db518911 (patch) | |
tree | fdef9bba2f3ec9e71f238d02429b11d2f7bde63c | |
parent | 57c850dc83adf9638426c0a289fb3cea2bc1ba98 (diff) | |
download | yelp-36c73f747bad97497ea3339b42a259a3db518911.tar.gz |
Exit when the window is closed.
2001-12-01 Richard Hult <rhult@codefactory.se>
* src/main.c (main): Exit when the window is closed.
* src/*.c: Mark strings as translatable.
* src/main.c (main): Init gettext.
* acconfig.h: Add.
* configure.in: Gettextize and intltoolize.
* autogen.sh: Redirect to the installed one for gnome 2.
* yelp.desktop.in: Desktop file.
* Makefile.am: Add a desktop file and intltool rule for it.
-rw-r--r-- | ChangeLog | 18 | ||||
-rw-r--r-- | Makefile.am | 18 | ||||
-rw-r--r-- | acconfig.h | 6 | ||||
-rwxr-xr-x | autogen.sh | 42 | ||||
-rw-r--r-- | configure.in | 24 | ||||
-rw-r--r-- | po/POTFILES.in | 17 | ||||
-rw-r--r-- | po/sv.po | 94 | ||||
-rw-r--r-- | src/ghelp-main.c | 8 | ||||
-rw-r--r-- | src/main.c | 14 | ||||
-rw-r--r-- | src/yelp-toc.c | 3 | ||||
-rw-r--r-- | src/yelp-view.c | 7 | ||||
-rw-r--r-- | src/yelp-window.c | 21 | ||||
-rw-r--r-- | yelp.desktop.in | 9 |
13 files changed, 231 insertions, 50 deletions
@@ -1,3 +1,21 @@ +2001-12-01 Richard Hult <rhult@codefactory.se> + + * src/main.c (main): Exit when the window is closed. + + * src/*.c: Mark strings as translatable. + + * src/main.c (main): Init gettext. + + * acconfig.h: Add. + + * configure.in: Gettextize and intltoolize. + + * autogen.sh: Redirect to the installed one for gnome 2. + + * yelp.desktop.in: Desktop file. + + * Makefile.am: Add a desktop file and intltool rule for it. + 2001-12-01 Mikael Hallendal <micke@codefactory.se> * src/scrollkeeper-parser.c: path uri's as strings instead of diff --git a/Makefile.am b/Makefile.am index af437a64..083e3a82 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1 +1,17 @@ -SUBDIRS = src +SUBDIRS = src po + +@INTLTOOL_DESKTOP_RULE@ + +DESKTOP_IN_FILES=yelp.desktop.in +DESKTOP_FILES=$(DESKTOP_IN_FILES:.desktop.in=.desktop) + +Applicationsdir = $(datadir)/gnome/apps/Applications +Applications_DATA = $(DESKTOP_FILES) + +EXTRA_DIST = \ + intltool-extract.in \ + intltool-merge.in \ + intltool-update.in \ + $(DESKTOP_IN_FILES) \ + $(DESKTOP_FILES) + diff --git a/acconfig.h b/acconfig.h new file mode 100644 index 00000000..81c9fb5f --- /dev/null +++ b/acconfig.h @@ -0,0 +1,6 @@ +#undef ENABLE_NLS +#undef HAVE_CATGETS +#undef HAVE_GETTEXT +#undef HAVE_LC_MESSAGES +#undef GETTEXT_PACKAGE +#undef GNOMELOCALEDIR @@ -1,34 +1,22 @@ #!/bin/sh +# Run this to generate all the initial makefiles, etc. -(gettextize --version) < /dev/null > /dev/null 2>&1 || { - echo; - echo "You must have gettext installed to compile GtkHtml"; - echo; - exit; -} +srcdir=`dirname $0` +test -z "$srcdir" && srcdir=. -(automake --version) < /dev/null > /dev/null 2>&1 || { - echo; - echo "You must have automake installed to compile GtkHtml"; - echo; - exit; -} +PKG_NAME="Yelp" -(autoconf --version) < /dev/null > /dev/null 2>&1 || { - echo; - echo "You must have autoconf installed to compile GtkHtml"; - echo; - exit; +(test -f $srcdir/configure.in \ + && test -f $srcdir/src/main.c \ + && test -f $srcdir/README) || { + echo -n "**Error**: Directory "\`$srcdir\'" does not look like the" + echo " top-level yelp directory" + exit 1 } -echo "Generating configuration files for GtkHtml2, please wait...." -echo; - -echo n | gettextize --copy --force; -aclocal $ACLOCAL_FLAGS; -autoheader; -automake --add-missing; -autoconf; - -./configure $@ --enable-maintainer-mode --enable-compile-warnings +which gnome-autogen.sh || { + echo "You need to install gnome-common from the GNOME CVS" + exit 1 +} +USE_GNOME2_MACROS=1 . gnome-autogen.sh diff --git a/configure.in b/configure.in index ffcf8ef5..1e235e65 100644 --- a/configure.in +++ b/configure.in @@ -1,9 +1,14 @@ AC_INIT(src/main.c) - AM_CONFIG_HEADER(config.h) - AM_INIT_AUTOMAKE(Yelp, 0.01) +AC_PROG_INTLTOOL + +AM_MAINTAINER_MODE +GNOME_COMMON_INIT + +GNOME_PLATFORM_GNOME_2(yes) + AC_PROG_CC AC_ISC_POSIX AC_HEADER_STDC @@ -18,6 +23,20 @@ CFLAGS="$CFLAGS \ AC_SUBST(CFLAGS) AC_SUBST(LDFLAGS) +GETTEXT_PACKAGE=yelp +AC_SUBST(GETTEXT_PACKAGE) +AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE") + +ALL_LINGUAS="sv" +AM_GLIB_GNU_GETTEXT + +if test "x$prefix" = "xNONE"; then + GNOMELOCALEDIR=$ac_default_prefix/share/locale +else + GNOMELOCALEDIR=$prefix/share/locale +fi +AC_DEFINE_UNQUOTED(GNOMELOCALEDIR, "$GNOMELOCALEDIR") + PKG_CHECK_MODULES(YELP, libgtkhtml-2.0 >= 1.99.2 \ gnome-vfs-2.0 >= 1.1 \ libgnomeui-2.0 >= 1.103.0) @@ -28,4 +47,5 @@ AC_SUBST(YELP_LIBS) AC_OUTPUT([ Makefile src/Makefile +po/Makefile.in ]) diff --git a/po/POTFILES.in b/po/POTFILES.in new file mode 100644 index 00000000..6ff2113f --- /dev/null +++ b/po/POTFILES.in @@ -0,0 +1,17 @@ +src/devhelp-parser.c +src/ghelp-main.c +src/ghelp-uri.c +src/main.c +src/metadata-parser.c +src/scrollkeeper-parser.c +src/yelp-base.c +src/yelp-book.c +src/yelp-history.c +src/yelp-index.c +src/yelp-keyword-db.c +src/yelp-toc.c +src/yelp-view.c +src/yelp-window.c + +yelp.desktop.in + diff --git a/po/sv.po b/po/sv.po new file mode 100644 index 00000000..d7f2cdcb --- /dev/null +++ b/po/sv.po @@ -0,0 +1,94 @@ +# Yelp, GNOME Helo Browser +# Copyright (C) 2001 Free Software Foundation, Inc. +# Richard Hult <rhult@codefactory.se>, 2001. +# +msgid "" +msgstr "" +"Project-Id-Version: Yelp 0.01\n" +"POT-Creation-Date: 2001-12-01 12:40+0100\n" +"PO-Revision-Date: 2001-12-01 12:40+0100\n" +"Last-Translator: Richard Hult <rhult@codefactory.se>\n" +"Language-Team: Swedish <sv@li.org>\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=iso-8859-1\n" +"Content-Transfer-Encoding: 8bit\n" + +#: src/ghelp-main.c:35 +#, c-format +msgid "Usage '%s uri'\n" +msgstr "" + +#: src/ghelp-main.c:43 +#, c-format +msgid "Transformed URI: %s\n" +msgstr "Transformerad URI: %s\n" + +#: src/ghelp-main.c:52 +#, c-format +msgid "File not found: %s\n" +msgstr "" + +#: src/ghelp-main.c:56 +#, c-format +msgid "Invalid URI: %s\n" +msgstr "Ogiltig URI: %s\n" + +#: src/yelp-toc.c:140 +msgid "Section" +msgstr "Avdelning" + +#: src/yelp-view.c:364 +msgid "" +"<html><head><title>This is Yelp, a help browser for GNOME 2.0</title></" +"head><body bgcolor=\"white\"><h3>Welcome to Yelp!</h3>This is to be a help " +"browser for GNOME 2.0 written by Mikael Hallendal.<br><br>Please read the " +"README and TODO<br></body></html>" +msgstr "" +"<html><head><title>Detta är Yelp, en hjälpvisare för GNOME 2.0</title></" +"head><body bgcolor=\"white\"><h3>Välkommen till Yelp!</h3>Detta är en hjälpvisare " +"under utveckling, för GNOME 2.0, skriven av Mikael Hallendal.<br><br>Läs gärna filerna " +"README och TODO<br></body></html>" + +#: src/yelp-window.c:79 +msgid "/_File" +msgstr "/_Arkiv" + +#: src/yelp-window.c:80 +msgid "/File/_New window" +msgstr "/Arkiv/_Nytt fönster" + +#: src/yelp-window.c:81 +msgid "/File/E_xit" +msgstr "/Arkiv/_Avsluta" + +#: src/yelp-window.c:82 +msgid "/_Help" +msgstr "/_Hjälp" + +#: src/yelp-window.c:83 +msgid "/Help/_About" +msgstr "/Hjälp/_Om" + +#: src/yelp-window.c:129 +msgid "Yelp: GNOME Help Browser" +msgstr "Yelp: Hjälpvisare för GNOME" + +#: src/yelp-window.c:229 +msgid "Contents" +msgstr "Innehåll" + +#: src/yelp-window.c:245 +msgid "Index" +msgstr "Index" + +#: src/yelp-window.c:334 +msgid "Help Browser for GNOME 2.0" +msgstr "Hjälpvisare för GNOME 2.0" + +#: yelp.desktop.in.h:1 +msgid "GNOME Helpbrowser" +msgstr "Hjälpvisare för GNOME" + +#: yelp.desktop.in.h:2 +msgid "Yelp" +msgstr "Yelp" diff --git a/src/ghelp-main.c b/src/ghelp-main.c index f6264f12..b39c2b54 100644 --- a/src/ghelp-main.c +++ b/src/ghelp-main.c @@ -32,7 +32,7 @@ main (int argc, char **argv) GnomeVFSURI *vfs_uri; if (argc <= 1) { - g_print ("Usage '%s uri'\n", argv[0]); + g_print (_("Usage '%s uri'\n"), argv[0]); exit (1); } @@ -40,7 +40,7 @@ main (int argc, char **argv) switch (result) { case GNOME_VFS_OK: - g_print ("Transformed URI: %s\n", uri); + g_print (_("Transformed URI: %s\n"), uri); vfs_uri = gnome_vfs_uri_new (uri); if (!vfs_uri) { g_print ("Eeeeeek\n"); @@ -49,11 +49,11 @@ main (int argc, char **argv) exit (0); break; case GNOME_VFS_ERROR_NOT_FOUND: - g_print ("File not found: %s\n", argv[1]); + g_print (_("File not found: %s\n"), argv[1]); exit (1); break; case GNOME_VFS_ERROR_INVALID_URI: - g_print ("Invalid URI: %s\n", argv[1]); + g_print (_("Invalid URI: %s\n"), argv[1]); exit (1); break; default: @@ -27,6 +27,7 @@ #include <gtk/gtkmain.h> #include <gtk/gtkwidget.h> +#include <libgnome/gnome-i18n.h> #include <libgnome/gnome-program.h> #include <libgnomeui/gnome-ui-init.h> #include <libgnomevfs/gnome-vfs.h> @@ -38,8 +39,15 @@ main (int argc, char **argv) GnomeProgram *program; YelpBase *base; GtkWidget *window; - - g_thread_init (NULL); + +#ifdef ENABLE_NLS + bindtextdomain(GETTEXT_PACKAGE, GNOMELOCALEDIR); + textdomain(GETTEXT_PACKAGE); +#endif + + setlocale (LC_ALL, ""); + + g_thread_init (NULL); program = gnome_program_init (PACKAGE, VERSION, LIBGNOMEUI_MODULE, @@ -54,6 +62,8 @@ main (int argc, char **argv) if (argc >= 2) { yelp_window_open_uri (window, argv[1]); } + + g_signal_connect (window, "delete-event", gtk_main_quit, NULL); gtk_widget_show_all (window); diff --git a/src/yelp-toc.c b/src/yelp-toc.c index cfafee3a..9e769bbd 100644 --- a/src/yelp-toc.c +++ b/src/yelp-toc.c @@ -25,6 +25,7 @@ #endif #include <gtk/gtk.h> +#include <libgnome/gnome-i18n.h> #include "yelp-toc.h" static void yelp_toc_init (YelpToc *toc); @@ -136,7 +137,7 @@ yelp_toc_new (GtkTreeStore *model) GTK_TREE_MODEL (model)); cell = gtk_cell_renderer_text_new (); - column = gtk_tree_view_column_new_with_attributes ("Section", cell, + column = gtk_tree_view_column_new_with_attributes (_("Section"), cell, "text", 0, NULL); diff --git a/src/yelp-view.c b/src/yelp-view.c index 6cb78b7b..aad3ab73 100644 --- a/src/yelp-view.c +++ b/src/yelp-view.c @@ -25,6 +25,7 @@ #endif #include <libgnomevfs/gnome-vfs.h> +#include <libgnome/gnome-i18n.h> #include <stdio.h> #include "yelp-view.h" @@ -360,10 +361,10 @@ yelp_view_new (void) html_document_open_stream (priv->doc, "text/html"); { int len; - gchar *text = "<html><head><title>This is Yelp, a help browser for GNOME 2.0</title></head><body bgcolor=\"white\"><h3>Welcome to Yelp!</h3>This is to be a help browser for GNOME 2.0 written by Mikael Hallendal.<br><br>Please read the README and TODO<br></body></html>"; - len = strlen (text); + gchar *text = N_("<html><head><title>This is Yelp, a help browser for GNOME 2.0</title></head><body bgcolor=\"white\"><h3>Welcome to Yelp!</h3>This is to be a help browser for GNOME 2.0 written by Mikael Hallendal.<br><br>Please read the README and TODO<br></body></html>"); + len = strlen (_(text)); - html_document_write_stream (priv->doc, text, len); + html_document_write_stream (priv->doc, _(text), len); } html_document_close_stream (priv->doc); diff --git a/src/yelp-window.c b/src/yelp-window.c index 590d7c27..9de47d67 100644 --- a/src/yelp-window.c +++ b/src/yelp-window.c @@ -2,7 +2,7 @@ /* * Copyright (C) 2001 CodeFactory AB * Copyright (C) 2001 Mikael Hallendal <micke@codefactory.se> - * +< * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of the @@ -31,6 +31,7 @@ #include <libgnomevfs/gnome-vfs.h> #include <libgnomeui/gnome-app.h> #include <libgnomeui/gnome-about.h> +#include <libgnome/gnome-i18n.h> #include <string.h> #include "ghelp-uri.h" #include "yelp-index.h" @@ -75,11 +76,11 @@ struct _YelpWindowPriv { }; static GtkItemFactoryEntry menu_items[] = { - { "/_File", NULL, 0, 0, "<Branch>" }, - { "/File/_New window", "<Control>N", yelp_window_new_window, 0, NULL}, - { "/File/E_xit", "<Control>Q", yelp_window_exit, 0, NULL }, - { "/_Help", NULL, 0, 0, "<Branch>" }, - { "/Help/_About", NULL, yelp_window_about, 0, NULL }, + { N_("/_File"), NULL, 0, 0, "<Branch>" }, + { N_("/File/_New window"), "<Control>N", yelp_window_new_window, 0, NULL}, + { N_("/File/E_xit"), "<Control>Q", yelp_window_exit, 0, NULL }, + { N_("/_Help"), NULL, 0, 0, "<Branch>" }, + { N_("/Help/_About"), NULL, yelp_window_about, 0, NULL }, }; GType @@ -125,7 +126,7 @@ yelp_window_init (YelpWindow *window) gtk_window_set_default_size (GTK_WINDOW (window), 800, 600); - gtk_window_set_title (GTK_WINDOW (window), "Yelp: GNOME Help Browser"); + gtk_window_set_title (GTK_WINDOW (window), _("Yelp: GNOME Help Browser")); } static void @@ -225,7 +226,7 @@ yelp_window_populate (YelpWindow *window) GTK_POLICY_AUTOMATIC); gtk_notebook_append_page (GTK_NOTEBOOK (priv->notebook), - tree_sw, gtk_label_new ("Contents")); + tree_sw, gtk_label_new (_("Contents"))); g_signal_connect_swapped (G_OBJECT (priv->yelp_toc), "section_selected", @@ -241,7 +242,7 @@ yelp_window_populate (YelpWindow *window) GTK_POLICY_AUTOMATIC); gtk_notebook_append_page (GTK_NOTEBOOK (priv->notebook), - search_box, gtk_label_new ("Index")); + search_box, gtk_label_new (_("Index"))); gtk_box_pack_start (GTK_BOX (search_box), yelp_index_get_entry (priv->index), @@ -330,7 +331,7 @@ yelp_window_about (gpointer data, guint section, GtkWidget *widget) about = gnome_about_new (PACKAGE, VERSION, "(C) 2001 Mikael Hallendal <micke@codefactory.se>", - "Help Browser for GNOME 2.0", + _("Help Browser for GNOME 2.0"), authors, NULL, NULL, diff --git a/yelp.desktop.in b/yelp.desktop.in new file mode 100644 index 00000000..f8a5ff94 --- /dev/null +++ b/yelp.desktop.in @@ -0,0 +1,9 @@ +[Desktop Entry] +_Name=Yelp +_Comment=GNOME Helpbrowser +Exec=yelp +Icon=gnome-unknown.png +Terminal=0 +Type=Application +DocPath= +Categories=Application; |