update checkMissingTranslation.pl

This commit is contained in:
tateisu 2020-06-25 03:50:07 +09:00
parent a114315042
commit dc2476b207
1 changed files with 8 additions and 7 deletions

View File

@ -28,7 +28,7 @@ open(my $fh,"-|","git status --porcelain --branch")
my @untrackedFiles;
while(<$fh>){
chomp;
s/[\x0d\x0a]+//;
if(/^\?\?\s*(\S+)/){
my $path =$1;
next if $path =~ /\.idea|_Emoji/;
@ -36,8 +36,8 @@ while(<$fh>){
}elsif( /^##\s*(\S+?)(?:\.\.|$)/ ){
my $branch=$1;
print "# branch=$branch\n";
$branch eq 'master'
or warn "!!!! current branch is not master !!!!\n";
$branch eq 'trunk'
or warn "!!!! current branch is not trunk !!!!\n";
# }else{
# warn "working tree is not clean.\n";
# cmd "git status";
@ -56,7 +56,7 @@ close($fh)
my $xml = XML::Simple->new;
my $master_name = "_master";
my $default_name = "_default";
my @files;
@ -73,7 +73,7 @@ for my $file(@files){
if( $file =~ m|values-([^/]+)| ){
$lang = $1;
}else{
$lang=$master_name;
$lang=$default_name;
}
my $data = $xml->XMLin($file);
if( not $data->{string} or ($data->{string}{content} and not ref $data->{string}{content} )){
@ -94,7 +94,7 @@ for my $file(@files){
my $hasError = 0;
my $master = $langs{ $master_name };
my $master = $langs{ $default_name };
$master or die "missing master languages.\n";
my %params;
while(my($name,$value)=each %$master){
@ -147,8 +147,9 @@ $hasError and die "please fix error(s).\n";
# Weblateの未マージのブランチがあるか調べる
system qq(git fetch weblate -q);
my @list = `git branch -a --no-merged`;
my @list = `git branch --no-merged`;
for(@list){
s/[\x0d\x0a]+//;
print "# Unmerged branch: $_\n";
}