* gettext-tools/tests/format-c-3-prg.c (_): Remove macro.
(main): Test also a simple translation.
* gettext-tools/tests/format-c-4-prg.c: Likewise.
* gettext-tools/tests/format-c-5-prg.c: Likewise.
* gettext-tools/tests/format-c-3: Update.
* gettext-tools/tests/format-c-4: Likewise.
* gettext-tools/tests/format-c-5: Likewise.
LC_ALL=C tr -d '\r' < fc3.tmp > fc3.pot || Exit 1
cat <<EOF > fc3.ok
+msgid "the president"
+msgstr ""
+
#, c-format
msgid "father of %<PRId8> children"
msgstr ""
${DIFF} fc3.ok fc3.pot || Exit 1
cat <<EOF > fc3-de.po
+msgid "the president"
+msgstr "der Vorsitzende"
+
#, c-format
msgid "father of %<PRId8> children"
msgstr "Vater von %<PRId8> Kindern"
/* Test program, used by the format-c-3 test.
- Copyright (C) 2002, 2009, 2013, 2018, 2020 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2009, 2013, 2018, 2020, 2023 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
extern char *setlocale (int category, const char *locale);
#endif
-#define _(string) gettext (string)
-
/* Fallback definition. */
#if !defined PRId8
# define PRId8 "d"
textdomain ("fc3");
bindtextdomain ("fc3", "fc3-dir");
+ if (strcmp (gettext ("the president"), "der Vorsitzende") != 0)
+ {
+ fprintf (stderr, "Simple messages not translated.\n");
+ exit (1);
+ }
+
s = gettext ("father of %"PRId8" children");
c1 = "Vater von %"; c2 = " Kindern";
LC_ALL=C tr -d '\r' < fc4.tmp > fc4.pot || Exit 1
cat <<EOF > fc4.ok
+msgid "the president"
+msgstr ""
+
#, c-format
msgid "father of %<PRId8> child"
msgid_plural "father of %<PRId8> children"
${DIFF} fc4.ok fc4.pot || Exit 1
cat <<EOF > fc4-de.po
+msgid "the president"
+msgstr "der Vorsitzende"
+
#, c-format
msgid "father of %<PRId8> child"
msgid_plural "father of %<PRId8> children"
/* Test program, used by the format-c-4 test.
- Copyright (C) 2002, 2009, 2013, 2018, 2020 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2009, 2013, 2018, 2020, 2023 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
extern char *setlocale (int category, const char *locale);
#endif
-#define _(string) gettext (string)
-
/* Fallback definition. */
#if !defined PRId8
# define PRId8 "d"
textdomain ("fc4");
bindtextdomain ("fc4", "fc4-dir");
+ if (strcmp (gettext ("the president"), "der Vorsitzende") != 0)
+ {
+ fprintf (stderr, "Simple messages not translated.\n");
+ exit (1);
+ }
+
s = ngettext ("father of %"PRId8" child", "father of %"PRId8" children", n);
c1 = "Vater von %"; c2 = " Kindern";
LC_ALL=C tr -d '\r' < fc5.tmp > fc5.pot || Exit 1
cat <<EOF > fc5.ok
+msgid "the president"
+msgstr ""
+
#, c-format
msgid "father of %d children"
msgstr ""
# This should better be Farsi, not German. Can some translator help me?
cat <<EOF > fa.po
+msgid "the president"
+msgstr "der Vorsitzende"
+
#, c-format
msgid "father of %d children"
msgstr "Vater von %Id Kindern"
/* Test program, used by the format-c-5 test.
- Copyright (C) 2004, 2006, 2010, 2018 Free Software Foundation, Inc.
+ Copyright (C) 2004, 2006, 2010, 2018, 2023 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
# include "libgnuintl.h"
#endif
-#define _(string) gettext (string)
-
int
main (int argc, char *argv[])
{
textdomain ("fc5");
bindtextdomain ("fc5", ".");
+ if (strcmp (gettext ("the president"), "der Vorsitzende") != 0)
+ {
+ fprintf (stderr, "Simple messages not translated.\n");
+ exit (1);
+ }
+
s = gettext ("father of %d children");
en = "father of %d children";
#if (__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 2)) && !defined __UCLIBC__
if (strcmp (s, en) == 0)
{
- fprintf (stderr, "String untranslated.\n");
+ fprintf (stderr, "String not translated.\n");
exit (1);
}
if (strcmp (s, expected_translation) != 0)