Skip to content

Commit d1618f1

Browse files
committed
Read translations from .vue files too
Signed-off-by: Joas Schilling <coding@schilljs.com>
1 parent 1d8b90b commit d1618f1

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

l10n/l10n.pl

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,13 @@ sub crawlFiles{
3939
foreach my $i ( @files ){
4040
next if substr( $i, 0, 1 ) eq '.';
4141
next if $i eq 'l10n';
42+
next if $i eq 'node_modules';
4243

4344
if( -d $dir.'/'.$i ){
4445
push( @found, crawlFiles( $dir.'/'.$i ));
4546
}
4647
else{
47-
push(@found,$dir.'/'.$i) if $i =~ /.*(?<!\.min)\.js$/ || $i =~ /\.php$/;
48+
push(@found,$dir.'/'.$i) if $i =~ /.*(?<!\.min)\.js$/ || $i =~ /\.vue$/ || $i =~ /\.php$/;
4849
}
4950
}
5051

@@ -130,13 +131,13 @@ ()
130131
foreach my $file ( @totranslate ){
131132
next if $ignore{$file};
132133
my $keywords = '';
133-
if( $file =~ /\.js$/ ){
134+
if( $file =~ /\.js$/ || $file =~ /\.vue$/ ){
134135
$keywords = '--keyword=t:2 --keyword=n:2,3';
135136
}
136137
else{
137138
$keywords = '--keyword=t --keyword=n:1,2';
138139
}
139-
my $language = ( $file =~ /\.js$/ ? 'Javascript' : 'PHP');
140+
my $language = ( $file =~ /\.js$/ || $file =~ /\.vue$/ ? 'Javascript' : 'PHP');
140141
my $joinexisting = ( -e $output ? '--join-existing' : '');
141142
print " Reading $file\n";
142143
`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"`;

0 commit comments

Comments
 (0)