Hello community, here is the log from the commit of package libbonobo checked in at Wed Aug 13 23:36:08 CEST 2008. -------- --- GNOME/libbonobo/libbonobo.changes 2008-06-19 00:31:39.000000000 +0200 +++ libbonobo/libbonobo.changes 2008-07-29 01:34:27.000000000 +0200 @@ -1,0 +2,8 @@ +Tue Jul 29 01:31:43 CEST 2008 - vuntz@novell.com + +- Add libbonobo-fate300461-server-gettext.patch to support + translation of .server files via gettext. The domain can be + defined with the suse-gettext-domain key in the .server file. + Related to fate#300461. + +------------------------------------------------------------------- New: ---- libbonobo-fate300461-server-gettext.patch ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ libbonobo.spec ++++++ --- /var/tmp/diff_new_pack.DR4526/_old 2008-08-13 23:32:49.000000000 +0200 +++ /var/tmp/diff_new_pack.DR4526/_new 2008-08-13 23:32:49.000000000 +0200 @@ -2,9 +2,16 @@ # spec file for package libbonobo (Version 2.23.0) # # Copyright (c) 2008 SUSE LINUX Products GmbH, Nuernberg, Germany. -# This file and all modifications and additions to the pristine -# package are under the same license as the package itself. # +# All modifications and additions to the file contributed by third parties +# remain the property of their copyright owners, unless otherwise agreed +# upon. The license for this file, and modifications and additions to the +# file, is the same license as for the pristine package itself (unless the +# license for the pristine package is not an Open Source License, in which +# case the license is the MIT License). An "Open Source License" is a +# license that conforms to the Open Source Definition (Version 1.9) +# published by the Open Source Initiative. + # Please submit bugfixes or comments via http://bugs.opensuse.org/ # @@ -15,7 +22,7 @@ BuildRequires: bison dbus-1-glib-devel docbook_4 fdupes flex glib2-devel gnome-common gtk-doc intltool libidl libxml2-devel openssl orbit2-devel perl-XML-Parser xmlcharent Summary: The Bonobo Component System for the GNOME 2.x Desktop Platform Version: 2.23.0 -Release: 1 +Release: 19 License: GPL v2 or later; LGPL v2.1 or later # Obsolete for >=9.1: Obsoletes: bonobo-activation @@ -28,6 +35,8 @@ Patch1: libbonobo-includes.patch Patch2: bonobo-activation-config.patch Patch3: libbonobo-2.20.0-quit-with-dbus.patch +# PATCH-FEATURE-OPENSUSE libbonobo-fate300461-server-gettext.patch fate300461 vuntz@novell.com -- Look for translation of .server files via gettext +Patch4: libbonobo-fate300461-server-gettext.patch AutoReqProv: on Requires: %{name}-lang = %{version} @@ -104,6 +113,7 @@ %patch1 %patch2 %patch3 -p1 +%patch4 -p1 %if "%{_lib}" == "lib64" sed -i s:/lib/:/lib64/:g utils/bonobo-slay.in sed '\:<item>/usr/local/lib/bonobo/servers</item>:i<item>/usr/local/lib64/bonobo/servers</item>' bonobo-activation-config.xml @@ -162,6 +172,11 @@ %{_libdir}/bonobo-2.0/samples %changelog +* Tue Jul 29 2008 vuntz@novell.com +- Add libbonobo-fate300461-server-gettext.patch to support + translation of .server files via gettext. The domain can be + defined with the suse-gettext-domain key in the .server file. + Related to fate#300461. * Thu Jun 19 2008 maw@suse.de - Update to version 2.23.0: + Use D-BUS to start and exit when the session ends. ++++++ libbonobo-fate300461-server-gettext.patch ++++++ Index: libbonobo-2.23.0/activation-server/object-directory-load.c =================================================================== --- libbonobo-2.23.0.orig/activation-server/object-directory-load.c +++ libbonobo-2.23.0/activation-server/object-directory-load.c @@ -133,6 +133,7 @@ parse_oaf_server_attrs (ParseInfo * const char *type = NULL; const char *location = NULL; const char *att, *val; + const char *domain = NULL; char *error; int i = 0; @@ -152,6 +153,8 @@ parse_oaf_server_attrs (ParseInfo * type = val; else if (!location && !strcmp (att, "location")) location = val; + else if (!domain && ((!strcmp (att, "suse-gettext-domain")))) + domain = val; } } while (att && val); @@ -202,7 +205,7 @@ parse_oaf_server_attrs (ParseInfo * info->cur_server->location_info = CORBA_string_dup (location); info->cur_server->hostname = CORBA_string_dup (info->host); info->cur_server->username = CORBA_string_dup (g_get_user_name ()); - info->cur_server->domain = CORBA_string_dup ("unused"); + info->cur_server->domain = CORBA_string_dup (domain ? domain : ""); #ifdef G_OS_WIN32 if (!strcmp (type, "exe") || !strcmp (type, "shlib")) Index: libbonobo-2.23.0/bonobo-activation/bonobo-activation-server-info.c =================================================================== --- libbonobo-2.23.0.orig/bonobo-activation/bonobo-activation-server-info.c +++ libbonobo-2.23.0/bonobo-activation/bonobo-activation-server-info.c @@ -29,6 +29,7 @@ #include <bonobo-activation/bonobo-activation-server-info.h> #include <string.h> +#include <libintl.h> /** * bonobo_server_info_prop_find: @@ -74,6 +75,12 @@ bonobo_server_info_prop_lookup (Bonobo_S char *prop_name_buf; if (i18n_languages) { + const char *msg_locale; + gboolean try_gettext; + + msg_locale = setlocale (LC_MESSAGES, NULL); + try_gettext = msg_locale != NULL && server->domain && *server->domain; + for (cur = i18n_languages; cur; cur = cur->next) { prop_name_buf = g_strdup_printf ("%s-%s", prop_name, (char *) cur->data); @@ -82,6 +89,26 @@ bonobo_server_info_prop_lookup (Bonobo_S if (retval) return retval; + + /* if there's no inline translation for this language, + * try gettext if the language is the current locale */ + if (try_gettext && cur->data && strcmp ((char *) cur->data, msg_locale) == 0) { + const char *value = bonobo_server_info_prop_lookup (server, prop_name, NULL); + if (value && *value) { + const char *translated_value; + + translated_value = dgettext (server->domain, value); + + if (translated_value != value) { + if (!bind_textdomain_codeset (server->domain, NULL)) + /* this is a small leak, but oh well, + * it shouldn't happen that often */ + translated_value = g_locale_to_utf8 (translated_value, -1, NULL, NULL, NULL); + + return translated_value; + } + } + } } } ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Remember to have fun... --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-commit+help@opensuse.org