From 713fdaa8b06a83f18b06811aba7b9bd7b7cbf1cb Mon Sep 17 00:00:00 2001 From: Lasse Collin Date: Mon, 20 Jan 2025 16:31:49 +0200 Subject: [PATCH] xz: Translate error messages from lzma_str_to_filters() liblzma doesn't use gettext but the messages are included in xz.pot, so xz can translate the messages. --- src/xz/coder.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/xz/coder.c b/src/xz/coder.c index c9899abb..c28f874a 100644 --- a/src/xz/coder.c +++ b/src/xz/coder.c @@ -168,16 +168,13 @@ str_to_filters(const char *str, uint32_t index, uint32_t flags) if (index > 0) filter_num[0] = '0' + index; - // FIXME? The message in err isn't translated. - // Including the translations in the xz translations is - // slightly ugly but possible. Creating a new domain for - // liblzma might not be worth it especially since on some - // OSes it adds extra dependencies to translation libraries. + // liblzma doesn't translate the error messages but + // the messages are included in xz's translations. message(V_ERROR, _("Error in --filters%s=FILTERS option:"), filter_num); message(V_ERROR, "%s", str); message(V_ERROR, "%*s^", error_pos, ""); - message_fatal("%s", err); + message_fatal("%s", _(err)); } }