Skip to content

Commit

Permalink
*: remove i18n/gettext support
Browse files Browse the repository at this point in the history
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 <grobian@gentoo.org>
  • Loading branch information
grobian committed Jun 27, 2024
1 parent ea143f7 commit 092dbac
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 32 deletions.
17 changes: 0 additions & 17 deletions libq/i18n.h

This file was deleted.

14 changes: 5 additions & 9 deletions main.c
Original file line number Diff line number Diff line change
@@ -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 - <solar@gentoo.org>
Expand Down Expand Up @@ -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);
}
Expand Down Expand Up @@ -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 */
Expand Down Expand Up @@ -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. */
Expand Down
9 changes: 4 additions & 5 deletions main.h
Original file line number Diff line number Diff line change
@@ -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 - <solar@gentoo.org>
Expand All @@ -23,7 +23,6 @@
#include <string.h>

#include "colors.h"
#include "i18n.h"
#include "set.h"

extern const char *argv0;
Expand Down Expand Up @@ -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__))

Expand Down Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion qcheck.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 092dbac

Please sign in to comment.