[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-i18n-doc
Subject:    Re: Looking for a good script/tool to search in po-files
From:       Chusslove Illich <caslav.ilic () gmx ! net>
Date:       2009-03-03 22:00:53
Message-ID: 200903032300.53995.caslav.ilic () gmx ! net
[Download RAW message or body]


> [: Martin Schlander :]
> I at least often find myself wanting to find occurences of certain words
> or phrases, but lacking a tool to do quick, precise and reliable search in
> my po- file checkouts.

Check out find-messages sieve of Pology (it's right there in
trunk/l10n-support/pology, and some stub doc at
http://techbase.kde.org/Localization/Tools/Pology). See first the general
stuff about sieving:

http://nedohodnik.dyndns.org/pology-doc/pology.scripts.posieve-module.html

and then about find-messages sieve:

http://nedohodnik.dyndns.org/pology-doc/pology.sieve.find_messages-module.html

For example, to look for all UI messages in my language KDE POs containing
the word "driver" in original, but not the word "drajver" in translation,
and taking accelerator marker into account*, I would issue:

  $ cd $KDEREPO/trunk/l10n-kde4/sr/messages
  $ posieve find-messages -saccel:\& -smsgid:'driver' -snmsgstr:'drajver' .

(tests are AND-linked, and n in nmsgstr stands for "not").

In short, find-messages should be able to do anything you want concerning
searching through PO files (for total control, check its fexpr parameter);
and if it can't do something, I'll make it do it. I only can't make it be
quick :)

(Functionality of find-messages is also easily embeddable into other sieves
as needed, by giving them the fexpr parameter. E.g. it can be given to stats
sieve, to filter the messages included into the statistics.)

[*] To avoid always having to issue the accel parameter, which also should
not apply to desktop_* POs, you can instead equip all pertinent POs with
X-Accelerator-Marker header field:

  $ posieve set-header -sfield:'X-Accelerator-Marker:&' -screate . -e '^desktop_'

where the -e option tells which files to exclude during sieving, by matching
their catalog name against the regex.

-- 
Chusslove Illich (Часлав Илић)
Serbian KDE translation team

["signature.asc" (application/pgp-signature)]

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic