riece-mcat to translate menu labels.
(riece-menu-requires): Depend on riece-mcat.
(riece-menu-insinuate): Re-evaluate riece-menu-items.
* riece-url.el (riece-url-command-mode-hook): Translate "Open URL...".
2008-05-27 Daiki Ueno <ueno@unixuser.org>
+ * riece-menu.el (riece-menu-items): Define with defcustom; use
+ riece-mcat to translate menu labels.
+ (riece-menu-requires): Depend on riece-mcat.
+ (riece-menu-insinuate): Re-evaluate riece-menu-items.
+
+ * riece-url.el (riece-url-command-mode-hook): Translate "Open URL...".
+
+2008-05-27 Daiki Ueno <ueno@unixuser.org>
+
* riece-display.el (riece-update-status-indicators): Don't update
riece-user-indicator if riece-real-nickname is not fixed.
("CTCP VERSION for %s (%s) = %s" . "%s (%s) \e$B$N\e(B CTCP VERSION = %s")
("CTCP VERSION from %s (%s) to %s" . "%s (%s) \e$B$,\e(B %s \e$B$K\e(B CTCP VERSION")
("Can't find completion for \"%s\"" . "\"%s\" \e$B$KBP$9$kJd40$,8+$D$+$j$^$;$s\e(B")
+ ("Change Nickname" . "\e$B%K%C%/%M!<%`$rJQ99\e(B")
+ ("Change Window Layout..." . "\e$B%&%#%s%I%&%l%$%"%&%H$rJQ99\e(B...")
("Change layout: " . "\e$BJQ998e$N%l%$%"%&%H\e(B: ")
("Change mode for channel/user: " . "\e$B%b!<%I$rJQ99$9$k%A%c%s%M%k$^$?$O%f!<%6\e(B: ")
("Channel/User: " . "\e$B%A%c%s%M%k$^$?$O%f!<%6\e(B: ")
+ ("Channels" . "\e$B%A%c%s%M%k0lMw\e(B")
+ ("Close Server" . "\e$B%5!<%P$H$N@\B3$rJD$8$k\e(B")
("Close server: " . "\e$B@\B3$rJD$8$k%5!<%P\e(B: ")
("Command to execute on \"%s\":" . "\"%s\" \e$B$G<B9T$9$k%3%^%s%I\e(B: ")
("Connecting to %s..." . "%s \e$B$K@\B3$7$F$$$^$9\e(B...")
("Connecting to IRC server...done" . "IRC \e$B%5!<%P$K@\B3$7$F$$$^$9\e(B...\e$B40N;\e(B")
("Connecting to IRC server...failed: %S" . "IRC \e$B%5!<%P$K@\B3$7$F$$$^$9\e(B...\e$B<:GT\e(B: %S")
("Created on %s\n" . "%s \e$B$K:n@.$5$l$^$7$?\e(B\n")
+ ("Display Channel Buffer" . "\e$B%A%c%s%M%k%P%C%U%!$NI=<(\e(B")
+ ("Display Channel List Buffer" . "\e$B%A%c%s%M%k0lMw%P%C%U%!$NI=<(\e(B")
+ ("Display User List Buffer" . "\e$B%f!<%60lMw%P%C%U%!$NI=<(\e(B")
("End of buffer" . "\e$B%P%C%U%!$N=*C<$G$9\e(B")
("Erroneous nickname \"%s\". Choose a new one: " . "\e$BIT@5$J%K%C%/%M!<%`\e(B \"%s\"\e$B!#?7$7$$%K%C%/%M!<%`\e(B: ")
("File: " . "\e$B%U%!%$%k\e(B: ")
("Finger user: " . "\e$B?H85$rD4$Y$k%f!<%6\e(B: ")
+ ("Freeze Channel Buffer" . "\e$B%A%c%s%M%k%P%C%U%!$N%U%j!<%:\e(B")
+ ("Freeze Channel Buffer Until Next Message" . "\e$B%a%C%;!<%8$,Mh$k$^$G%A%c%s%M%k%P%C%U%!$r%U%j!<%:\e(B")
+ ("Invite User" . "\e$B%f!<%6$r>7BT$9$k\e(B")
("Invite user: " . "\e$B>7BT$9$k%f!<%6\e(B: ")
("Inviting %s\n" . "%s \e$B$r>7BT$7$F$$$^$9\e(B\n")
("Inviting %s to %s" . "%s \e$B$r\e(B %s \e$B$K>7BT$7$F$$$^$9\e(B")
+ ("Join Channel" . "\e$B%A%c%s%M%k$K;22C$9$k\e(B")
("Join channel/user (default %s): " . "\e$B;22C$9$k%A%c%s%M%k$^$?$O%f!<%6\e(B (\e$B4{DjCM\e(B %s): ")
("Join channel/user: " . "\e$B;22C$9$k%A%c%s%M%k$^$?$O%f!<%6\e(B: ")
("Key for %s: " . "%s \e$B$N%-!<\e(B: ")
("Key for %s: Quit" . "%s \e$B$N%-!<\e(B: \e$BCf;_\e(B")
+ ("Kick User" . "\e$B%f!<%6$r=3$j=P$9\e(B")
("Kick user: " . "\e$B=3$j=P$9%f!<%6\e(B: ")
("LIST pattern: " . "LIST \e$B$N%Q%?!<%s\e(B: ")
+ ("List Channel" . "\e$B%A%c%s%M%k$rD4$Y$k\e(B")
("Logging in to %s..." . "%s \e$B$K%m%0%$%s$7$F$$$^$9\e(B...")
("Logging in to %s...done" . "%s \e$B$K%m%0%$%s$7$F$$$^$9\e(B...\e$B40N;\e(B")
("Logging in to IRC server..." . "IRC \e$B%5!<%P$K%m%0%$%s$7$F$$$^$9\e(B...")
("Logging in to IRC server...done" . "IRC \e$B%5!<%P$K%m%0%$%s$7$F$$$^$9\e(B...\e$B40N;\e(B")
+ ("Mark As Away" . "\e$BN%@J>uBV$K$9$k\e(B")
("Message to user: " . "\e$B%f!<%6$X$N%a%C%;!<%8\e(B: ")
("Message: " . "\e$B%a%C%;!<%8\e(B")
("Mode (? for help)" . "\e$B%b!<%I\e(B (\e$B%X%k%W$O\e(B ?)")
("Mode on %s by %s: %s" . "%s \e$B$N%b!<%I$,\e(B %s \e$B$K$h$j@_Dj$5$l$^$7$?\e(B: %s")
("Mode: " . "\e$B%b!<%I\e(B: ")
("NAMES pattern: " . "NAMES \e$B$N%Q%?!<%s\e(B: ")
+ ("Next Channel" . "\e$B<!$N%A%c%s%M%k\e(B")
("Nickname \"%s\" already in use. Choose a new one: " . "\e$B%K%C%/%M!<%`\e(B \"%s\" \e$B$O4{$K;HMQ$5$l$F$$$^$9!#?7$7$$%K%C%/%M!<%`\e(B: ")
("No changes made. Save anyway? " . "\e$BJQ99$,$"$j$^$;$s$,!"J]B8$7$^$9$+\e(B? ")
("No channel" . "\e$B%A%c%s%M%k$J$7\e(B")
("No text to send" . "\e$BAw?.$9$k%F%-%9%H$,$"$j$^$;$s\e(B")
("None" . "\e$B$J$7\e(B")
("Online: " . "\e$B%*%s%i%$%s\e(B: ")
+ ("Open Server" . "\e$B%5!<%P$K@\B3\e(B")
+ ("Open URL..." . "URL \e$B$r3+$/\e(B...")
+ ("Open URL: " . "\e$B3+$/\e(B URL: ")
("Open server: " . "\e$B@\B3$9$k%5!<%P\e(B: ")
+ ("Part Channel" . "\e$B%A%c%s%M%k$+$iN%C&$9$k\e(B")
("Part from channel/user (default %s): " . "\e$BN%C&$9$k%A%c%s%M%k$^$?$O%f!<%6\e(B (\e$B4{DjCM\e(B %s): ")
("Password for %s: " . "%s \e$B$N%Q%9%o!<%I\e(B: ")
("Password for %s: Quit" . "%s \e$B$N%Q%9%o!<%I\e(B: \e$BCf;_\e(B")
("Password incorrect from %s." . "%s \e$B$N%Q%9%o!<%I$,IT@5$G$9!#\e(B")
("Password: " . "\e$B%Q%9%o!<%I\e(B: ")
("Password: Quit" . "\e$B%Q%9%o!<%I\e(B: \e$BCf;_\e(B")
+ ("Previous Channel" . "\e$BA0$N%A%c%s%M%k\e(B")
+ ("Quit IRC" . "IRC \e$B$r$d$a$k\e(B")
("Really quit IRC? " . "\e$BK\Ev$K\e(B IRC \e$B$r$d$a$^$9$+\e(B? ")
("Really want to query LIST without argument? " . "\e$BK\Ev$K0z?t$J$7$N\e(B LIST \e$B$rH/9T$7$^$9$+\e(B? ")
("Really want to query NAMES without argument? " . "\e$BK\Ev$K0z?t$J$7$N\e(B NAMES \e$B$rH/9T$7$^$9$+\e(B? ")
("Sending QUIT..." . "QUIT \e$B$rAw?.$7$F$$$^$9\e(B...")
("Sending QUIT...done" . "QUIT \e$B$rAw?.$7$F$$$^$9\e(B...\e$B40N;\e(B")
("Server: " . "\e$B%5!<%P\e(B: ")
+ ("Servers" . "\e$B%5!<%P0lMw\e(B")
("Set +o for users" . "+o \e$B$9$k%f!<%6\e(B")
("Set +v for users" . "+v \e$B$9$k%f!<%6\e(B")
+ ("Set Channel Topic" . "\e$B%A%c%s%M%k$N%H%T%C%/\e(B")
("Set topic: " . "\e$B?7$7$$%H%T%C%/\e(B: ")
+ ("Submit Bug Report" . "\e$B%P%0$rJs9p\e(B")
+ ("Switch To Channel" . "\e$B%A%c%s%M%k$r0\F0\e(B")
("Switch to channel/user: " . "\e$B0\F0@h$N%A%c%s%M%k$^$?$O%f!<%6\e(B: ")
("Switch to number: " . "\e$B0\F0@h$NHV9f\e(B: ")
+ ("Toggle..." . "\e$B%H%0%k\e(B...")
("Topic by %s: %s\n" . "%s \e$B$K$h$k%H%T%C%/@_Dj\e(B: %s\n")
("Topic for %s: %s" . "%s \e$B$N%H%T%C%/\e(B: ")
("Topic on %s by %s: %s" . "%s \e$B$N%H%T%C%/$,\e(B %s \e$B$K$h$j@_Dj$5$l$^$7$?\e(B: %s")
("Unset +o for users" . "-o \e$B$9$k%f!<%6\e(B")
("Unset +v for users" . "-v \e$B$9$k%f!<%6\e(B")
("User: " . "\e$B%f!<%6\e(B: ")
+ ("Version" . "\e$B%P!<%8%g%s\e(B")
("WHO pattern: " . "WHO \e$B$N%Q%?!<%s\e(B: ")
("[Available modes: " . "[\e$B;HMQ2DG=$J%b!<%I\e(B: ")
("days" . "\e$BF|\e(B")
-;;; riece-menu.el --- setup Riece's command menus
+;;; riece-menu.el --- setup menus
;; Copyright (C) 1998-2003 Daiki Ueno
;; Author: Daiki Ueno <ueno@unixuser.org>
(require 'riece-identity)
(require 'riece-layout)
(require 'riece-server)
-
-(defvar riece-menu-items
- `("Riece"
- ["Version" riece-version t]
- ["Submit Bug Report" riece-submit-bug-report t]
- "----"
- ("Change Window Layout..." :filter riece-menu-create-layouts-menu)
- ["Toggle Freeze Channel Buffer"
- riece-command-toggle-freeze t]
- ["Toggle Freeze Channel Buffer Until Next Message"
- riece-command-toggle-own-freeze t]
- ["Toggle Display Channel Buffer"
- riece-command-toggle-channel-buffer-mode t]
- ["Toggle Display Channel List Buffer"
- riece-command-toggle-channel-list-buffer-mode t]
- ["Toggle Display User List Buffer"
- riece-command-toggle-user-list-buffer-mode t]
- "----"
- ["Join Channel" riece-command-join t]
- ["Change Nickname" riece-command-change-nickname t]
- ["Mark As Away" riece-command-toggle-away t]
- ["Quit IRC" riece-command-quit t]
- "----"
- ["Part Channel" riece-command-part riece-current-channel]
- ["Set Channel Topic" riece-command-topic riece-current-channel]
- ["Kick User" riece-command-kick riece-current-channel]
- ["Invite User" riece-command-invite riece-current-channel]
- "----"
- ["Next Channel" riece-command-next-channel riece-current-channels]
- ["Previous Channel" riece-command-previous-channel riece-current-channels]
- "----"
- ("Channels" :filter riece-menu-create-channels-menu)
- ("Servers" :filter riece-menu-create-servers-menu))
- "Menu used in command mode.")
+(require 'riece-mcat)
+
+(defcustom riece-menu-items
+ (list
+ "Riece"
+ (vector (riece-mcat "Next Channel") 'riece-command-next-channel
+ 'riece-current-channels)
+ (vector (riece-mcat "Previous Channel") 'riece-command-previous-channel
+ 'riece-current-channels)
+ "----"
+ (list (riece-mcat "Channels")
+ :filter 'riece-menu-create-channels-menu)
+ (list (riece-mcat "Servers")
+ :filter 'riece-menu-create-servers-menu)
+ "----"
+ (list (riece-mcat "Change Window Layout...")
+ :filter 'riece-menu-create-layouts-menu)
+ (list (riece-mcat "Toggle...")
+ (vector (riece-mcat "Freeze Channel Buffer")
+ 'riece-command-toggle-freeze t)
+ (vector (riece-mcat "Freeze Channel Buffer Until Next Message")
+ 'riece-command-toggle-own-freeze t)
+ (vector (riece-mcat "Display Channel Buffer")
+ 'riece-command-toggle-channel-buffer-mode t)
+ (vector (riece-mcat "Display Channel List Buffer")
+ 'riece-command-toggle-channel-list-buffer-mode t)
+ (vector (riece-mcat "Display User List Buffer")
+ 'riece-command-toggle-user-list-buffer-mode t))
+ "----"
+ (vector (riece-mcat "Join Channel") 'riece-command-join t)
+ (vector (riece-mcat "Part Channel") 'riece-command-part
+ 'riece-current-channel)
+ (vector (riece-mcat "Set Channel Topic") 'riece-command-topic
+ 'riece-current-channel)
+ (vector (riece-mcat "Kick User") 'riece-command-kick
+ 'riece-current-channel)
+ (vector (riece-mcat "Invite User") 'riece-command-invite
+ 'riece-current-channel)
+ "----"
+ (vector (riece-mcat "Version") 'riece-version t)
+ (vector (riece-mcat "Submit Bug Report") 'riece-submit-bug-report t)
+ "----"
+ (vector (riece-mcat "Mark As Away") 'riece-command-toggle-away t)
+ (vector (riece-mcat "Change Nickname") 'riece-command-change-nickname t)
+ (vector (riece-mcat "Quit IRC") 'riece-command-quit t))
+ "Menu used in command mode."
+ :type 'sexp
+ :group 'riece-options)
(defconst riece-menu-description
"Setup Riece's command menus.")
(defun riece-menu-create-channels-menu (menu)
(mapcar (lambda (channel)
(list (riece-format-identity channel)
- (vector "Switch To Channel"
+ (vector (riece-mcat "Switch To Channel")
(list 'riece-command-switch-to-channel channel) t)
- (vector "Part Channel"
+ (vector (riece-mcat "Part Channel")
(list 'riece-command-part channel) t)
- (vector "List Channel"
+ (vector (riece-mcat "List Channel")
(list 'riece-command-list
(riece-identity-prefix channel)) t)))
riece-current-channels))
(defun riece-menu-create-servers-menu (menu)
(mapcar (lambda (entry)
(list (car entry)
- (vector "Open Server"
+ (vector (riece-mcat "Open Server")
(list 'riece-command-open-server (car entry))
(not (riece-server-opened (car entry))))
- (vector "Close Server"
+ (vector (riece-mcat "Close Server")
(list 'riece-command-close-server (car entry))
(riece-server-opened (car entry)))))
riece-server-alist))
riece-menu-items)
(easy-menu-add riece-menu))
+(defun riece-menu-requires ()
+ (if (memq 'riece-mcat riece-addons)
+ '(riece-mcat)))
+
(defun riece-menu-insinuate ()
+ (custom-reevaluate-setting 'riece-menu-items)
(if riece-command-buffer
(with-current-buffer riece-command-buffer
(riece-menu-command-mode-hook)))
(defun riece-command-browse-url (&optional url)
(interactive
- (list (completing-read "Open URL: " (mapcar #'list riece-urls))))
+ (list (completing-read (riece-mcat "Open URL: ")
+ (mapcar #'list riece-urls))))
(browse-url url))
(defun riece-url-create-menu (menu)
(defun riece-url-command-mode-hook ()
(easy-menu-add-item
nil (list (car riece-menu-items))
- '("Open URL..." :filter riece-url-create-menu)))
+ (list (riece-mcat "Open URL...") :filter 'riece-url-create-menu)))
(defun riece-url-insinuate ()
(add-hook 'riece-after-insert-functions 'riece-url-scan-region)
(defun riece-url-uninstall ()
(easy-menu-remove-item
nil (list (car riece-menu-items))
- "Open URL...")
+ (riece-mcat "Open URL..."))
(remove-hook 'riece-after-insert-functions 'riece-url-scan-region)
(remove-hook 'riece-command-mode-hook
'riece-url-command-mode-hook))