From: Bruno Haible Date: Sun, 11 Mar 2001 16:15:20 +0000 (+0000) Subject: Use ngettext where possible. X-Git-Tag: v0.10.36~74 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e0d46c88d40eaf9d61209de1e0f0d47d75bf7029;p=thirdparty%2Fgettext.git Use ngettext where possible. --- diff --git a/ChangeLog b/ChangeLog index 464024b7a..9bf9a7628 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2001-03-11 Bruno Haible + + * configure.in: Pass 'need-ngettext' to AM_GNU_GETTEXT. + 2001-03-11 Bruno Haible * configure.in (ALL_LINGUAS): Add en@quot and en@boldquot. diff --git a/configure.in b/configure.in index 1210e32ef..bd6dd502a 100644 --- a/configure.in +++ b/configure.in @@ -1,6 +1,6 @@ dnl Process this file with autoconf to produce a configure script. AC_PREREQ(2.13) -AC_REVISION($Revision: 1.16 $) +AC_REVISION($Revision: 1.17 $) AC_INIT(src/msgfmt.c) AM_INIT_AUTOMAKE(gettext, 0.10.36) RELEASE_DATE=2001-03-09 dnl in "date +%Y-%m-%d" format @@ -71,7 +71,7 @@ gt_SETLOCALE dnl These are the only lines required to internationalize the package. dnl (OK, not quite, the AC_OUTPUT has also some parts.) -AM_GNU_GETTEXT(use-libtool) +AM_GNU_GETTEXT(use-libtool, need-ngettext) dnl Check for Emacs and where to install .elc files. AM_PATH_LISPDIR diff --git a/src/ChangeLog b/src/ChangeLog index e0bc8d168..07f1f657d 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,9 @@ +2001-03-11 Bruno Haible + + * po-lex.c (lex_close): Use ngettext and plural-form message. + * msgcmp.c (compare): Likewise. + * msgfmt.c (main): Likewise. + 2001-03-10 Bruno Haible * po.c (po_callback_message): Cast %*s argument from size_t to int. diff --git a/src/msgcmp.c b/src/msgcmp.c index 045ded34f..e6fed4d00 100644 --- a/src/msgcmp.c +++ b/src/msgcmp.c @@ -279,7 +279,9 @@ this message is used but not defined in %s"), fn1); /* Exit with status 1 on any error. */ if (nerrors > 0) - error (EXIT_FAILURE, 0, _("found %d fatal errors"), nerrors); + error (EXIT_FAILURE, 0, + ngettext ("found %d fatal error", "found %d fatal errors", nerrors), + nerrors); } diff --git a/src/msgfmt.c b/src/msgfmt.c index 675efd958..35bd4fae4 100644 --- a/src/msgfmt.c +++ b/src/msgfmt.c @@ -356,11 +356,21 @@ warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\ /* Print statistics if requested. */ if (verbose_level > 0 || do_statistics) { - fprintf (stderr, _("%d translated messages"), msgs_translated); + fprintf (stderr, + ngettext ("%d translated message", "%d translated messages", + msgs_translated), + msgs_translated); if (msgs_fuzzy > 0) - fprintf (stderr, _(", %d fuzzy translations"), msgs_fuzzy); + fprintf (stderr, + ngettext (", %d fuzzy translation", ", %d fuzzy translations", + msgs_fuzzy), + msgs_fuzzy); if (msgs_untranslated > 0) - fprintf (stderr, _(", %d untranslated messages"), msgs_untranslated); + fprintf (stderr, + ngettext (", %d untranslated message", + ", %d untranslated messages", + msgs_untranslated), + msgs_untranslated); fputs (".\n", stderr); } diff --git a/src/po-lex.c b/src/po-lex.c index 509f8020b..637422295 100644 --- a/src/po-lex.c +++ b/src/po-lex.c @@ -99,7 +99,10 @@ void lex_close () { if (error_message_count > 0) - error (EXIT_FAILURE, 0, _("found %d fatal errors"), error_message_count); + error (EXIT_FAILURE, 0, + ngettext ("found %d fatal error", "found %d fatal errors", + error_message_count), + error_message_count); if (fp != stdin) fclose (fp); diff --git a/tests/ChangeLog b/tests/ChangeLog index 56271dc26..f43bde1c3 100644 --- a/tests/ChangeLog +++ b/tests/ChangeLog @@ -1,3 +1,9 @@ +2001-03-10 Bruno Haible + + * msgcmp-2: Expect a singular error message. + * msgmerge-2: Likewise. + * xg-test1.ok.po: Regenerated. + 2001-03-10 Bruno Haible * Makefile.am (LDADD): Define depending on @USE_INCLUDED_LIBINTL@. diff --git a/tests/msgcmp-2 b/tests/msgcmp-2 index b0bbc9191..d7a67da7c 100755 --- a/tests/msgcmp-2 +++ b/tests/msgcmp-2 @@ -31,7 +31,7 @@ cat < mc-test2.ok mc-test2.in2:1: this message is used but not defined... mc-test2.in1:3: ...but this definition is similar mc-test2.in1:4: warning: this message is not used -found 1 fatal errors +found 1 fatal error EOF : ${DIFF=diff} diff --git a/tests/msgmerge-2 b/tests/msgmerge-2 index 73f82495e..8a37b1283 100755 --- a/tests/msgmerge-2 +++ b/tests/msgmerge-2 @@ -30,7 +30,7 @@ tmpfiles="$tmpfiles mm-test2.ok" cat << EOF > mm-test2.ok mm-test2.in1:3: duplicate message definition mm-test2.in1:1: ...this is the location of the first definition -found 1 fatal errors +found 1 fatal error EOF : ${DIFF=diff}