diff options
Diffstat (limited to 'qarepo')
-rw-r--r-- | qarepo | 32 |
1 files changed, 21 insertions, 11 deletions
@@ -466,7 +466,8 @@ sub disable_repo { if (system("$pkexec /usr/libexec/qarepo-helper disable $arch_type") == 0) { $active_qa_repo = ''; } else { - my $message = N("couldn't disable the local repository ['") . $qa_repo_name . "']"; + # PO: preserve %s - it is replaced by the name of the repository + my $message = sprintf(N("couldn't disable the '%s' local repository"), $qa_repo_name); show_error_dialogue($message, $fatal_message); print_error($message, 'fatal'); } @@ -477,7 +478,8 @@ sub enable_repo { if (system("$pkexec /usr/libexec/qarepo-helper enable $arch_type $qa_repo/$arch") == 0) { $active_qa_repo = $qa_repo; } else { - my $message = N("couldn't enable the local repository ['") . $qa_repo_name . "']"; + # PO: preserve %s - it is replaced by the name of the repository + my $message = sprintf(N("couldn't enable the '%s' local repository"), $qa_repo_name); show_error_dialogue($message); print_error($message); $active_qa_repo = ''; @@ -487,7 +489,8 @@ sub enable_repo { sub update_repo { my $arch_type = $arch eq 'x86_64' ? '64' : '32'; if (system("$pkexec /usr/libexec/qarepo-helper update $arch_type") != 0) { - my $message = N("couldn't update the local repository ['") . $qa_repo_name . "']"; + # PO: preserve %s - it is replaced by the name of the repository + my $message = sprintf(N("couldn't update the '%s' local repository"), $qa_repo_name); show_error_dialogue($message); print_error($message); disable_repo(); @@ -569,7 +572,8 @@ sub sync_repo { }); if (!unlink("$download_dir/$synthesis")) { - my $message = N("couldn't delete the downloaded synthesis file [") . $download_dir . '/' . $synthesis . "]"; + # PO: preserve %s - it is replaced by the name of the file + my $message = sprintf(N("couldn't delete the downloaded synthesis file '%s'"), $download_dir . '/' . $synthesis); show_error_dialogue($message, $fatal_message); print_error($message, 'fatal'); } @@ -589,7 +593,8 @@ sub sync_repo { $matched = 1; } } - $matched or sync_error($request . N(" was not found in the remote repository")); + # PO: preserve %s - it is replaced by the name of a package + $matched or sync_error(sprintf(N("'%s' was not found in the remote repository"), $request)); } # avoid infinite loop if we haven't found a match last if @sync_errors; @@ -656,14 +661,17 @@ sub sync_repo { sub sync_file_rsync { my ($src_url, $dst_dir) = @_; - print N("fetching ") . $src_url . "\n"; + # PO: preserve %s - it is replaced by the URL of the file being downloaded + print sprintf(N("fetching %s"), $src_url), "\n"; system("rsync -q $src_url $dst_dir") == 0 - or sync_error(N("failed to download file [") . $src_url . "]"); + # PO: preserve %s - it is replaced by the URL of the file + or sync_error(sprintf(N("failed to download file '%s'"), $src_url)); } sub sync_file_aria2 { my ($src_url, $dst_dir) = @_; - print N("fetching ") . $src_url . "\n"; + # PO: preserve %s - it is replaced by the URL of the file being downloaded + print sprintf(N("fetching %s"), $src_url), "\n"; system("aria2c -q -d $dst_dir $src_url") == 0 and return 1; @@ -671,13 +679,15 @@ sub sync_file_aria2 { my $dst_file = $dst_dir . '/' . basename($src_url); unlink($dst_file) if -e $dst_file; - sync_error(N("failed to download file [") . $src_url . "]"); + # PO: preserve %s - it is replaced by the URL of the file + sync_error(sprintf(N("failed to download file '%s'"), $src_url)); } sub sync_file_link { my ($src_file, $dst_dir) = @_; -e $src_file && symlink($src_file, $dst_dir . '/' . basename($src_file)) - or sync_error(N("failed to link to file [") . $src_file . "]"); + # PO: preserve %s - it is replaced by the URL of the file + or sync_error(sprintf(N("failed to link to file '%s'"), $src_file)); } sub sync_error { @@ -749,7 +759,7 @@ sub show_error_dialogue { sub print_error { my ($message, $o_fatal) = @_; - print N("ERROR: ") . $message . ".\n"; + print N("ERROR:"), " ", $message, ".\n"; $fatal_error = $o_fatal; } |