Skip to content

Commit

Permalink
Substitute reserved words, which are broken for some languages
Browse files Browse the repository at this point in the history
  • Loading branch information
iliajie committed Apr 28, 2020
1 parent edf18a1 commit a81ae41
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions bin/language-manager
Original file line number Diff line number Diff line change
Expand Up @@ -815,10 +815,20 @@ s/(?|(\\\s*n\s*\\\s*n\s*\\\s*n\s*\\\s*n\s*\\\s*n)|(\\\s*n\s*\\\s*n\s*\\\s*n\s*\\
$translated =~ s/<Я>(.*?)<\/\?/<i>$1<\/i>/gi;
$translated =~ s/« <b>/«<b>/gi;
}

$translated = translated_substitute_reserved($translated);

return $translated;
}

# Fix odd conversion for some languages
sub translated_substitute_reserved
{
my ($translated) = @_;
$translated =~ s/VirtualMin/Virtualmin/g;
return $translated;
}

# Make actual translation using Google Translate API
sub translate
{
Expand Down Expand Up @@ -1023,6 +1033,7 @@ sub go
if ($data_encoding eq 'utf-8') {
$data_converted = $data_original;
}
$data_converted = translated_substitute_reserved($data_converted);
write_file_contents($help_file_write, $data_converted);
chmod(0664, $help_file_write);
$output++;
Expand Down

0 comments on commit a81ae41

Please sign in to comment.