aboutsummaryrefslogtreecommitdiffstats
path: root/docs
diff options
context:
space:
mode:
authorJakob Sack <kde@jakobsack.de>2011-06-19 18:53:02 +0200
committerJakob Sack <kde@jakobsack.de>2011-06-19 18:53:02 +0200
commite8e483d07943e7c4874ee6147e3910ee868ed14d (patch)
tree89882cd925556fb09629dbab5818ca978dbfee60 /docs
parentabac11d8c42fdc3e93bbfc65d8e30474d3bb876a (diff)
downloadnextcloud-server-e8e483d07943e7c4874ee6147e3910ee868ed14d.tar.gz
nextcloud-server-e8e483d07943e7c4874ee6147e3910ee868ed14d.zip
L10N is here ;-)
Diffstat (limited to 'docs')
-rw-r--r--docs/createtranslation.pl28
1 files changed, 28 insertions, 0 deletions
diff --git a/docs/createtranslation.pl b/docs/createtranslation.pl
new file mode 100644
index 00000000000..4c1c7c38d73
--- /dev/null
+++ b/docs/createtranslation.pl
@@ -0,0 +1,28 @@
+#!/usr/bin/perl
+use strict;
+use Locale::PO;
+use Data::Dumper;
+
+opendir( DIR, '.' );
+my @files = readdir( DIR );
+closedir( DIR );
+
+foreach my $i ( @files ){
+ next unless $i =~ m/^(.*)\.po$/;
+ my $lang = $1;
+ my $hash = Locale::PO->load_file_ashash( $i );
+
+ # Create array
+ my @strings = ();
+ foreach my $key ( keys( %{$hash} )){
+ next if $key eq '""';
+ push( @strings, $hash->{$key}->msgid()." => ".$hash->{$key}->msgstr());
+ }
+
+ # Write PHP file
+ open( OUT, ">$lang.php" );
+ print OUT "<?php \$TRANSLATIONS = array(\n";
+ print OUT join( ",\n", @strings );
+ print OUT "\n);\n";
+ close( OUT );
+} \ No newline at end of file