unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* [ Göran Uddeborg] Pattern for spell-checking in po-files.
@ 2003-05-23 17:42 Karl Eichwalder
  2003-05-23 22:26 ` [ Göran Uddeborg ] " Stefan Monnier
  2003-05-24 23:20 ` [ Göran Uddeborg] " Richard Stallman
  0 siblings, 2 replies; 5+ messages in thread
From: Karl Eichwalder @ 2003-05-23 17:42 UTC (permalink / raw)
  Cc: emacs-devel

[-- Attachment #1: Type: text/plain, Size: 869 bytes --]

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öran 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/


[-- Attachment #2: Type: message/rfc822, Size: 1139 bytes --]

From: "Göran Uddeborg" <goeran@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
Message-ID: <16074.7007.769528.285017@uebn.uddeborg.pp.se>

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)

[...]


[-- Attachment #3: Type: text/plain, Size: 214 bytes --]



-- 
                                                         |      ,__o
http://www.gnu.franken.de/ke/                            |    _-\_<,
ke@suse.de (work) / keichwa@gmx.net (home)               |   (*)/'(*)

[-- Attachment #4: Type: text/plain, Size: 142 bytes --]

_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/emacs-devel

^ permalink raw reply	[flat|nested] 5+ messages in thread
[parent not found: <1261.1053715963@ichips.intel.com>]

end of thread, other threads:[~2003-05-24 23:20 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-05-23 17:42 [ Göran Uddeborg] Pattern for spell-checking in po-files Karl Eichwalder
2003-05-23 22:26 ` [ Göran Uddeborg ] " Stefan Monnier
2003-05-24 21:51   ` Göran Uddeborg
2003-05-24 23:20 ` [ Göran Uddeborg] " Richard Stallman
     [not found] <1261.1053715963@ichips.intel.com>
2003-05-23 21:08 ` [G ran " Kenny Stevens

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).