Hi,
I don't think you should use a grep on [trans] and [list local] and [list
global]... who knows, maybe someone once coded a [::trans ..] or maybe
someone had a [trans $sentence] with an if before to know whether to show
this or this sentence...
I suggest you just grep the key, no whatever where it appears (if we have
a proc or variable that has the same name, then too bad, life isn't
perfect after all)..
you might want to check that there is no '#' on the same line (before) as
the key, but it shouldn't be a -color "#00000" -label [trans key]
so, maybe using a regexp, you could do a :
(?m)$key(?<(!\;\s*\#|^\#).*$key)
Hoping that egrep accept non-width defined negative look-behind.
If it doesn't, I can give you another regexp that would do it, but maybe
tonight only, I have to work now...
also, a suggestion is, like I said "check them manually"... do a grep for
each key and output it to a file, then open the file and check manually
each grep result, it's easier to identify this way, which ones are valid
and which ones aren't.
if you have a
bash $ grep blabla
bash $ grep test
gui.tcl: # button -label [trans test]
protocol.tcl: label -text [trans test2]
bash $ grep test2
protocol.tcl: label -text [trans test2]
bash $ ...
you know that "blabla" doesn't exist, that tes doesn't exist either
(because it's commented, and there's a match for test2) and that test2 is
valid...
that's something a regexp can do, (with \b escape for word boundaries) but
it's a one time only thing, so why waste time on a regexp if you can do it
manually in less time than engineering the regular expression ?
make sure you don't remove any necessary key, we might need some, and we
don't want to break anything... it's best to have too much keys that not
enough, don't forget that!
Thanks,
KaKaRoTo
On Wed, 07 Dec 2005 08:42:35 -0500, Lz <[EMAIL PROTECTED]> wrote:
check if it's right (if not, you could just choose from this list the
ones that aren't right :P):
#Run inside msn/:
#0: we get rid of older searchs
rm zzzz*
#First: we get all the disctinct keys on the file zzzzuniquekeys (from
all files, because maybe there are old keys in some languages, and not
in english)
cat `ls lang/lang* | grep -v "\."` | tr '\t' ' ' | cut -f 1 -d ' ' |
sort | uniq > zzzzuniquekeys
#Second: we get every used key on the file zzzzusedkeys
grep -re "\[trans\ *" *tcl */*tcl */*/*tcl */*/*/*tcl */*/*/*/*tcl
*/*/*/*/*/*tcl */*/*/*/*/*/*tcl >& zzzzusedkeys1
grep -re "\[list\ local\ *" *tcl */*tcl */*/*tcl */*/*/*tcl
*/*/*/*/*tcl */*/*/*/*/*tcl */*/*/*/*/*/*tcl >& zzzzusedkeys2
grep -re "\[list\ global\ *" *tcl */*tcl */*/*tcl */*/*/*tcl
*/*/*/*/*tcl */*/*/*/*/*tcl */*/*/*/*/*/*tcl >& zzzzusedkeys3
cat zzzzusedkeys? > zzzzusedkeys
#Third: we check every key, those not appearing in the way: [trans
KEYNAME* will be written to zzzznonusedkeys
echo > zzzznonusedkeys1;for x in `cat zzzzuniquekeys`;do grep -e
"\[trans\ $x" zzzzusedkeys > /dev/null || echo $x >>
zzzznonusedkeys1;done
echo > zzzznonusedkeys2;for x in `cat zzzznonusedkeys1`;do grep -e
"\[list\ local" zzzzusedkeys | grep -e $x > /dev/null || echo $x >>
zzzznonusedkeys2;done
echo > zzzznonusedkeys;for x in `cat zzzznonusedkeys2`;do grep -e
"\[list\ global" zzzzusedkeys | grep -e $x > /dev/null || echo $x >>
zzzznonusedkeys;done
cat zzzznonusedkeys
RESULT:
acceptfile
amsn_lang_version
animatedemoticon
askprofile
autohotmaillog
autoidle
awaymsg1
awaymsg2
blankdirect
blocking
blockmessage
cantremoveothers
changecustomstate
changedateformat
chatack
choosefontcolor
convertexplain
cprofile
dcprofile
disabled
displaychat
editvalue
enabled
enableproxy
extras
globalcontainer
groupoldname
handle
hiden
installconvert
ipdetect
leaveblankforhotmail
maximised
mynick
natip
nodataavailable
noneavailable
notifyoffset
nousersinsession
playing
preflibs
prefproxy
prefshared
prefsound
proxyconf
proxyconfhttp
selectplugins
soundcommand
splashstart
startoffline
startoffline2
totalsize
wintitlenick
xmmscurrent
xmmserr
xmmssend
yousay
--
Lz ([EMAIL PROTECTED]).
http://elezeta.bounceme.net
-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log
files
for problems? Stop! Download the new AJAX search engine that makes
searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_idv37&alloc_id865&op=click
_______________________________________________
Amsn-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/amsn-devel
--
KaKaRoTo
-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems? Stop! Download the new AJAX search engine that makes
searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
_______________________________________________
Amsn-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/amsn-devel