[問題]關於WindowMaker中文選單的問題

歡迎提問 debian desktop 相關問題,何謂 desktop ? 舉凡您日常生活會用到的部份,如上網 ( www 、 bbs ..) 、程式設計、繪圖...等等。 通常以 X Window 環境底下問題為主。

[問題]關於WindowMaker中文選單的問題

文章訪客 » 週日 1月 19, 2003 4:00 pm

請問各位前輩
我照著moto前輩的做法
將WMRootMenu裡的"menu.hook"改成"menu.zh_TW.Big5"之後
選單確實變成中文的
但是裡面的選項要怎麼樣才能更新成我原本的內容
因為裡面很多選項我根本沒有
執行下去只會出現錯誤訊息而以
有辦法可以自動更新中文選單的內容嗎
訪客
 

Re: [問題]關於WindowMaker中文選單的問題

文章Tetralet » 週日 1月 19, 2003 9:22 pm

您可以編輯 /etc/X11/WindowMaker/menu.zh_TW.Big5,
在裡面改成您喜歡的內容即可。

您也可以寫一個小的 Script,
偵測您己安裝的軟體,
同時自動更新這個檔案的內容。
Tetralet
俺是博士
俺是博士
 
文章: 3078
註冊時間: 週四 11月 28, 2002 3:02 pm

re:[問題]關於WindowMaker中文選單的問題

文章訪客 » 週六 2月 08, 2003 9:34 pm

可以指導一下方向去寫這樣的script嗎...
訪客
 

re:[問題]關於WindowMaker中文選單的問題

文章breaking » 週六 3月 22, 2003 11:20 pm

在/etc/X11/WindowMaker下

有三個檔案(appearance.menu及background.menu及menu.hook)

我之前是修改如下

appearance.menu
========================================================================
/* Automatically generated file. Do not edit. */

#include "wmmacros"

"外觀" MENU
"背景" OPEN_MENU background.menu
"風格" OPEN_MENU -noext LOCAL_STYLES_DIR STYLES_DIR USER_STYLES_DIR WITH sets$
"主題" OPEN_MENU -noext LOCAL_THEMES_DIR THEMES_DIR USER_THEMES_DIR WITH sets$
"圖示集" OPEN_MENU -noext LOCAL_ICON_SETS_DIR ICON_SETS_DIR USER_ICON_SETS_DI$
"儲存圖示集" EXEC geticonset USER_ICON_SETS_DIR/"%a(IconSet name)"
"儲存主題" EXEC getstyle -t USER_THEMES_DIR/"%a(Theme name)"
"外觀" END
========================================================================

background.menu
========================================================================
#include "wmmacros"

"背景" MENU
"實體色" MENU
"Black" WS_BACK '(solid, black)'
"Blue" WS_BACK '(solid, "#505075")'
"Indigo" WS_BACK '(solid, "#243e6c")'
"Deep Blue" WS_BACK '(solid, "#180090")'
"Purple" WS_BACK '(solid, "#554466")'
"Wheat" WS_BACK '(solid, "wheat4")'
"Dark Gray" WS_BACK '(solid, "#333340")'
"Wine" WS_BACK '(solid, "#400020")'
"實體色" END
"漸層色" MENU
"Sunset" WS_BACK '(mvgradient, deepskyblue4, black, deepskyblue$
"Sky" WS_BACK '(vgradient, blue4, white)'
"Blue Shades" WS_BACK '(vgradient, "#7080a5", "#101020")'
"Indigo Shades" WS_BACK '(vgradient, "#746ebc", "#242e4c")'
"Purple Shades" WS_BACK '(vgradient, "#654c66", "#151426")'
"Dark Gray" WS_BACK '(solid, "#333340")'
"Wine" WS_BACK '(solid, "#400020")'
"實體色" END
"漸層色" MENU
"Sunset" WS_BACK '(mvgradient, deepskyblue4, black, deepskyblue$
"Sky" WS_BACK '(vgradient, blue4, white)'
"Blue Shades" WS_BACK '(vgradient, "#7080a5", "#101020")'
"Indigo Shades" WS_BACK '(vgradient, "#746ebc", "#242e4c")'
"Purple Shades" WS_BACK '(vgradient, "#654c66", "#151426")'
"Wheat Shades" WS_BACK '(vgradient, "#a09060", "#302010")'
"Grey Shades" WS_BACK '(vgradient, "#636380", "#131318")'
"Wine Shades" WS_BACK '(vgradient, "#600040", "#180010")'
"漸層色" END
"圖片" MENU
"平鋪" OPEN_MENU LOCAL_BACKGROUNDS_DIR BACKGROUNDS_DIR USER_BACKGRO$
"比例" OPEN_MENU LOCAL_BACKGROUNDS_DIR BACKGROUNDS_DIR USER_BACKGRO$
"圖片" END
"背景" END
========================================================================

menu.hook
========================================================================
/* Automatically generated file. Do not edit (see /usr/share/doc/menu/menu.txt.$

#include "wmmacros"

Debian MENU

#include <menu.prehook>

"應用程式" MENU

"編輯器" MENU
"Nano" EXEC x-terminal-emulator -T "Nano" -e /usr/bin/nano
"Xedit" EXEC xedit
"編輯器" END

"影像處理" MENU
"Bitmap" EXEC bitmap
"影像處理" END

"數學" MENU
"Xcalc" EXEC xcalc
"bc" EXEC x-terminal-emulator -T "bc" -e /usr/bin/bc
"dc" EXEC x-terminal-emulator -T "dc" -e /usr/bin/dc
"數學" END

"網路" MENU
"Gaim" EXEC /usr/bin/gaim
"Lynx" EXEC x-terminal-emulator -T "Lynx" -e /usr/bin/lynx
"Mozilla Components" MENU
"Mozilla Addressbook" EXEC mozilla -addressbook
"Mozilla Browser" EXEC mozilla
"Mozilla Composer" EXEC mozilla -edit
"Mozilla Mail" EXEC mozilla -mail
"Mozilla Mail Composer" EXEC mozilla -compose
"Mozilla News" EXEC mozilla -news
"Mozilla Terminal" EXEC mozilla -terminal
"Mozilla Components" END
"Mozilla Navigator" EXEC mozilla
"Mutt" EXEC x-terminal-emulator -T "Mutt" -e /usr/bin/mutt
"Telnet" EXEC x-terminal-emulator -T "Telnet" -e telnet
"Xbiff" EXEC xbiff
"gFTP" EXEC gftp
"網路" END

"程式設計" MENU
"Gdb" EXEC x-terminal-emulator -T "Gdb" -e /usr/bin/gdb
"Python (v2.1)" EXEC x-terminal-emulator -T "Python (v2.1)" -e /usr/bin/pyth$
"Tclsh8.3" EXEC x-terminal-emulator -T "Tclsh8.3" -e /usr/bin/tclsh8.3 EXEC x-terminal-emulator -T "Tclsh8.3" -e /usr/bin/tclsh8.3
"程式設計" END

"命令模式" MENU
"Ash" EXEC x-terminal-emulator -T "Ash" -e /bin/ash -i
"Bash" EXEC x-terminal-emulator -T "Bash" -e /bin/bash -login
"Sh" EXEC x-terminal-emulator -T "Sh" -e /bin/sh -login
"Tcsh" EXEC x-terminal-emulator -T "Tcsh" -e /usr/bin/tcsh
"命令模式" END

"聲音" MENU
"XMMS" EXEC xmms
"wmXMMS" EXEC wmxmms
"聲音" END

"系統" MENU

"管理" MENU
"ALSA-config" EXEC x-terminal-emulator -T "ALSA-config" -e /usr/sbin/su-to-r$
"Lilo-config" EXEC x-terminal-emulator -T "Lilo-config" -e /usr/sbin/su-to-r$
"pppconfig" EXEC x-terminal-emulator -T "pppconfig" -e /usr/sbin/su-to-root $
"管理" END
"DSL/PPPoE configuration tool" EXEC x-terminal-emulator -T "DSL/PPPoE config$

"語言環境" MENU
"Belarusian environment" EXEC x-terminal-emulator -T "Belarusian environment$
"Bulgarian environment" EXEC x-terminal-emulator -T "Bulgarian environment" $
"Danish environment" EXEC x-terminal-emulator -T "Danish environment" -e /us$
"French environment" EXEC x-terminal-emulator -T "French environment" -e /us$
"German environment" EXEC x-terminal-emulator -T "German environment" -e /us$
"Japanese environment" EXEC x-terminal-emulator -T "Japanese environment" -e$
"Korean environment" EXEC x-terminal-emulator -T "Korean environment" -e /us$
"Macedonian environment" EXEC x-terminal-emulator -T "Macedonian environment$
"Native Language Environment" EXEC /usr/bin/tklanguage
"Native Language Environment - remove" EXEC x-terminal-emulator -T "Native L$
"Polish environment" EXEC x-terminal-emulator -T "Polish environment" -e /us$
"Russian environment" EXEC x-terminal-emulator -T "Russian environment" -e /$
"Serbian environment" EXEC x-terminal-emulator -T "Serbian environment" -e /$
"Spanish environment" EXEC x-terminal-emulator -T "Spanish environment" -e /$
"Thai environment" EXEC x-terminal-emulator -T "Thai environment" -e /usr/bi$
"Ukrainian environment" EXEC x-terminal-emulator -T "Ukrainian environment" $
"語言環境" END
"Task selector" EXEC x-terminal-emulator -T "Task selector" -e su-to-root /u$
"Top" EXEC x-terminal-emulator -T "Top" -e /usr/bin/top
"Wmakerconf" EXEC /usr/bin/wmakerconf
"Xconsole" EXEC xconsole
"Xload" EXEC xload
"Xvidtune" EXEC xvidtune
"bbconf" EXEC /usr/bin/bbconf
"pstree" EXEC /etc/alternatives/x-terminal-emulator -e /usr/bin/pstree.x11
"reportbug" EXEC x-terminal-emulator -T "reportbug" -e /usr/bin/reportbug
"系統" END

"文字" MENU
"Fortune" EXEC sh -c 'while fortune | col -x | xmessage -center -buttons OK:1$
"pyDict" EXEC /usr/bin/pydict
"stardic (fanti)" EXEC /usr/bin/stardic-ft
"stardic (jianti)" EXEC /usr/bin/stardic
"文字" END

"工具" MENU
"Chinese Panel" EXEC /usr/bin/cpanel
"Editres" EXEC editres
"Gentoo" EXEC gentoo
"Oclock" EXEC oclock
"X Window Snapshot" EXEC xwd | xwud
"Xclipboard" EXEC xclipboard
"Xclock (analog)" EXEC xclock -analog
"Xclock (digital)" EXEC xclock -digital -update 1
"Xcutsel" EXEC xcutsel
"Xev" EXEC x-terminal-emulator -e xev
"Xfontsel" EXEC xfontsel
"Xkill" EXEC xkill
"Xmag" EXEC xmag
"Xrefresh" EXEC xrefresh
"bbpager" EXEC /usr/bin/bbpager
"工具" END

"檢視器" MENU
"Acrobat Reader" EXEC /usr/bin/acroread
"Gnome VideoLAN Client" EXEC /usr/bin/gnome-vlc
"Mplayer" EXEC /usr/bin/gmplayer
"Real Player" EXEC realplayer
"VideoLAN Client" EXEC /usr/bin/vlc
"XDvi" EXEC /usr/bin/xdvi
"Xditview" EXEC xditview
"xine media player" EXEC /usr/bin/xine
"檢視器" END
"應用程式" END

"遊戲" MENU

"小玩具" MENU
"Xeyes" EXEC xeyes
"Xlogo" EXEC xlogo
"小玩具" END
"遊戲" END

"求助" MENU
"Info" EXEC x-terminal-emulator -T "Info" -e info
"Xman" EXEC xman
"求助" END

"螢幕" MENU

"鎖定" MENU
"鎖定螢幕 (XScreenSaver)" EXEC /usr/bin/xscreensaver-command -lock
"鎖定" END
"Refresh" REFRESH

"Root-window" MENU
"ChBg" EXEC /usr/bin/chbg
"Xsetroot" EXEC xsetroot
"Root-window" END

"儲存" MENU
"行動 ScreenSaver (下一個)" EXEC /usr/bin/xscreensaver-command -next
"行動 ScreenSaver (前一個)" EXEC /usr/bin/xscreensaver-command -prev
"行動 ScreenSaver (隨機)" EXEC /usr/bin/xscreensaver-command -activate
"Beforelight" EXEC beforelight
"Demo Screen Hacks" EXEC /usr/bin/xscreensaver-command -demo
"結束 XScreenSaver" EXEC /usr/bin/xscreensaver-command -exit
"啟動 XScreenSaver" EXEC /usr/bin/xscreensaver
"Reinitialize XScreenSaver" EXEC /usr/bin/xscreensaver-command -restart
"設定 ScreenSaver" EXEC /usr/bin/xscreensaver-command -prefs
"儲存" END
"螢幕" END

"視窗管理" MENU
"離開..." EXIT
"結束視窗系統..." SHUTDOWN
"重新啟動" RESTART
"啟動 Blackbox" RESTART /usr/bin/blackbox
"設定" EXEC WPrefs
"啟動 Twm" RESTART twm
"啟動 Window Maker" RESTART /usr/bin/wmaker
"資訊面板" INFO_PANEL
"法律面板" LEGAL_PANEL
"視窗管理" END

"工作區" MENU
"外觀" OPEN_MENU appearance.menu
"排列圖示" ARRANGE_ICONS
"清除階段狀態" CLEAR_SESSION
"隱藏其他" HIDE_OTHERS
"儲存階段狀態" SAVE_SESSION
"全部顯示" SHOW_ALL
"工作區" WORKSPACE_MENU
"工作區" END

"XShells" MENU
"CRxvt (Big5) " EXEC crxvt-big5 -im xcin -pt Root -bg black -fg white
"CRxvt (GB)" EXEC crxvt-gb -im xcin-zh_CN.GB2312 -pt Root
"Chinput" EXEC /usr/bin/chinput
"GRxvt" EXEC grxvt
"KRxvt" EXEC krxvt
"XCIN" EXEC /usr/bin/xcin
"XCINterm (Big5)" EXEC /usr/bin/xcinterm-big5
"XCINterm (GB2312)" EXEC /usr/bin/xcinterm-gb2312
"XTerm" EXEC xterm
"XTerm (Unicode)" EXEC uxterm
"XShells" END
#include <menu.posthook>

Debian END
========================================================================

P.S.
這不是"正解"的修改方式.....=.=||

因為這些檔案.....只要update-menu後.....

又會變回原來的英文選單.......

我有看過/usr/share/doc/menu/下的說明

它是說要修改成po檔....然後寄給update-menu的原作者

在下一個版本....就會釋出.....

但....我實在看不太懂po的格式及修改方法....

不然...我很願意改好寄給原作的說....><"
breaking
 

re:[問題]關於WindowMaker中文選單的問題

文章Tetralet » 週六 3月 22, 2003 11:41 pm

這個 Script 小四我以前真的寫過哦,
貼出來給您參考一下。

<pre>

#!/bin/bash

# 自行設計 WindowMaker 的選單!注意:可能還要再手動修正。

if [ -f /etc/X11/WindowMaker/menu.zh_TW.Big5 ]; then
# 先檢查是否已修正過。若沒有修正過再進行修正。
if [ -n "$(grep "資訊面板" /etc/X11/WindowMaker/menu.zh_TW.Big5)" ];then

cat > /etc/X11/WindowMaker/menu.zh_TW.Big5 << "EOF"

#include "wmmacros"

"應用程式" MENU
"執行程式..." EXEC %a(執行程式,輸入執行的命令:)
"中斷程式" EXEC xkill
"手冊瀏覽器" EXEC xman
"計算機" EXEC xcalc
"放大鏡" EXEC xmag
"檢視剪貼簿" EXEC xclipboard

"工作區" WORKSPACE_MENU

"作業區" MENU
"隱藏其他" HIDE_OTHERS
"全部顯示" SHOW_ALL
"排列圖示" ARRANGE_ICONS
"更新畫面" REFRESH
"鎖定" EXEC xlock -allowroot -usefirst
"儲存階段狀態" SAVE_SESSION
"清除階段狀態" CLEAR_SESSION
"作業區" END

"外觀" MENU
"主題" OPEN_MENU THEMES_DIR $HOME/GNUstep/Library/WindowMaker/Themes WITH setstyle
"風格" OPEN_MENU STYLES_DIR $HOME/GNUstep/Library/WindowMaker/Styles WITH setstyle
"圖示集" OPEN_MENU ICON_SETS_DIR $HOME/GNUstep/Library/WindowMaker/IconSets WITH seticons
"背景" MENU
"實體色" MENU
"Black" WS_BACK '(solid, black)'
"Blue" WS_BACK '(solid, "#505075")'
"Indigo" WS_BACK '(solid, "#243e6c")'
"Bleumarine" WS_BACK '(solid, "#224477")'
"Purple" WS_BACK '(solid, "#554466")'
"Wheat" WS_BACK '(solid, "wheat4")'
"Dark Gray" WS_BACK '(solid, "#333340")'
"Wine" WS_BACK '(solid, "#400020")'
"實體色" END
"漸層色" MENU
"Flag" WS_BACK '(mdgradient, green, red, white, green)'
"Sky" WS_BACK '(vgradient, blue4, white)'
"漸層色" END
"圖片" OPEN_MENU BACKGROUNDS_DIR $HOME/GNUstep/Library/WindowMaker/Backgrounds WITH wmsetbg -u -t
"背景" END
"儲存主題" SHEXEC getstyle -t $HOME/GNUstep/Library/WindowMaker/Themes/"%a(Theme name)"
"儲存圖示集" SHEXEC geticonset $HOME/GNUstep/Library/WindowMaker/IconSets/"%a(IconSet name)"
"外觀" END

"離開" MENU
"重新啟動" RESTART
"啟動 AfterStep" RESTART afterstep
"離開..." EXIT
"結束視窗系統..." SHUTDOWN
"離開" END
"應用程式" END

EOF

fi


AddToMenu()
{
if [ $# != 3 ]; then
echo ""
echo "Usage : FileName Describe Command..."
echo "Please try again."
echo ""
return 1
else
if [ -f $1 -a ! -n "$(grep "$2" /etc/X11/WindowMaker/menu.zh_TW.Big5)" ]; then
sed -e "s/^ \"手冊瀏覽器\" EXEC xman$/ \"$2\" EXEC $3 \"手冊瀏覽器\" EXEC xman/" /etc/X11/WindowMaker/menu.zh_TW.Big5 > /tmp/menu.zh_TW.Big5.tmp
sed -e 's/ \"手冊瀏覽器\" EXEC xman$/\
\"手冊瀏覽器\" EXEC xman/' /tmp/menu.zh_TW.Big5.tmp > /etc/X11/WindowMaker/menu.zh_TW.Big5
rm /tmp/menu.zh_TW.Big5.tmp
fi
fi
}

AddToMenu /usr/bin/rxvt "終端機程式 - CRXVT" "rxvt"
AddToMenu /usr/bin/mlterm "終端機程式 - MLTERM" "mlterm"
AddToMenu /usr/bin/mozilla "瀏灠器 - Mozilla" "mozilla"
AddToMenu /usr/bin/ncftp "FTP 用戶端 - NcFTP" "rxvt -e ncftp"
AddToMenu /usr/bin/gftp "FTP 用戶端 - GFTP" "gftp"
AddToMenu /usr/bin/vim "文字編輯器 - VIM" "rxvt -e vi"
AddToMenu /usr/bin/qe "文字編輯器 - QE" "rxvt -e qe"
AddToMenu /usr/bin/gedit "文字編輯器 - GEdit" "gedit"
AddToMenu /usr/bin/kate "文字編輯器 - Kate" "kate"
AddToMenu /usr/bin/khexedit "HEX 編輯器 - KHexEdit" "khexedit"
AddToMenu /usr/bin/openoffice "OpenOffice.org" "openoffice"
AddToMenu /usr/bin/gv "PS 檔案 檢視器 - GV" "gv"
AddToMenu /usr/bin/gimp "影像編輯軟體 - GIMP" "gimp"
AddToMenu /usr/bin/gqview "影像瀏覽軟體 - GQView" "gqview"
AddToMenu /usr/bin/gliv "影像瀏覽軟體 - Gliv" "gliv"
AddToMenu /usr/bin/eeyes "影像瀏覽軟體 - EEyes" "eeyes"
AddToMenu /usr/bin/pydict "翻譯軟體 - pyDict" "pydict"
AddToMenu /usr/bin/stardic-ft "翻譯軟體 - StarDict" "stardic-ft"
AddToMenu /usr/bin/xine "媒體播放程式 - Xine" "xine"
AddToMenu /usr/bin/xmovie "媒體播放程式 - XMovie" "xmovie"
AddToMenu /usr/bin/xmcd "CD 播放程式 - XMCD" "xmcd"
AddToMenu /usr/bin/xmms "OGG 播放程式 - XMMS" "xmms"
AddToMenu /usr/bin/grip "OGG 轉錄程式 - Grip" "grip"

fi

</pre>

不怎麼樣的一個小 Script,
並且還有很多可以改進的地方,
不過它的基本原理相信您一定看得懂的。
Tetralet
俺是博士
俺是博士
 
文章: 3078
註冊時間: 週四 11月 28, 2002 3:02 pm

re:[問題]關於WindowMaker中文選單的問題

文章swallowman » 週日 3月 23, 2003 2:25 am

我的menu也是DIY的,是不是要大家一起選些好用的工具,然後訂一個標準的moto menu,除了可在wmaker教學上列出供學習者(新手)取用外,另一個重點是po檔,如能提供多些資料,相信很多想中文化的朋友一定有興趣(ps:很多程式國際化都是用po檔).

小弟有個想法,是否有時版上可提供專區來針對單方面的問題討論呢?(如study-area有zope專區,linuxfans有xft2專區.....),如果將問題集中化後,自然就會有解決的方案了,當然專區是暫時性的,結果出爐後,就可納入moto版精華文章.
control yourself,make it easy~!make it happy~!
debian<->gentoo<->freebsd
頭像
swallowman
懵懂的國中生
懵懂的國中生
 
文章: 230
註冊時間: 週一 3月 10, 2003 5:50 am
來自: taichung(puli)

re:[問題]關於WindowMaker中文選單的問題

文章訪客 » 週一 3月 24, 2003 12:05 am

另一個重點是po檔,如能提供多些資料,相信很多想中文化的朋友一定有興趣(ps:很多程式國際化都是用po檔).


請參考http://xcin.linux.org.tw/i18n/pc2000/p5/

p.s.我還在努力中啦.... :ooops:
訪客
 

re:[問題]關於WindowMaker中文選單的問題

文章swallowman » 週一 3月 24, 2003 12:57 am

Anonymous 寫:請參考http://xcin.linux.org.tw/i18n/pc2000/p5/

這篇太好了,之前為甚麼都找不到><
msgfmt -v -o gettext_test.gmo gettext_test.po
<--這麼簡單的東西竟找老半天><.
control yourself,make it easy~!make it happy~!
debian<->gentoo<->freebsd
頭像
swallowman
懵懂的國中生
懵懂的國中生
 
文章: 230
註冊時間: 週一 3月 10, 2003 5:50 am
來自: taichung(puli)


回到 debian desktop

誰在線上

正在瀏覽這個版面的使用者:沒有註冊會員 和 1 位訪客

cron