From 6f5cdd4534faf7db4b6c123651d6a606bc59b98c Mon Sep 17 00:00:00 2001 From: Lasse Collin Date: Mon, 20 Jan 2025 16:31:49 +0200 Subject: [PATCH] xz: Unify a few strings with liblzma Avoid having both "%s: foo" and "foo" as translatable strings so that translators don't need to handle it twice. --- src/xz/options.c | 11 ++++++----- src/xz/util.c | 4 ++-- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/xz/options.c b/src/xz/options.c index af0b28c5..c4f56b49 100644 --- a/src/xz/options.c +++ b/src/xz/options.c @@ -82,9 +82,9 @@ parse_options(const char *str, const option_map *opts, *value++ = '\0'; if (value == NULL || value[0] == '\0') - message_fatal(_("%s: Options must be 'name=value' " - "pairs separated with commas"), - tuklib_mask_nonprint(str)); + message_fatal(_("%s: %s"), tuklib_mask_nonprint(str), + _("Options must be 'name=value' " + "pairs separated with commas")); // Look for the option name from the option map. unsigned i = 0; @@ -110,8 +110,9 @@ parse_options(const char *str, const option_map *opts, } if (opts[i].map[j].name == NULL) - message_fatal(_("%s: Invalid option value"), - tuklib_mask_nonprint(value)); + message_fatal(_("%s: %s"), + tuklib_mask_nonprint(value), + _("Invalid option value")); set(filter_options, i, opts[i].map[j].id, value); diff --git a/src/xz/util.c b/src/xz/util.c index 0d339aed..3af5982e 100644 --- a/src/xz/util.c +++ b/src/xz/util.c @@ -103,8 +103,8 @@ str_to_uint64(const char *name, const char *value, uint64_t min, uint64_t max) return max; if (*value < '0' || *value > '9') - message_fatal(_("%s: Value is not a non-negative " - "decimal integer"), value); + message_fatal(_("%s: %s"), value, + _("Value is not a non-negative decimal integer")); do { // Don't overflow.