discovery: debian menu already supports l10n!
Well, I just thought I'd pass this along. I've been playing around
with the Debian menu system, after some complaints on the -gtk-gnome
list that Debian menus don't support localization. To my suprise, the
Debian menu system *can* support l10n! It's a little ugly, and could
use improvement, but it works.
For testing, I used gnome-panel, which has internal support for l10n
(systems that don't support l10n themselves won't be able to take
advantage of this). I modified the menu-method as follows:
*** /etc/menu-methods/gnome-panel~ Thu Nov 4 20:19:06 1999
--- /etc/menu-methods/gnome-panel Fri Dec 3 17:21:41 1999
***************
*** 3,8 ****
--- 3,11 ----
!include menu.h
+ function Title_ES()=ifnempty($title_es,"Name[es]=" $title_es "\n")
+
function findicon($filename)= \
ifelsefile($filename, $filename, \
iffile("/usr/X11R6/include/X11/pixmaps/" $filename, \
***************
*** 11,16 ****
--- 14,20 ----
function AppEntry($var)= \
"[Desktop Entry]\n" \
"Name=" title() "\n" \
+ Title_ES() \
"Comment=" ifelse($longtitle,$longtitle,$title) "\n" \
"Exec=" $command "\n" \
$var \
Note that I didn't have to modify the menu system itself; just the
menu-method for the gnome panel. Next, I created a menu file with a
title_es field for testing:
thrak# cat /etc/menu/sunclock
?package(sunclock):needs=X11 section=Apps/Tools hints="Clocks"\
title="SunClock" longtitle="Sun Clock: Show illuminated portion of Earth" \
title_es="Clock del Sol" \
command="/usr/X11R6/bin/sunclock"
(Pardon my lack of knowledge of Spanish -- this was just an experiment.)
Finally, I ran update-menus, and checked the gnome-panel Debian menus
in /var/lib/gnome/Debian, and the entry for SunClock.desktop had:
[Desktop Entry]
Name=SunClock
Name[es]=Clock del Sol
Comment=Sun Clock: Show illuminated portion of Earth
Exec=/usr/X11R6/bin/sunclock
Terminal=false
Type=Application
So, there you have it. So, now the question becomes, do we want to
try to take advantage of this? Only a few menu systems actually
support l10n at this point, but one of them is Gnome, which is pretty
visible. I think it might be worth going forward somehow.
(Note for followups: I'm not subscribed to debian-devel.)
cheers
--
Chris Waters xtifr@dsp.net | I have a truly elegant proof of the
or xtifr@debian.org | above, but it is too long to fit into
http://www.dsp.net/xtifr | this .signature file.
Reply to: