aboutsummaryrefslogtreecommitdiffstats
path: root/l10n
diff options
context:
space:
mode:
authorThomas Müller <thomas.mueller@tmit.eu>2014-10-17 14:17:39 +0200
committerThomas Müller <thomas.mueller@tmit.eu>2014-10-29 10:09:12 +0100
commitf67123c5a498e45a08900987b10779c7c60af601 (patch)
tree212a089a0690daf146d842af3e8eb5d984cb8e1a /l10n
parentcb944814d9be6e7b7bcff6e41e25a34ecc36fa40 (diff)
downloadnextcloud-server-f67123c5a498e45a08900987b10779c7c60af601.tar.gz
nextcloud-server-f67123c5a498e45a08900987b10779c7c60af601.zip
l10n.pl now generates js files as well
Diffstat (limited to 'l10n')
-rwxr-xr-xl10n/init.sh5
-rw-r--r--l10n/l10n.pl10
2 files changed, 10 insertions, 5 deletions
diff --git a/l10n/init.sh b/l10n/init.sh
deleted file mode 100755
index 98195bf01bf..00000000000
--- a/l10n/init.sh
+++ /dev/null
@@ -1,5 +0,0 @@
-#!/bin/bash
-for resource in calendar contacts core files media gallery settings
-do
-tx set --auto-local -r owncloud.$resource "<lang>/$resource.po" --source-lang en --source-file templates/$resource.pot --execute
-done
diff --git a/l10n/l10n.pl b/l10n/l10n.pl
index 10df5f8f803..8b12f1abaed 100644
--- a/l10n/l10n.pl
+++ b/l10n/l10n.pl
@@ -142,6 +142,7 @@ elsif( $task eq 'write' ){
my $array = Locale::PO->load_file_asarray( $input );
# Create array
my @strings = ();
+ my @js_strings = ();
my $plurals;
foreach my $string ( @{$array} ){
@@ -160,11 +161,13 @@ elsif( $task eq 'write' ){
}
push( @strings, "\"$identifier\" => array(".join(",", @variants).")");
+ push( @js_strings, "\"$identifier\" : [".join(",", @variants)."]");
}
else{
# singular translations
next if $string->msgstr() eq '""';
push( @strings, $string->msgid()." => ".$string->msgstr());
+ push( @js_strings, $string->msgid()." : ".$string->msgstr());
}
}
next if $#strings == -1; # Skip empty files
@@ -179,6 +182,13 @@ elsif( $task eq 'write' ){
print OUT join( ",\n", @strings );
print OUT "\n);\n\$PLURAL_FORMS = \"$plurals\";\n";
close( OUT );
+
+ open( OUT, ">$language.js" );
+ print OUT "OC.L10N.register(\n \"$app\",\n {\n ";
+ print OUT join( ",\n ", @js_strings );
+ print OUT "\n},\n\"$plurals\");\n";
+ close( OUT );
+
}
chdir( $whereami );
}