commit xdg-menu for openSUSE:Factory
Hello community, here is the log from the commit of package xdg-menu for openSUSE:Factory checked in at Mon Jun 29 16:59:59 CEST 2009. -------- --- xdg-menu/xdg-menu.changes 2007-06-01 11:23:19.000000000 +0200 +++ xdg-menu/xdg-menu.changes 2009-06-24 16:10:53.000000000 +0200 @@ -1,0 +2,10 @@ +Wed Jun 24 16:02:19 CEST 2009 - nadvornik@novell.com + +- handle desktop files translated with gettext [bnc#463972] + +------------------------------------------------------------------- +Tue Dec 16 18:01:02 CET 2008 - mhrusecky@suse.cz + +- added support for pekwm + +------------------------------------------------------------------- calling whatdependson for head-i586 New: ---- xdg-menu-pekwm.patch xdg-menu-translation-bnc463972.patch ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ xdg-menu.spec ++++++ --- /var/tmp/diff_new_pack.Z13273/_old 2009-06-29 16:58:09.000000000 +0200 +++ /var/tmp/diff_new_pack.Z13273/_new 2009-06-29 16:58:09.000000000 +0200 @@ -1,7 +1,7 @@ # # spec file for package xdg-menu (Version 0.2) # -# Copyright (c) 2008 SUSE LINUX Products GmbH, Nuernberg, Germany. +# Copyright (c) 2009 SUSE LINUX Products GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -20,7 +20,7 @@ Name: xdg-menu Version: 0.2 -Release: 191 +Release: 192 Summary: XDG Menus for WindowMaker and other Window Managers License: GPL v2 or later Group: System/GUI/Other @@ -34,6 +34,8 @@ Patch3: %name-xfce4-icon.patch Patch4: %name-gnome-path.patch Patch5: %name-icewm.patch +Patch6: %name-pekwm.patch +Patch7: %name-translation-bnc463972.patch %description This package contains a Perl script which converts XDG menus to formats @@ -53,6 +55,8 @@ %patch3 %patch4 %patch5 +%patch6 +%patch7 %build @@ -69,60 +73,3 @@ /usr/bin/xdg_menu_su %changelog -* Fri Jun 01 2007 nadvornik@suse.cz -- do not output top-level menu in icewm format [#273232] -* Tue Feb 06 2007 nadvornik@suse.cz -- added Requires: xterm [#242136] -* Mon Jan 22 2007 nadvornik@suse.cz -- adjusted gnome path [#237126] -* Fri Mar 24 2006 pnemec@suse.cz -- added icon in xfce4 menu -* Wed Jan 25 2006 mls@suse.de -- converted neededforbuild to BuildRequires -* Fri Jul 29 2005 nadvornik@suse.cz -- added twm support -* Tue Nov 30 2004 hvogel@suse.de -- merge *box patches to a single patch -- readd openbox3-pipe output -* Thu Nov 18 2004 hvogel@suse.de -- correct help output to include xfce4 -- merge *box options into one condition -- make the default output for *box a submenu again and - add a --fullmenu option -- fix xfce4 output to not include '&' in menu/app names -* Tue Nov 09 2004 hvogel@suse.de -- added openbox3 support by Marcus Rueckert -- alias fluxbox, openbox to blackbox output -* Mon Sep 13 2004 nadvornik@suse.cz -- added xfce4 support -* Tue Mar 16 2004 nadvornik@suse.cz -- do not display KDE-specific entries [#36152] -- requires desktop-data -* Fri Mar 12 2004 nadvornik@suse.cz -- fixed paths for kde desktop entries -- remove duplicate entries which came from different desktop files -* Mon Feb 02 2004 nadvornik@suse.cz -- added caching of output -- fixed dependencies [#33294] -- increased version to 0.2 -* Wed Sep 17 2003 nadvornik@suse.cz -- run su wrapper for entries with X-KDE-SubstituteUID [#30523] -* Mon Sep 15 2003 nadvornik@suse.cz -- handle desktop files with '&' in file name -- better debugging output -* Fri Sep 12 2003 nadvornik@suse.cz -- fixed fvwm2 output [#30523] -- fixed bug in parsing desktop files -* Mon Sep 08 2003 nadvornik@suse.cz -- added blackbox support from mfabian@suse.de -- correctly interpret language in the form LANG_COUNTRY.ENCODING@MODIFIER -* Fri Sep 05 2003 nadvornik@suse.cz -- more bugs fixed -* Tue Sep 02 2003 nadvornik@suse.cz -- added fvwm2 support -* Fri Aug 29 2003 nadvornik@suse.cz -- some fixes -* Wed Aug 27 2003 nadvornik@suse.cz -- finished support for WindowMaker -* Mon Aug 25 2003 nadvornik@suse.cz -- new package, needs some more work ++++++ xdg-menu-pekwm.patch ++++++ --- xdg_menu 2008-12-06 01:13:21.000000000 +0100 +++ xdg_menu 2008-12-16 17:57:46.000000000 +0100 @@ -1379,6 +1379,46 @@ return $output; } +sub output_pekwm_menu ($;$) +{ + my ($menu, $indent) = @_; + + my $output = ''; + + $indent = 0 unless defined $indent; + + my $menu_name = $menu->{'PrepName'}; + + $output .= ' ' x $indent; + $output .= "Submenu = \"$menu_name\" {\n"; + + foreach my $entry (@{$menu->{'entries'}}) { + if ($entry->{type} eq 'desktop') { + my $desktop = $entry->{desktop}; + + my $name = $desktop->{'PrepName'}; + my $exec = $desktop->{'PrepExec'}; + + $exec =~ s/\"/\\\"/g; + + $output .= ' ' x $indent; + $output .= " Entry = \"$name\" { Actions = \"Exec $exec & \" }\n"; + } + elsif ($entry->{type} eq 'menu') { + $output .= output_pekwm_menu ($entry->{'menu'}, $indent + 1); + } + else { + print STDERR "wrong menu entry type: $entry->{type}"; + } + + } + $output .= ' ' x $indent; + $output .= "}\n"; + + return $output; +} + + sub output_wmaker_menu ($;$) { my ($menu, $indent) = @_; @@ -2075,7 +2115,7 @@ possible formats: WindowMaker, fvwm2, icewm, blackbox, fluxbox, openbox, xfce4, openbox3, openbox3-pipe, - readable + pekwm, readable default: WindowMaker fullmenu - output a full menu and not only a submenu @@ -2169,6 +2209,10 @@ $output = output_readable($menu) } +elsif ($format eq 'pekwm') { + + $output = output_pekwm_menu($menu) +} else { print STDERR "Unknown format $format\n"; ++++++ xdg-menu-translation-bnc463972.patch ++++++ --- xdg_menu +++ xdg_menu @@ -10,6 +10,7 @@ use Getopt::Long; use Encode; use I18N::Langinfo qw(langinfo CODESET); +use Locale::gettext; use POSIX qw(locale_h); my $Version = "0.2"; @@ -23,6 +24,7 @@ my $language = ''; my $charset = 'iso-8859-1'; my $root_cmd = 'xdg_menu_su'; +my $default_textdomain; my $die_on_error = 0; my $verbose = 0; @@ -1228,7 +1230,23 @@ return $desktop->{$loc_entry} if defined $desktop->{$loc_entry} && $desktop->{$loc_entry} !~ /^\s*$/; } - return $desktop->{$entry}; + my $textdomain = $default_textdomain; + + if ($desktop->{'X-SUSE-Gettext-Domain'}) { + $textdomain = Locale::gettext->domain_raw($desktop->{'X-SUSE-Gettext-Domain'}); + $textdomain->codeset('UTF-8'); + } + + my $key = $desktop->{$entry}; + my $file = $desktop->{'id'}; + my $key_context = "$entry($file): $key"; + + my $translated = $textdomain->get($key_context); + if ($translated eq $key_context) { + $translated = $textdomain->get($key); + } + + return $translated; } sub preprocess_menu ($) @@ -2094,6 +2113,16 @@ "help" => \$help ); +if (!setlocale(LC_MESSAGES, $language)) + { + print STDERR "WARNING: invalid language '$language'\n"; + $language = setlocale(LC_MESSAGES); + print STDERR "Falling back to '$language'\n"; + } + +$default_textdomain = Locale::gettext->domain_raw("desktop_translations"); +$default_textdomain->codeset('UTF-8'); + @language_keys = prepare_language_keys($language); $desktop_name = $format unless defined $desktop_name; ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Remember to have fun... -- To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-commit+help@opensuse.org
participants (1)
-
root@Hilbert.suse.de