Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions l10n/l10n.pl
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,13 @@ sub crawlFiles{
foreach my $i ( @files ){
next if substr( $i, 0, 1 ) eq '.';
next if $i eq 'l10n';
next if $i eq 'node_modules';
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I also made it skip node_modules by default...


if( -d $dir.'/'.$i ){
push( @found, crawlFiles( $dir.'/'.$i ));
}
else{
push(@found,$dir.'/'.$i) if $i =~ /.*(?<!\.min)\.js$/ || $i =~ /\.php$/;
push(@found,$dir.'/'.$i) if $i =~ /.*(?<!\.min)\.js$/ || $i =~ /\.vue$/ || $i =~ /\.php$/;
}
}

Expand Down Expand Up @@ -130,13 +131,13 @@ ()
foreach my $file ( @totranslate ){
next if $ignore{$file};
my $keywords = '';
if( $file =~ /\.js$/ ){
if( $file =~ /\.js$/ || $file =~ /\.vue$/ ){
$keywords = '--keyword=t:2 --keyword=n:2,3';
}
else{
$keywords = '--keyword=t --keyword=n:1,2';
}
my $language = ( $file =~ /\.js$/ ? 'Javascript' : 'PHP');
my $language = ( $file =~ /\.js$/ || $file =~ /\.vue$/ ? '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"`;
Expand Down