---------- Forwarded message ---------- Date: 11 Apr 2000 06:56:57 +0200 From: Karl EICHWALDER To: gnome-i18n@nuclecu.unam.mx Subject: Re: ispell for po-files Resent-Date: Mon, 10 Apr 2000 23:59:52 -0500 Resent-From: gnome-i18n@nuclecu.unam.mx Birger Langkjer writes: | Byrial Jensen from our LUG has modified ispell to use with po-files, checkout | his work at: | | http://www.image.dk/~byrial/pospell/ The looks preety useful! I also have something to offer (for Emacs po-mode users); add the following hook to po-mode.el: @@ -1785,6 +1757,7 @@ (skip-chars-backward " \t\n") (if (eq (preceding-char) ?<) (delete-region (1- (point)) (point-max))) + (run-hooks 'po-subedit-exit-hook) (let ((string (buffer-string))) (po-subedit-abort) (po-find-span-of-entry) Then add the following functions to your .emacs: (setq ispell-dictionary "american") ;; (set-default 'ispell-local-dictionary "american") (defvar ke-po-dictionary "german-latin1" "*Dictionary to use for spell checking `msgstr' entries. For available dictionaries see `ispell-dictionary-alist'.") (defvar ke-po-ispell-buffer nil "*non-nil enable spell checking before exit subedit.") (defun ke-po-toggle-ispell () "Toggle ispell." (interactive) (setq ke-po-ispell-buffer (not ke-po-ispell-buffer))) (defun ke-ispell-buffer () (let ((ispell-local-dictionary ke-po-dictionary)) (if ke-po-ispell-buffer (ispell-buffer)))) (add-hook 'po-subedit-exit-hook 'ke-ispell-buffer) -=-=-=-=-=-=-=-=-=-=-=-=-=- cut here -=-=-=-=-=-=-=-=-=-=-=-=-=- Once you enable `ke-po-ispell-buffer' (via `M-x ke-po-toggle-ispell') every message will be checked if you exit the edit buffer. -=-=-=-=-=-=-=-=-=-=-=-=-=- cut here -=-=-=-=-=-=-=-=-=-=-=-=-=- Here are two additional functions to ispell a whole PO file from point to the end of a buffer (of course, you have to `E'scape PO mode first): (defun ke-po-ispell-msgstr (dict) "`ispell' a `msgstr' entry." (interactive "*") (let ((start) (end) (ispell-local-dictionary dict)) (setq end (re-search-forward po-any-msgstr-regexp)) (ispell-region (+ (match-beginning 0) (length "msgstr")) end))) (defun ke-po-do-ispell () "`ispell' a PO file from point to the end of the buffer." (interactive "*") (while (not (eobp)) (ke-po-ispell-msgstr ke-po-dictionary)))