From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id CEF4215834D for ; Thu, 27 Jun 2024 19:19:22 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 0CE78E2B65; Thu, 27 Jun 2024 19:19:22 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id E16C4E2B65 for ; Thu, 27 Jun 2024 19:19:21 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id E57A533BE32 for ; Thu, 27 Jun 2024 19:19:20 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 7E7E61D0D for ; Thu, 27 Jun 2024 19:19:19 +0000 (UTC) From: "Fabian Groffen" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Fabian Groffen" Message-ID: <1719515843.092dbac3c93d4a5f6fc2e5d496e17a0405c950a7.grobian@gentoo> Subject: [gentoo-commits] proj/portage-utils:master commit in: libq/, / X-VCS-Repository: proj/portage-utils X-VCS-Files: libq/i18n.h main.c main.h qcheck.c X-VCS-Directories: libq/ / X-VCS-Committer: grobian X-VCS-Committer-Name: Fabian Groffen X-VCS-Revision: 092dbac3c93d4a5f6fc2e5d496e17a0405c950a7 X-VCS-Branch: master Date: Thu, 27 Jun 2024 19:19:19 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: afd2d35a-11d5-4296-bc97-5fa458dff04c X-Archives-Hash: 8dd4952bb78cc807cfb96b9bac23a860 commit: 092dbac3c93d4a5f6fc2e5d496e17a0405c950a7 Author: Fabian Groffen gentoo org> AuthorDate: Thu Jun 27 19:17:23 2024 +0000 Commit: Fabian Groffen gentoo org> CommitDate: Thu Jun 27 19:17:23 2024 +0000 URL: https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=092dbac3 *: remove i18n/gettext support This looked very rudimentary, and half, there were no translations, and not all strings were covered. It was never enabled, so dummy for many releases. Signed-off-by: Fabian Groffen gentoo.org> libq/i18n.h | 17 ----------------- main.c | 14 +++++--------- main.h | 9 ++++----- qcheck.c | 2 +- 4 files changed, 10 insertions(+), 32 deletions(-) diff --git a/libq/i18n.h b/libq/i18n.h deleted file mode 100644 index 50f36ea..0000000 --- a/libq/i18n.h +++ /dev/null @@ -1,17 +0,0 @@ -#ifndef _I18N_H -#define _I18N_H - -#if ENABLE_NLS -# include -# include -# define _(String) gettext (String) -# define decimal_point localeconv()->decimal_point -#else -# define _(String) (String) -# define setlocale(x,y) -# define bindtextdomain(x,y) -# define textdomain(x) -# define decimal_point "." -#endif - -#endif diff --git a/main.c b/main.c index 7225eed..5d7c97d 100644 --- a/main.c +++ b/main.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2023 Gentoo Foundation + * Copyright 2005-2024 Gentoo Foundation * Distributed under the terms of the GNU General Public License v2 * * Copyright 2005-2008 Ned Ludd - @@ -106,13 +106,13 @@ usage(int status, const char *flags, struct option const opts[], fprintf(fp, " %s%9s%s %s%-16s%s%s:%s %s\n", YELLOW, applets[i].name, NORM, DKBLUE, applets[i].opts, NORM, - RED, NORM, _(applets[i].desc)); + RED, NORM, applets[i].desc); } else if (blabber > 0) { fprintf(fp, "%susage:%s %s%s%s [opts] %s%s%s %s:%s %s\n", GREEN, NORM, YELLOW, applets[blabber].name, NORM, DKBLUE, applets[blabber].opts, NORM, - RED, NORM, _(applets[blabber].desc)); + RED, NORM, applets[blabber].desc); if (desc) fprintf(fp, "\n%s\n", desc); } @@ -154,10 +154,10 @@ usage(int status, const char *flags, struct option const opts[], /* then wrap the help text, if necessary */ prefixlen = 6 + 2 + optlen + 1 + 1 + 1; if ((size_t)twidth < prefixlen + 10) { - fprintf(fp, "%s\n", _(help[i])); + fprintf(fp, "%s\n", help[i]); } else { const char *t; - hstr = _(help[i]); + hstr = help[i]; l = strlen(hstr); while (twidth - prefixlen < l) { /* search backwards for a space */ @@ -1240,10 +1240,6 @@ int main(int argc, char **argv) IF_DEBUG(init_coredumps()); argv0 = argv[0]; - setlocale(LC_ALL, ""); - bindtextdomain(argv0, CONFIG_EPREFIX "usr/share/locale"); - textdomain(argv0); - /* note: setting nocolor here is pointless, since * initialize_portage_env is going to re-init nocolor, so make * sure we modify the default instead. */ diff --git a/main.h b/main.h index a1b2afc..c3139b0 100644 --- a/main.h +++ b/main.h @@ -1,5 +1,5 @@ /* - * Copyright 2005-2021 Gentoo Foundation + * Copyright 2005-2024 Gentoo Foundation * Distributed under the terms of the GNU General Public License v2 * * Copyright 2005-2010 Ned Ludd - @@ -23,7 +23,6 @@ #include #include "colors.h" -#include "i18n.h" #include "set.h" extern const char *argv0; @@ -87,8 +86,8 @@ extern const char *argv0; #define likely(x) __builtin_expect((x), 1) #define unlikely(x) __builtin_expect((x), 0) -#define qfprintf(stream, fmt, args...) do { if (!quiet) fprintf(stream, _( fmt ), ## args); } while (0) -#define qprintf(fmt, args...) qfprintf(stdout, _( fmt ), ## args) +#define qfprintf(stream, fmt, args...) do { if (!quiet) fprintf(stream, fmt, ## args); } while (0) +#define qprintf(fmt, args...) qfprintf(stdout, fmt, ## args) #define _q_unused_ __attribute__((__unused__)) @@ -125,7 +124,7 @@ extern FILE *warnout; #define warn(fmt, args...) #else #define warn(fmt, args...) \ - fprintf(warnout, _("%s%s%s: " fmt "\n"), RED, argv0, NORM , ## args) + fprintf(warnout, "%s%s%s: " fmt "\n", RED, argv0, NORM , ## args) #endif #define warnf(fmt, args...) warn("%s%s()%s: " fmt, YELLOW, __func__, NORM , ## args) #define warnl(fmt, args...) warn("%s%i()%s: " fmt, YELLOW, __LINE__, NORM , ## args) diff --git a/qcheck.c b/qcheck.c index 7c1fd0e..b6d5671 100644 --- a/qcheck.c +++ b/qcheck.c @@ -55,7 +55,7 @@ static const char * const qcheck_opts_help[] = { }; #define qcheck_usage(ret) usage(ret, QCHECK_FLAGS, qcheck_long_opts, qcheck_opts_help, NULL, lookup_applet_idx("qcheck")) -#define qcprintf(fmt, args...) do { if (!state->bad_only) printf(_(fmt), ## args); } while (0) +#define qcprintf(fmt, args...) do { if (!state->bad_only) printf(fmt, ## args); } while (0) struct qcheck_opt_state { array_t *atoms;