unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Karl Eichwalder <keichwa@gmx.net>
Cc: emacs-devel@gnu.org
Subject: [ Göran Uddeborg] Pattern for spell-checking in po-files.
Date: Fri, 23 May 2003 19:42:13 +0200	[thread overview]
Message-ID: <shn0hdzhje.fsf@tux.gnu.franken.de> (raw)

[-- 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

             reply	other threads:[~2003-05-23 17:42 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-05-23 17:42 Karl Eichwalder [this message]
2003-05-23 22:26 ` [ Göran Uddeborg ] Pattern for spell-checking in po-files 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=shn0hdzhje.fsf@tux.gnu.franken.de \
    --to=keichwa@gmx.net \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).