From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Karl Eichwalder Newsgroups: gmane.emacs.devel Subject: [ =?iso-8859-1?q?G=F6ran_Uddeborg?=] Pattern for spell-checking in po-files. Date: Fri, 23 May 2003 19:42:13 +0200 Sender: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Message-ID: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: main.gmane.org 1053713452 14583 80.91.224.249 (23 May 2003 18:10:52 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Fri, 23 May 2003 18:10:52 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Fri May 23 20:10:45 2003 Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 19JGwV-00039l-00 for ; Fri, 23 May 2003 20:06:59 +0200 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.12 #1 (Debian)) id 19JH8M-00055s-00 for ; Fri, 23 May 2003 20:19:14 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.20) id 19JGyD-0007vN-1N for emacs-devel@quimby.gnus.org; Fri, 23 May 2003 14:08:45 -0400 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.20) id 19JGxd-0007sT-O6 for emacs-devel@gnu.org; Fri, 23 May 2003 14:08:09 -0400 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.20) id 19JGe5-0000bm-Rz for emacs-devel@gnu.org; Fri, 23 May 2003 13:47:58 -0400 Original-Received: from elvis.franken.de ([193.175.24.41]) by monty-python.gnu.org with esmtp (Exim 4.20) id 19JGaZ-00088t-Mp for emacs-devel@gnu.org; Fri, 23 May 2003 13:44:19 -0400 Original-Received: from uucp by elvis.franken.de with local-rmail (Exim 3.36 #1) id 19JGaj-0002Qm-00; Fri, 23 May 2003 19:44:29 +0200 Original-Received: by tux.gnu.franken.de (Postfix, from userid 270) id 728BD48C1F; Fri, 23 May 2003 19:42:13 +0200 (CEST) Original-To: Ken Stevens User-Agent: Gnus/5.1003 (Gnus v5.10.3) Emacs/21.3.50 (gnu/linux) Original-cc: =?iso-8859-1?q?G=F6ran_Uddeborg?= X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1b5 Precedence: list List-Id: Emacs development discussions. List-Help: List-Post: List-Subscribe: , List-Archive: List-Unsubscribe: , Errors-To: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Xref: main.gmane.org gmane.emacs.devel:14143 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:14143 --=-=-= Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable I'd like to ask for ispell support for .po files. .po files are translation files as used by the gettext tools collection. Basically they contain the english message (msgid) and translation (msgstr) provided by the translator, plus comments (# ): # this is the first message #, c-format msgid "" "this is a message." msgstr "" "dies ist eine Meldung." # this is the 2nd message #, c-format msgid "" "this is the sencond message." msgstr "" "dies ist die zweite Meldung." ispell should check text after "# " (but not after "#[.,:]") and inside the field 'msgstr' only. G=F6ran Uddeborg already came up with the appended extension to po-mode.el. I'd recommend to add something along these lines to ispell.el (as already done for 'tex). For testing more .po files you can find here: http://www.iro.umontreal.ca/contrib/po/teams/PO/ --=-=-= Content-Type: message/rfc822 Content-Disposition: inline From: =?iso-8859-1?q?G=F6ran_Uddeborg?= Message-ID: <16074.7007.769528.285017@uebn.uddeborg.pp.se> To: sv@li.org, translation-i18n@lists.sourceforge.net Subject: Pattern for spell-checking in po-files. Date: Tue, 20 May 2003 14:11:11 +0200 MIME-Version: 1.0 I made a little hook to po-mode to set up patterns for ispell so only the translated strings and translator comments are checked. This might be a too trivial thing, but I haven't seen it elsewhere so I thought I'd post it. So I get some help with debugging! :-) Maybe I will trigger someone to post their own much better ideas? This is not perfect in any way. Since the po file is in read only mode, you can only use it to detect misspellings, but not fix them on-the-fly in the ordinary ispell-mode way. (defun po-mode-ispell-pattern () "Add ispell patterns so that only translated messages are checked." (make-variable-buffer-local 'ispell-skip-region-alist) (add-to-list 'ispell-skip-region-alist '("^msgid" . "^msgstr")) (add-to-list 'ispell-skip-region-alist '("^#[:,]" . "\n"))) (add-hook 'po-mode-hook 'po-mode-ispell-pattern) [...] --=-=-= -- | ,__o http://www.gnu.franken.de/ke/ | _-\_<, ke@suse.de (work) / keichwa@gmx.net (home) | (*)/'(*) --=-=-= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit _______________________________________________ Emacs-devel mailing list Emacs-devel@gnu.org http://mail.gnu.org/mailman/listinfo/emacs-devel --=-=-=--