diff options
author | Thomas Müller <thomas.mueller@tmit.eu> | 2016-04-05 15:35:18 +0200 |
---|---|---|
committer | Thomas Müller <thomas.mueller@tmit.eu> | 2016-04-07 12:59:59 +0200 |
commit | f5c5f45572b389d97c0f07c867abca0f4ea28489 (patch) | |
tree | 21145e46df9378083d45022990cf41679c2c7fb3 /l10n | |
parent | 8932ec64a5d61691a506166ebbeeeb37af8b5106 (diff) | |
download | nextcloud-server-f5c5f45572b389d97c0f07c867abca0f4ea28489.tar.gz nextcloud-server-f5c5f45572b389d97c0f07c867abca0f4ea28489.zip |
Also use Javascript as language in l10n.pl - fixes #13924
Diffstat (limited to 'l10n')
-rw-r--r-- | l10n/l10n.pl | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/l10n/l10n.pl b/l10n/l10n.pl index 0ff25944d6c..3f50ec0756b 100644 --- a/l10n/l10n.pl +++ b/l10n/l10n.pl @@ -74,6 +74,23 @@ sub getPluralInfo { return $info; } +sub init() { + # let's get the version from stdout of xgettext + my $out = `xgettext --version`; + # we assume the first line looks like this 'xgettext (GNU gettext-tools) 0.19.3' + $out = substr $out, 29, index($out, "\n")-29; + $out =~ s/^\s+|\s+$//g; + $out = "v" . $out; + my $actual = version->parse($out); + # 0.18.3 introduced JavaScript as a language option + my $expected = version->parse('v0.18.3'); + if ($actual < $expected) { + die( "Minimum expected version of xgettext is " . $expected . ". Detected: " . $actual ); + } +} + +init(); + my $task = shift( @ARGV ); my $place = '..'; @@ -117,7 +134,7 @@ if( $task eq 'read' ){ else{ $keywords = '--keyword=t --keyword=n:1,2'; } - my $language = ( $file =~ /\.js$/ ? 'Python' : 'PHP'); + my $language = ( $file =~ /\.js$/ ? 'Javascript' : 'PHP'); my $joinexisting = ( -e $output ? '--join-existing' : ''); print " Reading $file\n"; `xgettext --output="$output" $joinexisting $keywords --language=$language "$file" --add-comments=TRANSLATORS --from-code=UTF-8 --package-version="8.0.0" --package-name="ownCloud Core" --msgid-bugs-address="translations\@owncloud.org"`; |