xz: Make "%s: %s" translatable because French needs "%s : %s".

This commit is contained in:
Lasse Collin 2023-07-18 14:35:33 +03:00
parent b406828a6d
commit 97851be2c6
4 changed files with 18 additions and 14 deletions

View File

@ -527,7 +527,10 @@ parse_real(args_info *args, int argc, char **argv)
args->files_file = fopen(optarg, args->files_file = fopen(optarg,
c == OPT_FILES ? "r" : "rb"); c == OPT_FILES ? "r" : "rb");
if (args->files_file == NULL) if (args->files_file == NULL)
message_fatal("%s: %s", optarg, // TRANSLATORS: This is a translatable
// string because French needs a space
// before the colon ("%s : %s").
message_fatal(_("%s: %s"), optarg,
strerror(errno)); strerror(errno));
} }

View File

@ -688,7 +688,7 @@ coder_init(file_pair *pair)
strm.avail_out = 0; strm.avail_out = 0;
while ((ret = lzma_code(&strm, LZMA_RUN)) while ((ret = lzma_code(&strm, LZMA_RUN))
== LZMA_UNSUPPORTED_CHECK) == LZMA_UNSUPPORTED_CHECK)
message_warning("%s: %s", pair->src_name, message_warning(_("%s: %s"), pair->src_name,
message_strm(ret)); message_strm(ret));
// With --single-stream lzma_code won't wait for // With --single-stream lzma_code won't wait for
@ -704,7 +704,7 @@ coder_init(file_pair *pair)
} }
if (ret != LZMA_OK) { if (ret != LZMA_OK) {
message_error("%s: %s", pair->src_name, message_strm(ret)); message_error(_("%s: %s"), pair->src_name, message_strm(ret));
if (ret == LZMA_MEMLIMIT_ERROR) if (ret == LZMA_MEMLIMIT_ERROR)
message_mem_needed(V_ERROR, lzma_memusage(&strm)); message_mem_needed(V_ERROR, lzma_memusage(&strm));
@ -964,10 +964,10 @@ coder_normal(file_pair *pair)
// wrong and we print an error. Otherwise it's just // wrong and we print an error. Otherwise it's just
// a warning and coding can continue. // a warning and coding can continue.
if (stop) { if (stop) {
message_error("%s: %s", pair->src_name, message_error(_("%s: %s"), pair->src_name,
message_strm(ret)); message_strm(ret));
} else { } else {
message_warning("%s: %s", pair->src_name, message_warning(_("%s: %s"), pair->src_name,
message_strm(ret)); message_strm(ret));
// When compressing, all possible errors set // When compressing, all possible errors set

View File

@ -602,7 +602,7 @@ io_open_src_real(file_pair *pair)
if (!follow_symlinks) { if (!follow_symlinks) {
struct stat st; struct stat st;
if (lstat(pair->src_name, &st)) { if (lstat(pair->src_name, &st)) {
message_error("%s: %s", pair->src_name, message_error(_("%s: %s"), pair->src_name,
strerror(errno)); strerror(errno));
return true; return true;
@ -676,7 +676,7 @@ io_open_src_real(file_pair *pair)
// Something else than O_NOFOLLOW failing // Something else than O_NOFOLLOW failing
// (assuming that the race conditions didn't // (assuming that the race conditions didn't
// confuse us). // confuse us).
message_error("%s: %s", pair->src_name, message_error(_("%s: %s"), pair->src_name,
strerror(errno)); strerror(errno));
return true; return true;
@ -766,7 +766,7 @@ io_open_src_real(file_pair *pair)
return false; return false;
error_msg: error_msg:
message_error("%s: %s", pair->src_name, strerror(errno)); message_error(_("%s: %s"), pair->src_name, strerror(errno));
error: error:
(void)close(pair->src_fd); (void)close(pair->src_fd);
return true; return true;
@ -937,7 +937,7 @@ io_open_dest_real(file_pair *pair)
pair->dest_fd = open(pair->dest_name, flags, mode); pair->dest_fd = open(pair->dest_name, flags, mode);
if (pair->dest_fd == -1) { if (pair->dest_fd == -1) {
message_error("%s: %s", pair->dest_name, message_error(_("%s: %s"), pair->dest_name,
strerror(errno)); strerror(errno));
free(pair->dest_name); free(pair->dest_name);
return true; return true;

View File

@ -366,7 +366,7 @@ parse_indexes(xz_file_info *xfi, file_pair *pair)
hardware_memlimit_get(MODE_LIST), hardware_memlimit_get(MODE_LIST),
(uint64_t)(pair->src_st.st_size)); (uint64_t)(pair->src_st.st_size));
if (ret != LZMA_OK) { if (ret != LZMA_OK) {
message_error("%s: %s", pair->src_name, message_strm(ret)); message_error(_("%s: %s"), pair->src_name, message_strm(ret));
return true; return true;
} }
@ -412,7 +412,7 @@ parse_indexes(xz_file_info *xfi, file_pair *pair)
} }
default: default:
message_error("%s: %s", pair->src_name, message_error(_("%s: %s"), pair->src_name,
message_strm(ret)); message_strm(ret));
// If the error was too low memory usage limit, // If the error was too low memory usage limit,
@ -474,7 +474,7 @@ parse_block_header(file_pair *pair, const lzma_index_iter *iter,
break; break;
case LZMA_OPTIONS_ERROR: case LZMA_OPTIONS_ERROR:
message_error("%s: %s", pair->src_name, message_error(_("%s: %s"), pair->src_name,
message_strm(LZMA_OPTIONS_ERROR)); message_strm(LZMA_OPTIONS_ERROR));
return true; return true;
@ -578,7 +578,8 @@ parse_block_header(file_pair *pair, const lzma_index_iter *iter,
// Check if the stringification succeeded. // Check if the stringification succeeded.
if (str_ret != LZMA_OK) { if (str_ret != LZMA_OK) {
message_error("%s: %s", pair->src_name, message_strm(str_ret)); message_error(_("%s: %s"), pair->src_name,
message_strm(str_ret));
return true; return true;
} }
@ -586,7 +587,7 @@ parse_block_header(file_pair *pair, const lzma_index_iter *iter,
data_error: data_error:
// Show the error message. // Show the error message.
message_error("%s: %s", pair->src_name, message_error(_("%s: %s"), pair->src_name,
message_strm(LZMA_DATA_ERROR)); message_strm(LZMA_DATA_ERROR));
return true; return true;
} }