From ce4a32fe52ef09d8f5ff1dd22c001110902b60a2 Mon Sep 17 00:00:00 2001 From: toma Date: Wed, 25 Nov 2009 17:56:58 +0000 Subject: Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features. BUG:215923 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdelibs@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- kabc/scripts/createisomap.pl | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100755 kabc/scripts/createisomap.pl (limited to 'kabc/scripts/createisomap.pl') diff --git a/kabc/scripts/createisomap.pl b/kabc/scripts/createisomap.pl new file mode 100755 index 000000000..2734db111 --- /dev/null +++ b/kabc/scripts/createisomap.pl @@ -0,0 +1,35 @@ +#!/usr/bin/perl +# +# Create a translation table countryname->iso-code from the entry.desktop +# files in kdebase/l10n/*/ +# +# USAGE EXAMPLE: +# ./createisomap.pl $KDEDIR/share/locale/l10n > countrytransl.map +# +# Don't laugh at me. I put this together with an old perl book, perl +# being a language I've never used before. + +@entries = <$ARGV[0]/*/entry.desktop>; +chomp @entries; +foreach $entry (@entries) { + local ( $entryiso, @entryfile, @mappings ); + # print "--> $entry\n"; + $entryiso = $entry; + $entryiso =~ s/$ARGV[0]\///; + $entryiso =~ s/\/entry\.desktop//; + # print " $entryiso\n"; + open (IN, $entry); + @entryfile = ; + close IN; + chomp @entryfile; + foreach $entryfileline (@entryfile) { + if ( $entryfileline =~ /^Name.*=(.*)$/ ) { + # push (@mappings, $1 . "\t" . $entryiso ); + print "$1\t$entryiso\n"; + } + } +} + +# add some convenience entries which aren't part of the entry.desktop files + +print "Czech Republic\tcz\n"; -- cgit v1.2.1