[sword-svn] r253 - trunk/locales

chrislit at crosswire.org chrislit at crosswire.org
Sat Nov 14 16:31:16 MST 2009


Author: chrislit
Date: 2009-11-14 16:31:16 -0700 (Sat, 14 Nov 2009)
New Revision: 253

Modified:
   trunk/locales/updateFiles.pl
Log:
added sorting & some Wiki export code

Modified: trunk/locales/updateFiles.pl
===================================================================
--- trunk/locales/updateFiles.pl	2009-11-14 23:22:39 UTC (rev 252)
+++ trunk/locales/updateFiles.pl	2009-11-14 23:31:16 UTC (rev 253)
@@ -2,6 +2,8 @@
 
 #This script calls wget, unzip, cp, and mv, so you'll need to have those binaries installed.
 
+$wiki = 0;
+
 use utf8;
 
 `wget -N  http://www.iana.org/assignments/language-subtag-registry -owget.log`;
@@ -45,9 +47,27 @@
 open LOC, ">:utf8", "localized.txt";
 
 foreach $line (@content) {
-    if ($line =~ /^\|\s*([a-zA-Z\-]+)\s*\|\|\s*([^\|]+)\s+(\|\|\s*(.+))?/) {
-#	if ($4 !~ /dead/) { #turn this on to remove langs tagged as dead
-	    print LOC "$1\t$2\n";
-#	}
+    if ($line =~ /^\|\s*([a-zA-Z\-]+)\s*\|\|\s*([^\|]+)\s*(\|\|\s*(.+))?/) {
+	$line = "$1\t$2\t$4";
+	$line =~ s/\s*$//;
+	$line =~ s/\s*\t\s*/\t/g;
+	push @sortcontent, $line;
     }
 }
+
+if ($wiki == 1) {
+    open WIKI, ">:utf8", "localized.wiki";
+}
+
+ at sortcontent = sort @sortcontent;
+
+foreach $line (@sortcontent) {
+    $line =~ /^([a-zA-Z\-]+)\t([^\t]+)(\t(.+))?$/;
+#    if ($4 !~ /dead/) { #turn this on to remove langs tagged as dead
+    print LOC "$1\t$2\n"; 
+#    }
+    if ($wiki == 1) {
+	$line =~ s/\t/\t\|\|/g;
+	print WIKI "\|\-\n\|$line\n";
+    }
+}




More information about the sword-cvs mailing list