summaryrefslogtreecommitdiff
path: root/utilities/perl/localecap.pl
diff options
context:
space:
mode:
Diffstat (limited to 'utilities/perl/localecap.pl')
-rwxr-xr-xutilities/perl/localecap.pl23
1 files changed, 23 insertions, 0 deletions
diff --git a/utilities/perl/localecap.pl b/utilities/perl/localecap.pl
new file mode 100755
index 0000000..f5d846e
--- /dev/null
+++ b/utilities/perl/localecap.pl
@@ -0,0 +1,23 @@
+#!/usr/bin/perl
+
+# This tool is only for locales in Latin-1, not UTF-8 (should such locales be supported at a later date)
+
+use locale;
+
+$abbrevs = 0;
+
+open (INPUT, "$ARGV[0]") or print "Give the locale file as an argument.\n";
+@loc = <INPUT>;
+close (INPUT);
+open (OUTPUT, ">$ARGV[0]");
+foreach $line (@loc) {
+
+ if ($line =~ /\[Book Abbrevs\]/) {
+ $abbrevs = 1;
+ }
+ elsif ($abbrevs == 1) {
+ $line = uc($line);
+ }
+ print OUTPUT $line;
+}
+close (OUTPUT);