OBS User unknown 2008-09-13 03:31:20 +00:00 committed by Git OBS Bridge
parent c3e7af8704
commit 25fa22cc7f
3 changed files with 127 additions and 55 deletions

View File

@ -1,24 +1,26 @@
Index: glib-2.17.3/glib/gkeyfile.c
Index: glib/gkeyfile.c
===================================================================
--- glib-2.17.3.orig/glib/gkeyfile.c
+++ glib-2.17.3/glib/gkeyfile.c
@@ -83,6 +83,7 @@ struct _GKeyFile
--- glib/gkeyfile.c (révision 7473)
+++ glib/gkeyfile.c (copie de travail)
@@ -83,6 +83,8 @@ struct _GKeyFile
GKeyFileFlags flags;
gchar **locales;
+ gchar *gettext_domain;
+ gchar *file_basename;
};
typedef struct _GKeyFileKeyValuePair GKeyFileKeyValuePair;
@@ -209,6 +210,7 @@ g_key_file_init (GKeyFile *key_file)
@@ -209,6 +211,8 @@ g_key_file_init (GKeyFile *key_file)
key_file->list_separator = ';';
key_file->flags = 0;
key_file->locales = g_strdupv ((gchar **)g_get_language_names ());
+ key_file->gettext_domain = NULL;
+ key_file->file_basename = NULL;
}
static void
@@ -228,6 +230,12 @@ g_key_file_clear (GKeyFile *key_file)
@@ -228,6 +232,18 @@ g_key_file_clear (GKeyFile *key_file)
key_file->parse_buffer = NULL;
}
@ -27,11 +29,17 @@ Index: glib-2.17.3/glib/gkeyfile.c
+ g_free (key_file->gettext_domain);
+ key_file->gettext_domain = NULL;
+ }
+
+ if (key_file->file_basename)
+ {
+ g_free (key_file->file_basename);
+ key_file->file_basename = NULL;
+ }
+
tmp = key_file->groups;
while (tmp != NULL)
{
@@ -448,6 +456,11 @@ g_key_file_load_from_fd (GKeyFile
@@ -448,6 +464,14 @@ g_key_file_load_from_fd (GKeyFile
return FALSE;
}
@ -39,11 +47,23 @@ Index: glib-2.17.3/glib/gkeyfile.c
+ G_KEY_FILE_DESKTOP_GROUP,
+ G_KEY_FILE_DESKTOP_KEY_GETTEXT_DOMAIN,
+ NULL);
+
+ if (!key_file->gettext_domain)
+ key_file->gettext_domain = g_strdup ("desktop_translations");
+
return TRUE;
}
@@ -554,6 +567,11 @@ g_key_file_load_from_data (GKeyFile
@@ -497,6 +521,8 @@ g_key_file_load_from_file (GKeyFile
return FALSE;
}
+ key_file->file_basename = g_path_get_basename (file);
+
return TRUE;
}
@@ -554,6 +580,13 @@ g_key_file_load_from_data (GKeyFile
return FALSE;
}
@ -51,11 +71,23 @@ Index: glib-2.17.3/glib/gkeyfile.c
+ G_KEY_FILE_DESKTOP_GROUP,
+ G_KEY_FILE_DESKTOP_KEY_GETTEXT_DOMAIN,
+ NULL);
+ if (!key_file->gettext_domain)
+ key_file->gettext_domain = g_strdup ("desktop_translations");
+
return TRUE;
}
@@ -1653,6 +1671,8 @@ g_key_file_get_locale_string (GKeyFile
@@ -623,6 +656,9 @@ g_key_file_load_from_dirs (GKeyFile
}
}
+ if (found_file)
+ key_file->file_basename = g_path_get_basename (output_path);
+
if (found_file && full_path)
*full_path = output_path;
else
@@ -1653,6 +1689,8 @@ g_key_file_get_locale_string (GKeyFile
GError *key_file_error;
gchar **languages;
gboolean free_languages = FALSE;
@ -64,7 +96,7 @@ Index: glib-2.17.3/glib/gkeyfile.c
gint i;
g_return_val_if_fail (key_file != NULL, NULL);
@@ -1682,7 +1702,24 @@ g_key_file_get_locale_string (GKeyFile
@@ -1682,7 +1720,24 @@ g_key_file_get_locale_string (GKeyFile
languages = (gchar **) g_get_language_names ();
free_languages = FALSE;
}
@ -90,7 +122,7 @@ Index: glib-2.17.3/glib/gkeyfile.c
for (i = 0; languages[i]; i++)
{
candidate_key = g_strdup_printf ("%s[%s]", key, languages[i]);
@@ -1697,6 +1734,31 @@ g_key_file_get_locale_string (GKeyFile
@@ -1697,6 +1752,60 @@ g_key_file_get_locale_string (GKeyFile
g_free (translated_value);
translated_value = NULL;
@ -101,18 +133,47 @@ Index: glib-2.17.3/glib/gkeyfile.c
+
+ if (orig_value)
+ {
+ const gchar *translated;
+ gboolean has_gettext;
+
+ translated_value = dgettext (key_file->gettext_domain, orig_value);
+ has_gettext = translated_value != orig_value;
+ translated = NULL;
+
+ /* first try to translate with the context */
+ if (key_file->file_basename)
+ {
+ gchar *context;
+ gchar *context_value;
+
+ context = g_strdup_printf ("%s(%s)", key,
+ key_file->file_basename);
+ context_value = g_strdup_printf ("%s%s%s",
+ context, ": ", orig_value);
+
+ translated = g_dgettext (key_file->gettext_domain,
+ context_value);
+ has_gettext = translated != context_value;
+
+ g_free (context_value);
+ g_free (context);
+ }
+
+ /* no translation with the context: try without context */
+ if (!has_gettext)
+ {
+ translated = g_dgettext (key_file->gettext_domain,
+ orig_value);
+ has_gettext = translated != orig_value;
+ }
+
+ g_free (orig_value);
+
+ if (has_gettext)
+ {
+ if (bind_textdomain_codeset (key_file->gettext_domain, NULL))
+ translated_value = g_strdup (translated_value);
+ translated_value = g_strdup (translated);
+ else
+ translated_value = g_locale_to_utf8 (translated_value, -1, NULL, NULL, NULL);
+ translated_value = g_locale_to_utf8 (translated,
+ -1, NULL, NULL, NULL);
+ break;
+ }
+ else
@ -122,10 +183,10 @@ Index: glib-2.17.3/glib/gkeyfile.c
}
/* Fallback to untranslated key
Index: glib-2.17.3/glib/gkeyfile.h
Index: glib/gkeyfile.h
===================================================================
--- glib-2.17.3.orig/glib/gkeyfile.h
+++ glib-2.17.3/glib/gkeyfile.h
--- glib/gkeyfile.h (révision 7473)
+++ glib/gkeyfile.h (copie de travail)
@@ -240,6 +240,7 @@ gboolean g_key_file_remove_group
#define G_KEY_FILE_DESKTOP_KEY_STARTUP_NOTIFY "StartupNotify"
#define G_KEY_FILE_DESKTOP_KEY_STARTUP_WM_CLASS "StartupWMClass"

View File

@ -1,3 +1,10 @@
-------------------------------------------------------------------
Fri Sep 12 17:36:06 CEST 2008 - vuntz@novell.com
- Update glib2-fate300461-desktop-gettext.patch to make it able to
load translations from the desktop-translations package.
This is part of fate#300461 again.
-------------------------------------------------------------------
Thu Sep 4 15:30:29 CDT 2008 - maw@suse.de

View File

@ -26,7 +26,7 @@ License: LGPL v2.1 or later
Group: Development/Libraries/C and C++
AutoReqProv: on
Version: 2.18.0
Release: 1
Release: 6
Summary: A Library with Convenient Functions Written in C
Url: http://www.gtk.org/
Source: ftp://ftp.gnome.org/pub/GNOME/sources/%{_name}/2.14/%{_name}-%{version}.tar.bz2
@ -379,7 +379,7 @@ Authors:
%patch8
%patch9
%patch10
%patch11 -p1
%patch11
cp -a %{S:1} %{S:2} %{S:3} .
cp -a %{S:4} gnome_defaults.conf
if ! test -f %{_datadir}/aclocal/gtk-doc.m4 ; then
@ -516,13 +516,17 @@ rm -rf $RPM_BUILD_ROOT
%dir %{_datadir}/gtk-doc/html
%changelog
* Thu Sep 04 2008 maw@suse.de
* Fri Sep 12 2008 vuntz@novell.com
- Update glib2-fate300461-desktop-gettext.patch to make it able to
load translations from the desktop-translations package.
This is part of fate#300461 again.
* Fri Sep 05 2008 maw@suse.de
- Update to version 2.18.0:
+ Bugs fixed: bgo#324234, bgo#548278, bgo#500246, bgo#523939,
bgo#550096, bgo#550040, bgo#550104, bgo#548988, bgo#550059,
bgo#548800, and bgo#550056
+ Updated translations.
* Mon Aug 25 2008 maw@suse.de
* Tue Aug 26 2008 maw@suse.de
- Update to version 2.17.7:
+ Bugs fixed: bgo#546329, bgo#546876, bgo#547200, bgo#547637,
bgo#547337, bgo#547832, bgo#502498, bgo#546371, bgo#546483,
@ -537,7 +541,7 @@ rm -rf $RPM_BUILD_ROOT
- Add require on libselinux for devel package.
* Fri Aug 22 2008 prusnak@suse.cz
- enabled SELinux support [Fate#303662]
* Wed Aug 20 2008 maw@suse.de
* Thu Aug 21 2008 maw@suse.de
- Version the devel subpackage's requirements to avoid update
breakage.
* Wed Aug 06 2008 maw@suse.de
@ -556,7 +560,7 @@ rm -rf $RPM_BUILD_ROOT
bgo#544177, bgo#545395, bgo#541036, bgo#546079, bgo#545395,
and bgo#546017
+ Updated translations.
* Thu Jul 31 2008 maw@suse.de
* Fri Aug 01 2008 maw@suse.de
- Update to version 2.17.4:
+ GIO:
* New API to handle content types: g_mount_guess_content_type,
@ -580,21 +584,21 @@ rm -rf $RPM_BUILD_ROOT
bgo#543220, bgo#530759, bgo#535223, and bgo#543504
+ Updated translations
- Tag glib-2.17.3-implicitdecl.patch.
* Mon Jul 28 2008 vuntz@novell.com
* Tue Jul 29 2008 vuntz@novell.com
- Add glib2-fate300461-desktop-gettext.patch to support
translation of desktop entries via gettext, using the
X-SUSE-Gettext-Domain key. The patch is based on a similar patch
from Ubuntu. This is part of fate#300461
* Fri Jul 25 2008 sbrabec@suse.cz
- nautilus-folder-handler added to gnome-defaults.conf (bnc#410728)
* Sat Jul 19 2008 crrodriguez@suse.de
* Sun Jul 20 2008 crrodriguez@suse.de
- fix build
- incidentally, this also fixes a problem on PPC caused by an
endianness bug; the GTK2 build failed causing a chain of errors
resulting in misleading libglitz.la related build failures.
- run make check, so that the next time the aforementioned problem
is caught before it causes further problems.
* Wed Jul 16 2008 maw@suse.de
* Thu Jul 17 2008 maw@suse.de
- Update to version 2.17.3:
+ Bugs fixed: bgo#538119, bgo#537635, bgo#539067, bgo#535949,
bgo#539123, bgo#539074, bgo#316221, bgo#539770, bgo#539626,
@ -606,7 +610,7 @@ rm -rf $RPM_BUILD_ROOT
+ The version of PCRE included in 2.17.3 has been fixed with
respect to CVE-2008-2371; note, however, that as of 10.3/11.0,
SUSE's glib2 packages use the system PCRE.
* Wed Jun 18 2008 maw@suse.de
* Thu Jun 19 2008 maw@suse.de
- Update to version 2.17.2:
+ New function: g_utime(), a gstdio wrapper for utime()
+ New functions: g_dgettext() and g_dngettext(), wrappers
@ -664,10 +668,10 @@ rm -rf $RPM_BUILD_ROOT
glib2-fix-bookmark-leak.diff,
glib2-bnc379739-handle-blank-tryexec.patch, and
glib2-bnc387387-gio-hide-inaccessible-mounts.patch.
* Mon May 19 2008 hpj@suse.de
* Tue May 20 2008 hpj@suse.de
- Add glib2-bnc387387-gio-hide-inaccessible-mounts.patch
(bnc#387387).
* Tue May 13 2008 hpj@suse.de
* Wed May 14 2008 hpj@suse.de
- Add glib2-bnc379739-handle-blank-tryexec.patch (bnc#379739).
* Mon May 12 2008 maw@suse.de
- Add glib2-base64.patch (bnc#382708).
@ -684,19 +688,19 @@ rm -rf $RPM_BUILD_ROOT
Fix bnc#379332.
* Tue Apr 29 2008 cthiel@suse.de
- obsolete glib2-<arch> via baselibs.conf
* Mon Apr 21 2008 hpj@suse.de
* Tue Apr 22 2008 hpj@suse.de
- Dropped previously disabled glib2-cast.patch.
* Mon Apr 14 2008 maw@suse.de
* Tue Apr 15 2008 maw@suse.de
- Add glib2-fix-bookmark-leak.diff.
* Mon Apr 14 2008 sbrabec@suse.cz
- Use packageand form of branding supplement and removed self
conflict.
* Fri Apr 11 2008 maw@suse.de
* Sat Apr 12 2008 maw@suse.de
- Tag glib2-libtool.diff, which was added in the previous
submission.
* Fri Apr 11 2008 schwab@suse.de
- Work around broken configure script.
* Wed Apr 09 2008 maw@suse.de
* Thu Apr 10 2008 maw@suse.de
- Update to version 2.16.3:
+ Bugs fixed: bgo#521513, bgo#316221, bgo#520914, bgo#521045,
bgo#521591, bgo#521672, bgo#522292, bgo#522335, bgo#523015,
@ -747,7 +751,7 @@ rm -rf $RPM_BUILD_ROOT
- moved recommendation of gvfs to gtk2
* Tue Apr 01 2008 sbrabec@suse.cz
- SuSEconfig script moved from gnome-vfs2 (bnc#372783).
* Mon Mar 31 2008 federico@novell.com
* Tue Apr 01 2008 federico@novell.com
- Added glib2-bnc373149-bgo518160-gbookmark-optimizations.diff and
glib2-bnc373149-bgo523877-gbookmark-optimizations.diff to fix
https://bugzilla.novell.com/show_bug.cgi?id=373149 - backport
@ -759,7 +763,7 @@ rm -rf $RPM_BUILD_ROOT
* Fix a crash in g_themed_icon_new
* Update the included PCRE to 7.6
- Tag patches
* Thu Feb 28 2008 jpr@suse.de
* Fri Feb 29 2008 jpr@suse.de
- Update to version 2.15.6:
+ GIO:
* New file attributes: trash::item-count, filesystem::use-preview
@ -778,7 +782,7 @@ rm -rf $RPM_BUILD_ROOT
* Fix race conditions in g_spawn implementation on win32
* g_uri_get_scheme has been renamed go g_uri_parse_scheme
+ Updated translations
* Mon Feb 18 2008 maw@suse.de
* Tue Feb 19 2008 maw@suse.de
- Remove glib-cast.patch at least temporarily.
* Mon Feb 18 2008 maw@suse.de
- Update to version 2.15.5:
@ -896,7 +900,7 @@ rm -rf $RPM_BUILD_ROOT
+ Bugs (bugzilla.gnome.org) fixed: #453998, #462549, and
[#417068]
+ Updated translations.
* Fri Aug 24 2007 maw@suse.de
* Sat Aug 25 2007 maw@suse.de
- Update glib-casts.patch to fix g_array_index on ia64.
* Thu Aug 09 2007 sbrabec@suse.cz
- Removed gtk-doc from BuildRequires and included required
@ -906,7 +910,7 @@ rm -rf $RPM_BUILD_ROOT
- Use %%fdupes
- Split off a -lang subpackage
- s#%%run_ldconfig#/sbin/ldconfig/ in %%post and %%postun.
* Sun Aug 05 2007 maw@suse.de
* Mon Aug 06 2007 maw@suse.de
- The previous changelog entry refers to #297636.
* Sun Aug 05 2007 schwab@suse.de
- Fix broken interface.
@ -968,7 +972,7 @@ rm -rf $RPM_BUILD_ROOT
en_CA,en_GB,et,fa,fr,he,hu,it,ja,ku,lt,mg,mk,ml,
nb,ne,nn,pt,pt_BR,ro,sr,sr@Latn,sv,ta,uk,vi,zh_CN,
zh_HK,zh_TW)
* Thu Apr 12 2007 maw@suse.de
* Fri Apr 13 2007 maw@suse.de
- Pass --enable-static to configure (#263998).
* Wed Mar 21 2007 maw@suse.de
- Update to version 2.12.11
@ -1054,7 +1058,7 @@ rm -rf $RPM_BUILD_ROOT
* Thu Dec 07 2006 sbrabec@suse.cz
- Prefix changed to /usr.
- Spec file cleanup.
* Thu Nov 02 2006 jhargadon@suse.de
* Fri Nov 03 2006 jhargadon@suse.de
- added a patch to m4macros/glib-gettext.m4 so that the build
variables expand properly.
* Mon Oct 02 2006 jhargadon@suse.de
@ -1079,7 +1083,7 @@ rm -rf $RPM_BUILD_ROOT
- 351853 GKeyFile creates non-UTF-8 error messages
- Translation updates (fr,hu,ja,ku,lt,lv,ml,or,
pt,ru,sv,vi,zh_CN)
* Tue Aug 29 2006 jhargadon@suse.de
* Wed Aug 30 2006 jhargadon@suse.de
- update to version 2.12.2
- Normalization is following Unicode TR #29
- 348491 g_utf8_strup() and g_utf8_strdown() returns
@ -1092,7 +1096,7 @@ rm -rf $RPM_BUILD_ROOT
- 349792 Wrong english string
- 349952 gparamspecs.c uses gcc feature
- Translation updates
* Mon Jul 31 2006 gekker@suse.de
* Tue Aug 01 2006 gekker@suse.de
- Update to version 2.12.1
* Update to final Unicode Character Database 5.0.0
* Bugs fixed:
@ -1104,7 +1108,7 @@ rm -rf $RPM_BUILD_ROOT
246494 prototype mismatch in glib/gconvert.c
* New and updated translations (bg,bn_IN,ca,dz,eu,fi,
fr,he,it,ja,mk,or,pt)
* Tue Jul 18 2006 rml@suse.de
* Wed Jul 19 2006 rml@suse.de
- Update to glib 2.12:
- Lots of bug fixes
- GSlice!
@ -1117,11 +1121,11 @@ rm -rf $RPM_BUILD_ROOT
* Thu Mar 30 2006 sbrabec@suse.cz
- Renamed profile to be executed after lang.*, otherwise
G_FILENAME_ENCODING cannot be set.
* Thu Jan 26 2006 mls@suse.de
* Fri Jan 27 2006 mls@suse.de
- converted neededforbuild to BuildRequires
* Tue Jan 17 2006 gekker@suse.de
* Wed Jan 18 2006 gekker@suse.de
- Fix gstaticmutex define (#141215 patch byjblunck)
* Mon Jan 16 2006 zsu@suse.de
* Tue Jan 17 2006 zsu@suse.de
- Fixed implicit cast issue introduced by bugfix #316221
http://bugzilla.gnome.org/show_bug.cgi?id=327022
* Fri Jan 13 2006 sbrabec@suse.cz
@ -1135,7 +1139,7 @@ rm -rf $RPM_BUILD_ROOT
http://bugzilla.gnome.org/show_bug.cgi?id=316221
* Fri Nov 04 2005 schwab@suse.de
- Fix use of atomic builtins.
* Tue Oct 11 2005 gekker@suse.de
* Wed Oct 12 2005 gekker@suse.de
- Update to version 2.8.3
* Wed Sep 28 2005 gekker@suse.de
- Update to version 2.8.2
@ -1144,7 +1148,7 @@ rm -rf $RPM_BUILD_ROOT
- Update to version 2.8.1
* Mon Aug 15 2005 rodrigo@suse.de
- Update to version 2.8.0
* Wed Aug 10 2005 gekker@suse.de
* Thu Aug 11 2005 gekker@suse.de
- Update to version 2.7.7
* Mon Aug 01 2005 gekker@suse.de
- Update to version 2.7.4
@ -1152,7 +1156,7 @@ rm -rf $RPM_BUILD_ROOT
- Update to version 2.7.2
* Thu Jun 23 2005 sbrabec@suse.cz
- Fixed devel dependencies.
* Thu Jun 16 2005 gekker@suse.de
* Fri Jun 17 2005 gekker@suse.de
- Update to version 2.7.0.
- Fix SENTINEL patch to work with upstream version.
* Tue Jun 07 2005 gekker@suse.de
@ -1170,7 +1174,7 @@ rm -rf $RPM_BUILD_ROOT
- Updated to version 2.6.3.
* Mon Feb 07 2005 sbrabec@suse.cz
- Updated to version 2.6.2.
* Wed Jan 19 2005 meissner@suse.de
* Thu Jan 20 2005 meissner@suse.de
- define G_GNUC_SENTINEL for gcc >= 4
- specify G_GNUC_SENTINEL where applicable.
* Sun Jan 16 2005 clahey@suse.de
@ -1179,18 +1183,18 @@ rm -rf $RPM_BUILD_ROOT
- Update to version 2.6.0
* Wed Dec 22 2004 ro@suse.de
- remove no translation (obsolete with nb present)
* Tue Dec 14 2004 gekker@suse.de
* Wed Dec 15 2004 gekker@suse.de
- Update version to 2.5.7.
- Remove the no-no patch, as it is upstreamed.
* Tue Nov 16 2004 clahey@suse.de
- Update to glib 2.5.6.
* Mon Oct 18 2004 ro@suse.de
* Tue Oct 19 2004 ro@suse.de
- remove no locale support: nb is already there
* Tue Oct 12 2004 sbrabec@suse.cz
- Require gnome-filesystem (#47068).
* Wed Sep 29 2004 sbrabec@suse.cz
- Fixed glib2.csh for unset LANG (#46282).
* Wed Aug 25 2004 federico@ximian.com
* Thu Aug 26 2004 federico@ximian.com
- Update to glib 2.4.5
- Removed glib-pattern.diff, as this bug is fixed in the tarball.
* Wed Aug 25 2004 kukuk@suse.de
@ -1220,7 +1224,7 @@ rm -rf $RPM_BUILD_ROOT
- FHS 2.3 fix (mandir, infodir, #35821).
* Wed Mar 10 2004 sbrabec@suse.cz
- Fixed %%doc attributes (#33163).
* Fri Jan 09 2004 schwab@suse.de
* Sat Jan 10 2004 schwab@suse.de
- Fix quoting in autoconf macros.
* Fri Oct 17 2003 adrian@suse.de
- fix missing %%run_ldconfig