diff options
| author | John Wiegley <johnw@newartisans.com> | 2002-04-13 11:13:33 +0000 |
|---|---|---|
| committer | John Wiegley <johnw@newartisans.com> | 2002-04-13 11:13:33 +0000 |
| commit | 7e960384fa89c02c2fc2be1f61fe18645f8a13fe (patch) | |
| tree | 66d17d5fb9a7f73a3291e6261f1df2e12612eb2e /chess-irc.el | |
| parent | f4639c9095c34caa60b4122e2cf4d6b1402508e3 (diff) | |
added message catalog support
Diffstat (limited to 'chess-irc.el')
| -rw-r--r-- | chess-irc.el | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/chess-irc.el b/chess-irc.el index 1934037..2f284cb 100644 --- a/chess-irc.el +++ b/chess-irc.el @@ -25,13 +25,22 @@ :type 'string :group 'chess-irc) +;;; Code: + +(chess-message-catalog 'english + '((opponent-says . "Your opponent says: %s") + (irc-connecting . "Connecting to IRC server '%s:%d'...") + (irc-logging-in . "Connected, now logging in as '%s'...") + (irc-waiting . "Now waiting for 'name USER' via /msg, or `M-x chess-irc-engage'") + (irc-challenge . "IRC nick of user to challenge: "))) + (defvar chess-irc-regexp-alist (append chess-network-regexp-alist (list (cons ".+" (function (lambda () - (message "Your opponent says: %s" - (match-string 0)))))))) + (chess-message 'opponent-says + (match-string 0)))))))) (defvar chess-irc-process) (defvar chess-irc-engine) @@ -51,14 +60,13 @@ "This is an example of a generic transport engine." (cond ((eq event 'initialize) - (message "Connecting to IRC server '%s:%d'..." - chess-irc-server chess-irc-port) + (chess-message 'irc-connecting chess-irc-server chess-irc-port) (let ((engine (current-buffer)) proc) (with-current-buffer (generate-new-buffer " *chess-irc*") (setq chess-irc-engine engine proc (open-network-stream "*chess-irc*" (current-buffer) chess-irc-server chess-irc-port)) - (message "Connected, now logging in as '%s'..." chess-irc-nick) + (chess-message 'irc-logging-in chess-irc-nick) (when (and proc (eq (process-status proc) 'open)) (process-send-string proc (format "USER %s 0 * :%s\n" (user-login-name) @@ -67,12 +75,12 @@ (set-process-filter proc 'chess-irc-filter) (set-process-buffer proc (current-buffer)) (set-marker (process-mark proc) (point)) - (message "Now waiting for 'name USER' via /msg, or `M-x chess-irc-engage'"))) + (chess-message 'irc-waiting))) (setq chess-irc-process proc)) nil) ((eq event 'match) - (setq chess-irc-opponent (read-string "IRC nick of user to challenge: ")) + (setq chess-irc-opponent (read-string (chess-string 'irc-challenge))) (chess-network-handler 'match chess-irc-opponent)) ((eq event 'shutdown) |
