aboutsummaryrefslogtreecommitdiffstats
path: root/po/desk.pl
diff options
context:
space:
mode:
authorKenneth Christiansen <kenneth@gnu.org>2000-06-06 04:04:27 +0800
committerKenneth Christiansen <kenneth@src.gnome.org>2000-06-06 04:04:27 +0800
commitd5404ffe578668a72154e513ffae33758437d77a (patch)
treeea3b909c94dd8a858095be8124e00c7d1838ca9e /po/desk.pl
parentd847c51de4d285dffa9ccdf83320576e23d23047 (diff)
downloadgsoc2013-evolution-d5404ffe578668a72154e513ffae33758437d77a.tar
gsoc2013-evolution-d5404ffe578668a72154e513ffae33758437d77a.tar.gz
gsoc2013-evolution-d5404ffe578668a72154e513ffae33758437d77a.tar.bz2
gsoc2013-evolution-d5404ffe578668a72154e513ffae33758437d77a.tar.lz
gsoc2013-evolution-d5404ffe578668a72154e513ffae33758437d77a.tar.xz
gsoc2013-evolution-d5404ffe578668a72154e513ffae33758437d77a.tar.zst
gsoc2013-evolution-d5404ffe578668a72154e513ffae33758437d77a.zip
Added readme file, which explains the use of the newly checked in po
2000-06-05 Kenneth Christiansen <kenneth@gnu.org> * README.tools: Added readme file, which explains the use of the newly checked in po tools. hmm, looking forward to tomorrow...viva los compleaƱos! :) svn path=/trunk/; revision=3428
Diffstat (limited to 'po/desk.pl')
-rwxr-xr-xpo/desk.pl118
1 files changed, 118 insertions, 0 deletions
diff --git a/po/desk.pl b/po/desk.pl
new file mode 100755
index 0000000000..08a2a18a56
--- /dev/null
+++ b/po/desk.pl
@@ -0,0 +1,118 @@
+#!/usr/bin/perl -w
+
+# GNOME entry finder utility.
+# (C) 2000 The Free Software Foundation
+#
+# Author(s): Kenneth Christiansen
+
+
+$VERSION = "1.0.0 beta 5";
+$LANG = $ARGV[0];
+$OPTION2 = $ARGV[1];
+$SEARCH = "Name";
+
+if (! $LANG){
+ print "desk.pl: missing file arguments\n";
+ print "Try `desk.pl --help' for more information.\n";
+ exit;
+}
+
+if ($OPTION2){
+ $SEARCH=$OPTION2;
+}
+
+if ($LANG){
+
+if ($LANG=~/^-(.)*/){
+
+ if ("$LANG" eq "--version" || "$LANG" eq "-V"){
+ print "GNOME Entry finder $VERSION\n";
+ print "Written by Kenneth Christiansen <kenneth\@gnome.org>, 2000.\n\n";
+ print "Copyright (C) 2000 Free Software Foundation, Inc.\n";
+ print "This is free software; see the source for copying conditions. There is NO\n";
+ print "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n";
+ exit;
+ }
+
+ elsif ($LANG eq "--help" || "$LANG" eq "-H"){
+ print "Usage: ./desk.pl [OPTIONS] ...LANGCODE ENTRY\n";
+ print "Checks .desktop and alike files for missing translations.\n\n";
+ print " -V, --version shows the version\n";
+ print " -H, --help shows this help page\n";
+ print "\nReport bugs to <kenneth\@gnome.org>.\n";
+ exit;
+ }
+
+ else{
+ print "desk.pl: invalid option -- $LANG\n";
+ print "Try `desk.pl --help' for more information.\n";
+ exit;
+ }
+}
+
+else{
+
+ $a="find ../ -print | egrep '.*\\.(desktop|soundlist"
+ ."|directory)' ";
+
+ $b="find ../ -print | egrep '.*\\.(desktop|soundlist"
+ ."|directory)' ";
+
+ print "Searching for missing $SEARCH\[$LANG\] entries...\n";
+
+ open(BUF1, "$a|");
+ open(BUF2, "$b|");
+
+ @buf1 = <BUF1>;
+ foreach my $file (@buf1){
+ open FILE, "<$file";
+ while (<FILE>) {
+ if ($_=~/$SEARCH\[$LANG\]\=/o){
+ $file = unpack("x2 A*",$file) . "\n";
+ push @buff1, $file;
+ last;
+ }
+ }
+ }
+
+ @buf2 = <BUF2>;
+ foreach my $file (@buf2){
+ open FILE, "<$file";
+ while (<FILE>) {
+ if ($_=~/$SEARCH\=/o){
+ $file = unpack("x2 A*",$file) . "\n";
+ push @buff2, $file;
+ last;
+ }
+ }
+ }
+
+ @bufff1 = sort (@buff1);
+ @bufff2 = sort (@buff2);
+
+ my %in2;
+ foreach (@bufff1) {
+ $in2{$_} = 1;
+ }
+
+ foreach (@bufff2){
+ if (!exists($in2{$_})){
+ push @result, $_ }
+ }
+ }
+
+ open(OUT1, ">MISSING.$LANG.$SEARCH");
+ print OUT1 @result ;
+ close OUT1;
+
+
+ stat("MISSING.$LANG.$SEARCH");
+ print "\nWell, you need to fix these:\n\n" if -s _;
+ print @result if -s _;
+ print "\nThe list is saved in MISSING.$LANG.$SEARCH\n" if -s _;
+ print "\nWell, it's all perfect! Congratulation!\n" if -z _;
+ unlink "MISSING.$LANG.$SEARCH" if -z _;
+ exit;
+}
+
+