summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMalcolm Tredinnick <malcolm@src.gnome.org>2003-07-29 03:33:20 +0000
committerMalcolm Tredinnick <malcolm@src.gnome.org>2003-07-29 03:33:20 +0000
commit420b353239acfc6bdc3e2de68abd9ab6af3c20a0 (patch)
tree5dca374c157784566040cf07aba9f85fe815d7e3
parent20262a766fbbf4749d3b83c1076e1d18b901f816 (diff)
downloadgnome-desktop-420b353239acfc6bdc3e2de68abd9ab6af3c20a0.tar.gz
configure.in, Makefile.am, gnome-version.xml.in.in, Internationalise the
* configure.in, Makefile.am, gnome-version.xml.in.in, * po/POTFILES.in: Internationalise the gnome-version.xml file. Fixes bug #115193. A side-effect of this is that the option to set the build date on the configure command line has been removed; the build date is computed using date(1) now. * gnome-version.xml.in: Removed. * gnome-version.xml.in.in: Include some new paragraph text from Luis Villa. * gnome-about/contributors.h: Added myself. * gnome-about/gnome-about.c: - Extract the paragraphs for the about box for the appropriate locale. Fixes bug #115193 in a fashion that will work for now. - Include new links for some of the titles (supplied by Luis Villa).
-rw-r--r--ChangeLog13
-rw-r--r--Makefile.am3
-rw-r--r--configure.in13
-rw-r--r--gnome-about/ChangeLog10
-rw-r--r--gnome-about/contributors.h1
-rw-r--r--gnome-about/gnome-about.c132
-rw-r--r--gnome-version.xml.in34
-rw-r--r--gnome-version.xml.in.in29
-rw-r--r--po/POTFILES.in1
9 files changed, 171 insertions, 65 deletions
diff --git a/ChangeLog b/ChangeLog
index e3dd1a21..4c0e2db5 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,16 @@
+2003-07-29 Malcolm Tredinnick <malcolm@commsecure.com.au>
+
+ * configure.in, Makefile.am, gnome-version.xml.in.in,
+ * po/POTFILES.in: Internationalise the gnome-version.xml file.
+ Fixes bug #115193. A side-effect of this is that the option to
+ set the build date on the configure command line has been
+ removed; the build date is computed using date(1) now.
+
+ * gnome-version.xml.in: Removed.
+
+ * gnome-version.xml.in.in: Include some new paragraph text from
+ Luis Villa.
+
==================== 2.3.4 ====================
2003-07-15 Mark McLoughlin <mark@skynet.ie>
diff --git a/Makefile.am b/Makefile.am
index c9f0b40f..d0ed0d61 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -8,7 +8,7 @@ SUBDIRS = \
man
EXTRA_DIST = \
- gnome-version.xml.in \
+ gnome-version.xml.in.in \
gnome-version.xml \
gnome-desktop.spec.in \
gnome-desktop.spec \
@@ -22,3 +22,4 @@ EXTRA_DIST = \
versiondir=$(datadir)/gnome-about
version_DATA=gnome-version.xml
+@INTLTOOL_XML_RULE@
diff --git a/configure.in b/configure.in
index f4838f50..2490b07d 100644
--- a/configure.in
+++ b/configure.in
@@ -31,7 +31,7 @@ GNOME_PLATFORM=2
GNOME_MINOR=3
GNOME_MICRO=4
GNOME_DISTRIBUTOR="GNOME.Org"
-GNOME_DATE="15th July, 2003"
+GNOME_DATE=`date +"%Y-%m-%d"`
AC_ARG_WITH(gnome_distributor, [ --with-gnome-distributor=DISTRIBUTOR Specify name of GNOME distributor])
@@ -39,12 +39,6 @@ if test "x$with_gnome_distributor" != x ; then
GNOME_DISTRIBUTOR=$with_gnome_distributor
fi
-AC_ARG_WITH(gnome_date, [ --with-gnome-date=DATE Specify date of this GNOME distribution])
-
-if test "x$with_gnome_date" != x ; then
- GNOME_DATE=$with_gnome_date
-fi
-
AC_SUBST(GNOME_PLATFORM)
AC_SUBST(GNOME_MINOR)
AC_SUBST(GNOME_MICRO)
@@ -142,6 +136,9 @@ if test "x$enable_rebuilds" = "xyes" && \
fi
AC_SUBST(REBUILD)
+AC_DEFINE(_XOPEN_SOURCE, [], [Needed on Linux systems to provide full X/Open
+compatibility (e.g. prototypes strptime).])
+
AC_OUTPUT([
Makefile
gnome-desktop.spec
@@ -150,7 +147,7 @@ gnome-about/Makefile
gnome-about/headers/Makefile
libgnome-desktop/Makefile
libgnome-desktop/gnome-desktop-2.0.pc
-gnome-version.xml
+gnome-version.xml.in
po/Makefile.in
pixmaps/Makefile
desktop-docs/Makefile
diff --git a/gnome-about/ChangeLog b/gnome-about/ChangeLog
index 738483d3..e367a23b 100644
--- a/gnome-about/ChangeLog
+++ b/gnome-about/ChangeLog
@@ -1,3 +1,13 @@
+2003-07-28 Malcolm Tredinnick <malcolm@commsecure.com.au>
+
+ * contributors.h: Added myself.
+
+ * gnome-about.c:
+ - Extract the paragraphs for the about box for the appropriate
+ locale. Fixes bug #115193 in a fashion that will work for now.
+ - Include new links for some of the titles (supplied by Luis
+ Villa).
+
2003-07-13 Rob Adams <robadams@ucla.edu>
* contributors.h: Added myself
diff --git a/gnome-about/contributors.h b/gnome-about/contributors.h
index 22b52172..d05a23bd 100644
--- a/gnome-about/contributors.h
+++ b/gnome-about/contributors.h
@@ -297,6 +297,7 @@ static gchar *contributors[] = {
"Kimball Thurston",
"Chris Toshok",
"Christoph Toshok",
+ "Malcolm Tredinnick",
"Tom Tromey",
"Jon Trowbridge",
"Vincent Untz",
diff --git a/gnome-about/gnome-about.c b/gnome-about/gnome-about.c
index f3c3a17d..0cbd89e3 100644
--- a/gnome-about/gnome-about.c
+++ b/gnome-about/gnome-about.c
@@ -23,6 +23,7 @@
* Mark McLoughlin <mark@skynet.ie>
* Kristian Rietveld <kris@gtk.org>
* Jeff Waugh <jdub@perkypants.org>
+ * Malcolm Tredinnick <malcolm@commsecure.com.au>
*/
#include <config.h>
@@ -42,6 +43,7 @@
#include <dirent.h>
#include <errno.h>
+#include <time.h>
#include "contributors.h"
@@ -630,7 +632,6 @@ strip_newlines (const char *str)
{
char **strv;
char *tmp;
- char *retval;
if (!str)
return NULL;
@@ -638,30 +639,97 @@ strip_newlines (const char *str)
strv = g_strsplit (str, "\n", -1);
tmp = g_strjoinv (" ", strv);
g_strfreev (strv);
+ tmp = g_strchug (tmp);
- retval = g_strdup (tmp + 1);
- g_free (tmp);
-
- return retval;
+ return tmp;
}
+/* FIXME: This could possibly be done more smoothly. The locale matching stuff
+ * needs to be abstracted out, since it must be useful in a number of places. */
+
+/* The language selection stuff here is not blindingly efficient, but it is
+ * only done once for a small number of paragraphs, so I (Malcolm) think we can
+ * just pay the penalty rather than going for something more complex.
+ *
+ * The problem we are solving here is, for each paragraph, find the translated
+ * version that matches the highest preference possible from amongst the user's
+ * LC_MESSAGES settings. Note that the translated paragraphs may not appear in
+ * the same order as the LC_MESSAGE preferences, so a certain amount of messing
+ * around is required (in particular, we cannot quit after finding the first
+ * match).
+ */
static void
get_description_messages (xmlNodePtr node)
{
xmlNodePtr paras;
GSList *list = NULL, *l;
+ const GList *langs = NULL;
gint i;
+ gboolean started = FALSE;
+ char *best_value = NULL;
+ langs = gnome_i18n_get_language_list ("LC_MESSAGES");
paras = node->children;
while (paras) {
- char *name = (char *)paras->name;
- char *value = (char *)xmlNodeGetContent (paras);
-
- if (!g_ascii_strcasecmp (name, "p") && value && value[0])
- list = g_slist_prepend (list, strip_newlines (value));
-
- paras = paras->next;
+ while (paras) {
+ char *value = (char *)xmlNodeGetContent (paras);
+ char *tmp;
+ xmlChar *cur, *best = NULL;
+ const GList *t;
+
+ if (paras->type == XML_ELEMENT_NODE &&
+ xmlStrEqual (paras->name, "p") &&
+ value && value[0]) {
+ cur = xmlNodeGetLang (paras);
+
+ tmp = strip_newlines (value);
+ if (!started) {
+ started = TRUE;
+ if (!cur) {
+ best = xmlCharStrdup ("C");
+ }
+ else {
+ best = xmlStrdup (cur);
+ }
+ best_value = g_strdup (tmp);
+ }
+ else {
+ if (!cur || xmlStrEqual (cur, "C")) {
+ break;
+ }
+ /* See if the current lanaguage occurs
+ * earlier than the previous best. */
+ for (t = langs; t; t = t->next) {
+ if (xmlStrEqual (t->data,
+ best)) {
+ break;
+ }
+ else if (xmlStrEqual (t->data,
+ cur)) {
+ xmlFree (best);
+ best = xmlStrdup (cur);
+ best_value = g_strdup (tmp);
+ /* If this is the first
+ * language on the
+ * list of choices,
+ * stop. We are not
+ * going to go any
+ * better. */
+ if (t == langs) {
+ break;
+ }
+ }
+ }
+ }
+ g_free (tmp);
+ xmlFree (cur);
+ }
+
+ paras = paras->next;
+ }
+ list = g_slist_prepend (list, best_value);
+ started = FALSE;
}
list = g_slist_reverse (list);
@@ -676,6 +744,23 @@ get_description_messages (xmlNodePtr node)
g_slist_free (list);
}
+static char*
+create_date_string (const char *value)
+{
+ struct tm tm;
+ char *result;
+ GDate *date = g_date_new ();
+
+ if (!strptime (value, "%Y-%m-%d", &tm)) {
+ return NULL;
+ }
+ g_date_set_dmy (date, tm.tm_mday, tm.tm_mon, 1900 + tm.tm_year);
+ result = g_new0 (char, 20);
+ g_date_strftime (result, 20, "%x", date);
+ g_date_free (date);
+ return result;
+}
+
static void
display_version_info (GnomeCanvasGroup *group)
{
@@ -738,7 +823,7 @@ display_version_info (GnomeCanvasGroup *group)
if (!g_ascii_strcasecmp (name, "distributor") && value && value[0])
distributor_string = g_strdup (value);
if (!g_ascii_strcasecmp (name, "date") && value && value[0])
- build_date_string = g_strdup (value);
+ build_date_string = create_date_string (value);
bits = bits->next;
}
@@ -890,7 +975,7 @@ create_canvas (void)
href = href_item_new (root,
_("About GNOME"),
- "http://www.gnome.org/intro/findout.html",
+ "http://www.gnome.org/about/",
&current_x, &current_y);
/* make a nice guess for the dot delta */
@@ -900,18 +985,21 @@ create_canvas (void)
/* draw a dot */
item = create_dot (root, &current_x, &current_y, dot_delta);
- /* and more items on a likewise way (FIXME: update the links
- * if the new website ever comes online)
+ /* and more items on a likewise way.
*/
href = href_item_new (root,
- _("Download"),
- "http://www.gnome.org/start/2.2/",
+ _("News"),
+ "http://www.gnomedesktop.org",
&current_x, &current_y);
item = create_dot (root, &current_x, &current_y, dot_delta);
+ /*
+ * FIXME: this used to be 'users' and it would be great to make it
+ * users again once there is a user-centric page on the we site.
+ */
href = href_item_new (root,
- _("Users"),
- "http://www.gnome.org/",
+ _("Software"),
+ "http://www.gnome.org/softwaremap",
&current_x, &current_y);
item = create_dot (root, &current_x, &current_y, dot_delta);
@@ -922,8 +1010,8 @@ create_canvas (void)
item = create_dot (root, &current_x, &current_y, dot_delta);
href = href_item_new (root,
- _("Foundation"),
- "http://foundation.gnome.org/",
+ _("Friends of GNOME"),
+ "http://www.gnome.org/friends/",
&current_x, &current_y);
item = create_dot (root, &current_x, &current_y, dot_delta);
diff --git a/gnome-version.xml.in b/gnome-version.xml.in
deleted file mode 100644
index faed3be0..00000000
--- a/gnome-version.xml.in
+++ /dev/null
@@ -1,34 +0,0 @@
-<?xml version="1.0"?>
-<gnome-version>
- <platform>@GNOME_PLATFORM@</platform>
- <minor>@GNOME_MINOR@</minor>
- <micro>@GNOME_MICRO@</micro>
- <distributor>@GNOME_DISTRIBUTOR@</distributor>
- <date>@GNOME_DATE@</date>
- <description>
- <p>
-The GNOME project was born as an effort to create an entirely free
-desktop environment for free systems. From the start, the main
-objective of GNOME has been to provide a user friendly suite of
-applications and an easy-to-use desktop.
- </p>
- <p>
-The GNOME project is proud to bring you version @GNOME_PLATFORM@.@GNOME_MINOR@
-of the GNOME Desktop and Platform - we pride ourselves in ease of use,
-configurability and stability which appeals to both users and system
-administrators.
- </p>
- <p>
-The GNOME @GNOME_PLATFORM@ project is the culmination of a
-major effort which had the dual objectives of dramatically improving
-developer productivity and significantly enhancing the GNOME user experience.
- </p>
- <p>
-GNOME is supported on a variety of platforms, including GNU/Linux
-(more commonly referred to as Linux), Solaris (tm) Operating
-Environment, HP-UX, Unix, BSD and Apple's Darwin. The enhanced user
-interface moves from a traditional X Window System interface to one
-that is easy to use and familiar to users of other environments.
- </p>
- </description>
-</gnome-version>
diff --git a/gnome-version.xml.in.in b/gnome-version.xml.in.in
new file mode 100644
index 00000000..78425190
--- /dev/null
+++ b/gnome-version.xml.in.in
@@ -0,0 +1,29 @@
+<?xml version="1.0"?>
+<gnome-version>
+ <platform>@GNOME_PLATFORM@</platform>
+ <minor>@GNOME_MINOR@</minor>
+ <micro>@GNOME_MICRO@</micro>
+ <distributor>@GNOME_DISTRIBUTOR@</distributor>
+ <date>@GNOME_DATE@</date>
+ <description>
+ <!-- NOTE TO AUTHORS: Do not put anything in the following paragraphs that
+ will be substituted by the configure script. Otherwise you will break
+ the translations. -->
+ <_p>Welcome to the GNOME Desktop. GNOME is a Free, usable, powerful,
+accessible desktop environment for the Unix-like family of operating
+systems.</_p>
+ <_p>GNOME includes most of what you see on your computer, including the
+file manager, menus, and many applications, like the web browser. GNOME also
+includes a development platform to allow programmers to create complex and
+powerful new applications.</_p>
+ <_p>GNOME is developed by an active community of volunteers who want to
+provide a desktop and a suite of user friendly applications. Because GNOME
+needs documentors, translators, and many other types of people, virtually
+anyone, with or without coding skills, can contribute to GNOME.</_p>
+ <_p>Hundreds of people have contributed code to GNOME since it was started
+in 1997; many more have contributed in other important ways, including
+translations, documentation, and quality assurance. The following names are an
+incomplete list of those who have contributed substantially and made GNOME
+possible.</_p>
+ </description>
+</gnome-version>
diff --git a/po/POTFILES.in b/po/POTFILES.in
index 91dc455f..42c210bb 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -14,6 +14,7 @@ desktop-links/Settings.directory.in
desktop-links/System.directory.in
gnome-about/contributors.h
gnome-about/gnome-about.c
+gnome-version.xml.in
libgnome-desktop/gnome-desktop-item.c
libgnome-desktop/gnome-ditem-edit.c
libgnome-desktop/gnome-hint.c