Skip to content

Commit

Permalink
Add bytes
Browse files Browse the repository at this point in the history
  • Loading branch information
charsbar committed Apr 16, 2024
1 parent 113e3ae commit 83e205a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
3 changes: 2 additions & 1 deletion lib/MT/L10N/ja.pm
Original file line number Diff line number Diff line change
Expand Up @@ -3069,8 +3069,9 @@ use vars qw( @ISA %Lexicon );
'-- set complete ([quant,_1,file,files] in [_2] seconds)' => '-- 完了 ([_1]ファイル - [_2]秒)',
'Background Publishing Done' => 'バックグラウンドパブリッシングが完了しました',
'Background Publishing Started' => 'バックグラウンドパブリッシングを開始しました',
'bytes' => 'バイト',
'Error rebuilding file [_1]:[_2]' => '[_1]の再構築中にエラーが発生しました: [_2]',
'Published: [_1]' => '公開されたファイル: [_1]',
'Published: [_1] ([_2] bytes)' => '公開されたファイル: [_1] ([_2]バイト)',
'Published ([_1]):' => '公開されたファイル ([_1]):',

## lib/MT/Worker/Sync.pm
Expand Down
5 changes: 3 additions & 2 deletions lib/MT/Worker/Publish.pm
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ sub work {
my $start = [gettimeofday];
my $rebuilt = 0;

my $bytes = $mt->translate('bytes');
my $log_each = MT->config->LogEachFilePublishedInTheBackground;
my %published;
while ( my $job = $job_iter->() ) {
Expand Down Expand Up @@ -119,12 +120,12 @@ sub work {
$mt->log({
blog_id => $blog_id,
message => $mt->translate('Background Publishing Done'),
metadata => log_time() . ' ' . $mt->translate( 'Published: [_1]', $fi->file_path ),
metadata => log_time() . ' ' . $mt->translate( 'Published: [_1] ([_2] bytes)', $fi->file_path, (-s $fi->file_path) ),
category => "publish",
level => MT::Log::INFO(),
});
} else {
push @{ $published{$blog_id} }, sprintf '%s %s (%s)', log_time(), $fi->file_path, (-s $fi->file_path) || 0;
push @{ $published{$blog_id} }, sprintf '%s %s (%s%s)', log_time(), $fi->file_path, (-s $fi->file_path) || 0, $bytes;
}
$rebuilt++;
}
Expand Down

0 comments on commit 83e205a

Please sign in to comment.