[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

SF.net SVN: ledger-smb:[3216] trunk/tools



Revision: 3216
          http://ledger-smb.svn.sourceforge.net/ledger-smb/?rev=3216&view=rev
Author:   ehuelsmann
Date:     2011-06-11 13:51:31 +0000 (Sat, 11 Jun 2011)

Log Message:
-----------
Adjust company preparation script to include the minimal required set of languages in the 'language' table to be able to execute a password reset.

Modified Paths:
--------------
    trunk/tools/prepare-company-database.sh

Added Paths:
-----------
    trunk/tools/generate-language-table-contents.pl

Added: trunk/tools/generate-language-table-contents.pl
===================================================================
--- trunk/tools/generate-language-table-contents.pl	                        (rev 0)
+++ trunk/tools/generate-language-table-contents.pl	2011-06-11 13:51:31 UTC (rev 3216)
@@ -0,0 +1,23 @@
+#!/usr/bin/perl
+
+use Locale::Country;
+use Locale::Language;
+
+# scan the locale directory and read in the LANGUAGE files
+opendir DIR, "$ARGV[0]";
+
+my @dir = grep !/^\..*$/, readdir DIR;
+
+foreach my $dir (@dir) {
+  $dir = substr( $dir, 0, -3 );
+  my $desc = code2language( substr( $dir, 0, 2 ) );
+  $desc .= ( "/" . code2country( substr( $dir, 3, 2 ) ) )
+    if length($dir) > 2;
+  $desc .= ( " " . substr( $dir, 6 ) ) if length($dir) > 5;
+  print "$dir|$desc\n";
+}
+
+closedir(DIR);
+
+
+


Property changes on: trunk/tools/generate-language-table-contents.pl
___________________________________________________________________
Added: svn:executable
   + *

Modified: trunk/tools/prepare-company-database.sh
===================================================================
--- trunk/tools/prepare-company-database.sh	2011-06-11 13:48:02 UTC (rev 3215)
+++ trunk/tools/prepare-company-database.sh	2011-06-11 13:51:31 UTC (rev 3216)
@@ -208,6 +208,12 @@
   fi
 fi
 
+cat <<EOF | $psql_cmd
+\\COPY language FROM stdin WITH DELIMITER '|'
+`$srcdir/tools/generate-language-table-contents.pl $srcdir/locale/po`
+EOF
+
+
 cat <<CREATE_USER | $psql_cmd
 SELECT admin__save_user(NULL,
                          person__save(NULL,


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.