~ubuntu-branches/debian/squeeze/sword/squeeze

« back to all changes in this revision

Viewing changes to utilities/perl/localecap.pl

  • Committer: Bazaar Package Importer
  • Author(s): Daniel Glassey
  • Date: 2004-01-15 15:50:07 UTC
  • Revision ID: james.westby@ubuntu.com-20040115155007-n9mz4x0zxrs1isd3
Tags: upstream-1.5.7
ImportĀ upstreamĀ versionĀ 1.5.7

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/usr/bin/perl
 
2
 
 
3
# This tool is only for locales in Latin-1, not UTF-8 (should such locales be supported at a later date)
 
4
 
 
5
use locale;
 
6
 
 
7
$abbrevs = 0;
 
8
 
 
9
open (INPUT, "$ARGV[0]") or print "Give the locale file as an argument.\n";
 
10
@loc = <INPUT>;
 
11
close (INPUT);
 
12
open (OUTPUT, ">$ARGV[0]");
 
13
foreach $line (@loc) {
 
14
 
 
15
    if ($line =~ /\[Book Abbrevs\]/) {
 
16
        $abbrevs = 1;
 
17
    }
 
18
    elsif ($abbrevs == 1) {
 
19
        $line = uc($line);
 
20
    }
 
21
    print OUTPUT $line;
 
22
}
 
23
close (OUTPUT);