]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
Use braces, not brackets, in Perl format strings.
authorBruno Haible <bruno@clisp.org>
Fri, 1 Aug 2003 20:47:21 +0000 (20:47 +0000)
committerBruno Haible <bruno@clisp.org>
Tue, 23 Jun 2009 10:10:47 +0000 (12:10 +0200)
22 files changed:
gettext-tools/doc/ChangeLog
gettext-tools/doc/gettext.texi
gettext-tools/po/ChangeLog
gettext-tools/po/POTFILES.in
gettext-tools/src/ChangeLog
gettext-tools/src/Makefile.am
gettext-tools/src/Makefile.msvc
gettext-tools/src/Makefile.vms
gettext-tools/src/format-perl-brace.c
gettext-tools/src/format.c
gettext-tools/src/format.h
gettext-tools/src/message.c
gettext-tools/src/message.h
gettext-tools/src/x-perl.h
gettext-tools/tests/ChangeLog
gettext-tools/tests/Makefile.am
gettext-tools/tests/format-perl-brace-1
gettext-tools/tests/format-perl-brace-2
gettext-tools/tests/format-perl-mixed-1
gettext-tools/tests/format-perl-mixed-2
gettext-tools/tests/lang-perl-2
gettext-tools/tests/xgettext-26

index 5865c24301bbf19a17d80b562ccefe336363b91a..9cac878cb5e6ef4e738bd85b17aeaa8ff894a030 100644 (file)
@@ -1,3 +1,9 @@
+2003-07-05  Bruno Haible  <bruno@clisp.org>
+
+       * gettext.texi (perl-format): Use braces, not brackets, in format
+       strings.
+       (Perl pitfalls): Likewise.
+
 2003-07-03  Bruno Haible  <bruno@clisp.org>
 
        * gettext.texi (PHP): Mention plural form functions.
index 7dfcecb4935d135905c6dabef711b84a2354103c..9e0fa748a74c21a38bbf774fb5f7f7544595bc49 100644 (file)
@@ -7335,15 +7335,15 @@ Tcl format strings are described in the @file{format.n} manual page,
 There are two kinds format strings in Perl: those acceptable to the
 Perl built-in function @code{printf}, labelled as @samp{perl-format},
 and those acceptable to the @code{libintl-perl} function @code{__x},
-labelled as @samp{perl-bracket-format}.
+labelled as @samp{perl-brace-format}.
 
 Perl @code{printf} format strings are described in the @code{sprintf}
 section of @samp{man perlfunc}.
 
-Perl bracketed format strings are described in the
+Perl brace format strings are described in the
 @file{Locale::TextDomain(3pm)} manual page of the CPAN package
 libintl-perl.  In brief, Perl format uses placeholders put between
-brackets (@samp{[} and @samp{]}).  The placeholder must have the syntax
+braces (@samp{@{} and @samp{@}}).  The placeholder must have the syntax
 of simple identifiers.
 
 @node php-format,  , perl-format, Translators for other Languages
@@ -9019,22 +9019,22 @@ Maybe some of these missing features will be implemented in future
 versions, but since you can always make do without them at minimal effort,
 these todos have very low priority.
 
-A nasty problem are bracketed format strings that already contain brackets
+A nasty problem are brace format strings that already contain braces
 as part of the normal text, for example the usage strings typically
 encountered in programs:
 
 @example
-die "usage: $0 [OPTIONS] FILENAME...\n";
+die "usage: $0 @{OPTIONS@} FILENAME...\n";
 @end example
 
-If you want to internationalize this code with Perl bracketed format strings,
+If you want to internationalize this code with Perl brace format strings,
 you will run into a problem:
 
 @example
-die __x ("usage: [program] [OPTIONS] FILENAME...\n", program => $0);
+die __x ("usage: @{program@} @{OPTIONS@} FILENAME...\n", program => $0);
 @end example
 
-Whereas @code{@samp{[program]}} is a placeholder, @code{@samp{[OPTIONS]}}
+Whereas @samp{@{program@}} is a placeholder, @samp{@{OPTIONS@}}
 is not and should probably be translated. Yet, there is no way to teach
 the Perl parser in @code{xgettext} to recognize the first one, and leave
 the other one alone.
@@ -9043,26 +9043,26 @@ There are two possible work-arounds for this problem.  If you are
 sure that your program will run under Perl 5.8.0 or newer (these
 Perl versions handle positional parameters in @code{printf()}) or
 if you are sure that the translator will not have to reorder the arguments
-in her translation -- for example if you have only one bracketed placeholder
+in her translation -- for example if you have only one brace placeholder
 in your string, or if it describes a syntax, like in this one --, you can
-mark the string as @code{no-perl-bracket-format} and use @code{printf()}:
+mark the string as @code{no-perl-brace-format} and use @code{printf()}:
 
 @example
-# xgettext: no-perl-bracket-format
-die sprintf ("usage: %s [OPTIONS] FILENAME...\n", $0);
+# xgettext: no-perl-brace-format
+die sprintf ("usage: %s @{OPTIONS@} FILENAME...\n", $0);
 @end example
 
-If you want to use the more portable Perl bracket format, you will have to do
-put placeholders in place of the literal brackets:
+If you want to use the more portable Perl brace format, you will have to do
+put placeholders in place of the literal braces:
 
 @example
-die __x ("usage: [program] [@{]OPTIONS[@}] FILENAME...\n",
-         program => $0, '@{' => '[', '@}' => ']');
+die __x ("usage: @{program@} @{[@}OPTIONS@{]@} FILENAME...\n",
+         program => $0, '[' => '@{', ']' => '@}');
 @end example
 
-Perl bracketed format strings know no escaping mechanism.  No matter how this
+Perl brace format strings know no escaping mechanism.  No matter how this
 escaping mechanism looked like, it would either give the programmer a
-hard time, make translating Perl bracketed format strings heavy-going, or
+hard time, make translating Perl brace format strings heavy-going, or
 result in a performance penalty at runtime, when the format directives
 get executed.  Most of the time you will happily get along with
 @code{printf()} for this special case.
index 27ab668284ae291d2d51a9e5c737aa34dacbcced..c2ba01bb2a4a68f6d299435b5f0bfd5a5005c71d 100644 (file)
@@ -1,3 +1,7 @@
+2003-07-05  Bruno Haible  <bruno@clisp.org>
+
+       * POTFILES.in: Add format-perl-brace.c, remove format-perl-bracket.c.
+
 2003-07-31  Bruno Haible  <bruno@clisp.org>
 
        * ca.po: Update from Ivan Vilata i Balaguer <ivan@selidor.net>.
index debafb4033f7f7b9dc171eb6e869599041fd92fb..f94c65d370d276deae15c63c9c401a28903138cb 100644 (file)
@@ -33,7 +33,7 @@ src/format-librep.c
 src/format-lisp.c
 src/format-pascal.c
 src/format-perl.c
-src/format-perl-bracket.c
+src/format-perl-brace.c
 src/format-php.c
 src/format-python.c
 src/format-tcl.c
index 398506dd3e1df37256d42511ef40a7a5a2a9c558..bef7b140aa908b5f8d45cfaac27dd6f38fd1602e 100644 (file)
@@ -1,3 +1,24 @@
+2003-07-05  Bruno Haible  <bruno@clisp.org>
+
+       * format-perl-brace.c: Renamed from format-perl-bracket.c. Recognize
+       braces instead of brackets.
+       * format.h (formatstring_perl_brace): Renamed from
+       formatstring_perl_bracket.
+       * format.c (formatstring_parsers): Add formatstring_perl_brace, remove
+       formatstring_perl_bracket.
+       * message.h (enum format_type): Add format_perl_brace, remove
+       format_perl_bracket.
+       * message.c (format_language, format_language_pretty): Update.
+       * x-perl.h (SCANNERS_PERL): Update.
+       * Makefile.am (FORMAT_SOURCE): Add format-perl-brace.c, remove
+       format-perl-bracket.c.
+       * Makefile.msvc (OBJECTS): Add format-perl-brace.obj, remove
+       format-perl-bracket.obj.
+       (format-perl-brace.obj): Renamed from format-perl-bracket.obj.
+       * Makefile.vms (OBJECTS): Add format-perl-brace.obj, remove
+       format-perl-bracket.obj.
+       (format-perl-brace.obj): Renamed from format-perl-bracket.obj.
+
 2003-07-03  Bruno Haible  <bruno@clisp.org>
 
        Support for PHP >= 4.2.0.
index 8ef0272eb51da64308202f74d885a5ca8fa53b7c..305ab8c7a75295ea8adf732ca3b855842e2a5809 100644 (file)
@@ -93,7 +93,7 @@ read-properties.c open-po.c dir-list.c str-list.c
 FORMAT_SOURCE = format.c format-invalid.h \
 format-c.c format-python.c format-lisp.c format-elisp.c format-librep.c \
 format-java.c format-awk.c format-pascal.c format-ycp.c format-tcl.c \
-format-perl.c format-perl-bracket.c format-php.c
+format-perl.c format-perl-brace.c format-php.c
 
 # libgettextsrc contains all code that is needed by at least two programs.
 libgettextsrc_la_SOURCES = \
index 8f5749b9a659eb3dc51d38ddf6b9941c7850c44e..3715941b9d555d46e7d1e375b6bf3ba25a8d71ba 100644 (file)
@@ -140,7 +140,7 @@ OBJECTS = \
   format-ycp.obj \
   format-tcl.obj \
   format-perl.obj \
-  format-perl-bracket.obj \
+  format-perl-brace.obj \
   format-php.obj
 
 msgcmp_OBJECTS = msgcmp.obj
@@ -271,8 +271,8 @@ format-tcl.obj : format-tcl.c
 format-perl.obj : format-perl.c
        $(CC) $(INCLUDES) $(CFLAGS) $(PICFLAGS) -c format-perl.c
 
-format-perl-bracket.obj : format-perl-bracket.c
-       $(CC) $(INCLUDES) $(CFLAGS) $(PICFLAGS) -c format-perl-bracket.c
+format-perl-brace.obj : format-perl-brace.c
+       $(CC) $(INCLUDES) $(CFLAGS) $(PICFLAGS) -c format-perl-brace.c
 
 format-php.obj : format-php.c
        $(CC) $(INCLUDES) $(CFLAGS) $(PICFLAGS) -c format-php.c
index 97a0caad8278dce788a946b1a032a8700107c7e1..8e116faa0759fe373eda273cce3ca94d386f8100 100644 (file)
@@ -86,7 +86,7 @@ OBJECTS = \
   format-ycp.obj, \
   format-tcl.obj, \
   format-perl.obj, \
-  format-perl-bracket.obj, \
+  format-perl-brace.obj, \
   format-php.obj
 
 msgcmp_OBJECTS = msgcmp.obj
@@ -215,8 +215,8 @@ format-tcl.obj : format-tcl.c
 format-perl.obj : format-perl.c
        $(CC) $(INCLUDES) $(CFLAGS) /define=($(DEFS)) format-perl.c
 
-format-perl-bracket.obj : format-perl-bracket.c
-       $(CC) $(INCLUDES) $(CFLAGS) /define=($(DEFS)) format-perl-bracket.c
+format-perl-brace.obj : format-perl-brace.c
+       $(CC) $(INCLUDES) $(CFLAGS) /define=($(DEFS)) format-perl-brace.c
 
 format-php.obj : format-php.c
        $(CC) $(INCLUDES) $(CFLAGS) /define=($(DEFS)) format-php.c
index 688fcfdc6ae9a82380c4572d06bd638a5dc27cbd..334e194cf97558f2348d4b6f8f3e9aae9c1349ee 100644 (file)
@@ -1,4 +1,4 @@
-/* Perl bracketed format strings.
+/* Perl brace format strings.
    Copyright (C) 2003 Free Software Foundation, Inc.
    Written by Bruno Haible <bruno@clisp.org>, 2003.
 
 
 #define _(str) gettext (str)
 
-/* Perl bracketed format strings are supported by Guido Flohr's libintl-perl
+/* Perl brace format strings are supported by Guido Flohr's libintl-perl
    package, more precisely by the __expand and __x functions therein.
    A format string directive here consists of
-     - an opening bracket '[',
+     - an opening brace '{',
      - an identifier [_A-Za-z][_0-9A-Za-z]*,
-     - a closing bracket ']'.
+     - a closing brace '}'.
  */
 
 struct named_arg
@@ -79,7 +79,7 @@ format_parse (const char *format, char **invalid_reason)
   spec.named = NULL;
 
   for (; *format != '\0';)
-    if (*format++ == '[')
+    if (*format++ == '{')
       {
        const char *f = format;
        char c;
@@ -91,7 +91,7 @@ format_parse (const char *format, char **invalid_reason)
              c = *++f;
            while ((c >= 'A' && c <= 'Z') || (c >= 'a' && c <= 'z') || c == '_'
                   || (c >= '0' && c <= '9'));
-           if (c == ']')
+           if (c == '}')
              {
                /* A directive.  */
                char *name;
@@ -183,7 +183,7 @@ format_check (const lex_pos_ty *pos, void *msgid_descr, void *msgstr_descr,
 
       /* Check the argument names in spec1 are contained in those of spec2.
         Additional arguments in spec2 are allowed; they expand to themselves
-        (including the surrounding brackets) at runtime.
+        (including the surrounding braces) at runtime.
         Both arrays are sorted.  We search for the differences.  */
       for (i = 0, j = 0; i < n1 || j < n2; )
        {
@@ -220,7 +220,7 @@ format_check (const lex_pos_ty *pos, void *msgid_descr, void *msgstr_descr,
 }
 
 
-struct formatstring_parser formatstring_perl_bracket =
+struct formatstring_parser formatstring_perl_brace =
 {
   format_parse,
   format_free,
@@ -294,7 +294,7 @@ main ()
 /*
  * For Emacs M-x compile
  * Local Variables:
- * compile-command: "/bin/sh ../libtool --mode=link gcc -o a.out -static -O -g -Wall -I.. -I../lib -I../intl -DHAVE_CONFIG_H -DTEST format-perl-bracket.c ../lib/libgettextlib.la"
+ * compile-command: "/bin/sh ../libtool --mode=link gcc -o a.out -static -O -g -Wall -I.. -I../lib -I../intl -DHAVE_CONFIG_H -DTEST format-perl-brace.c ../lib/libgettextlib.la"
  * End:
  */
 
index 0dc216fd52edd951c9b8acd220766bc1adec5828..17423f340cfd9025c7fd3f1f397304e304c5ddb8 100644 (file)
@@ -38,6 +38,6 @@ struct formatstring_parser *formatstring_parsers[NFORMATS] =
   /* format_ycp */             &formatstring_ycp,
   /* format_tcl */             &formatstring_tcl,
   /* format_perl */            &formatstring_perl,
-  /* format_perl_bracket */    &formatstring_perl_bracket,
+  /* format_perl_brace */      &formatstring_perl_brace,
   /* format_php */             &formatstring_php
 };
index ca0d61c1bcb1c652589cb0668c4eff6212b3a714..6cd241be1185ea62ba2d6bad263621e5b2594e79 100644 (file)
@@ -67,7 +67,7 @@ extern struct formatstring_parser formatstring_pascal;
 extern struct formatstring_parser formatstring_ycp;
 extern struct formatstring_parser formatstring_tcl;
 extern struct formatstring_parser formatstring_perl;
-extern struct formatstring_parser formatstring_perl_bracket;
+extern struct formatstring_parser formatstring_perl_brace;
 extern struct formatstring_parser formatstring_php;
 
 /* Table of all format string parsers.  */
index e72957451030857d8f00d985c867f9dc62482c4f..294506303985314c2138e833ece822908b42ae67 100644 (file)
@@ -46,7 +46,7 @@ const char *const format_language[NFORMATS] =
   /* format_ycp */             "ycp",
   /* format_tcl */             "tcl",
   /* format_perl */            "perl",
-  /* format_perl_bracket */    "perl-bracket",
+  /* format_perl_brace */      "perl-brace",
   /* format_php */             "php"
 };
 
@@ -64,7 +64,7 @@ const char *const format_language_pretty[NFORMATS] =
   /* format_ycp */             "YCP",
   /* format_tcl */             "Tcl",
   /* format_perl */            "Perl",
-  /* format_perl_bracket */    "Perl bracket",
+  /* format_perl_brace */      "Perl brace",
   /* format_php */             "PHP"
 };
 
index 2926ca2a7e24fdce91f0d4f3cbeb0a4516979575..a64c86ce2602b1f53bf79807d3dc71e319cbb93b 100644 (file)
@@ -46,7 +46,7 @@ enum format_type
   format_ycp,
   format_tcl,
   format_perl,
-  format_perl_bracket,
+  format_perl_brace,
   format_php
 };
 #define NFORMATS 14    /* Number of format_type enum values.  */
index 0f67b0329d6aa11d423c1bfc0074651a6960962e..9c28df66ba1c2ac094c01f27edee851a6ffc6067 100644 (file)
@@ -24,7 +24,7 @@
   { "cgi",   "perl"   },                                               \
 
 #define SCANNERS_PERL \
-  { "perl",  extract_perl, &formatstring_perl, &formatstring_perl_bracket }, \
+  { "perl",  extract_perl, &formatstring_perl, &formatstring_perl_brace }, \
 
 /* Scan a Perl file and add its translatable strings to mdlp.  */
 extern void extract_perl (FILE *fp, const char *real_filename,
index cd470fc8c273ef3b4208816794e6a5b5c5393555..988d42dd682bd70be8c9d081b8366aea6ae53663 100644 (file)
@@ -1,3 +1,16 @@
+2003-07-05  Bruno Haible  <bruno@clisp.org>
+
+       * format-perl-brace-1: Renamed from format-perl-bracket-1. Use braces
+       instead of brackets.
+       * format-perl-brace-2: Renamed from format-perl-bracket-2. Use braces
+       instead of brackets.
+       * format-perl-mixed-1: Use braces instead of brackets.
+       * format-perl-mixed-2: Likewise.
+       * xgettext-26: Likewise.
+       * lang-perl-2: Likewise.
+       * Makefile.am (TESTS): Add format-perl-brace-[12], remove
+       format-perl-bracket-[12].
+
 2003-06-27  Bruno Haible  <bruno@clisp.org>
 
        * xgettext-27: Also test Unicode character names in here documents.
index fa18e38a857f79f0489fedea59328f54d4ce0b3d..ad29fc3295b887a0537effbf3d06f4a1fcce99ae 100644 (file)
@@ -61,7 +61,7 @@ TESTS = gettext-1 gettext-2 \
        format-python-1 format-python-2 \
        format-pascal-1 format-pascal-2 \
        format-perl-1 format-perl-2 \
-       format-perl-bracket-1 format-perl-bracket-2 \
+       format-perl-brace-1 format-perl-brace-2 \
        format-perl-mixed-1 format-perl-mixed-2 \
        format-tcl-1 format-tcl-2 \
        format-ycp-1 format-ycp-2 \
index 16ce6842f67f39d3f592738965754cafa103997a..e05aba5855b7864c97d5bcc57ee4c9a7ff456ac8 100755 (executable)
@@ -1,6 +1,6 @@
 #! /bin/sh
 
-# Test recognition of Perl bracket format strings.
+# Test recognition of Perl brace format strings.
 
 tmpfiles=""
 trap 'rm -fr $tmpfiles' 1 2 3 15
@@ -10,25 +10,25 @@ cat <<\EOF > f-pb-1.data
 # Invalid: no argument
 "abc"
 # Valid: a named argument
-"abc[value]"
+"abc{value}"
 # Invalid: an empty name
-"abc[]"
+"abc{}"
 # Invalid: unterminated name
-"abc[value"
+"abc{value"
 # Valid: three arguments, two with equal names
-"abc[addr],[char],[addr]"
+"abc{addr},{char},{addr}"
 # Invalid: place-holder contains a space.
-"[foo bar]"
+"{foo bar}"
 # Invalid: missing right angle bracket.
-"[foo bar"
+"{foo bar"
 # Valid: not nested, but one single place-holder.
-"[foo[bar]baz]"
+"{foo{bar}baz}"
 # Valid: no nesting error, but one single place-holder.
-"[foo[bar]baz"
+"{foo{bar}baz"
 # Valid: place-holder with spaces must be ignored, but still one remaining.
-"[foo bar] [baz]"
+"{foo bar} {baz}"
 # Invalid: percent sign not allowed.
-"[foo%bar]"
+"{foo%bar}"
 EOF
 
 : ${XGETTEXT=xgettext}
@@ -50,7 +50,7 @@ EOF
       fail=yes
     fi
   else
-    if grep perl-bracket-format f-pb-1-$n.po > /dev/null; then
+    if grep perl-brace-format f-pb-1-$n.po > /dev/null; then
       fail=yes
     else
       :
index bd750c3309c89e1153f03394881ca8243eba4ef7..c00636bfac577a0e166f2825ac79b8bbbc555a4a 100755 (executable)
@@ -1,6 +1,6 @@
 #! /bin/sh
 
-# Test checking of Perl bracket format strings.
+# Test checking of Perl brace format strings.
 
 tmpfiles=""
 trap 'rm -fr $tmpfiles' 1 2 3 15
@@ -8,26 +8,26 @@ trap 'rm -fr $tmpfiles' 1 2 3 15
 tmpfiles="$tmpfiles f-pb-2.data"
 cat <<\EOF > f-pb-2.data
 # Valid: same named arguments
-msgid  "abc[date][time]"
-msgstr "xyz[date][time]"
+msgid  "abc{date}{time}"
+msgstr "xyz{date}{time}"
 # Valid: permutation
-msgid  "abc[x3][x1][x2]def"
-msgstr "xyz[x2][x1][x3]"
+msgid  "abc{x3}{x1}{x2}def"
+msgstr "xyz{x2}{x1}{x3}"
 # Invalid: missing argument
-msgid  "abc[x2]def[x1]"
-msgstr "xyz[x1]"
+msgid  "abc{x2}def{x1}"
+msgstr "xyz{x1}"
 # Invalid: missing argument
-msgid  "abc[x1]def[x2]"
-msgstr "xyz[x2]"
-# Valid: added argument (valid since "[zoo]" expands to itself)
-msgid  "abc[foo]def"
-msgstr "xyz[foo]uvw[zoo]"
+msgid  "abc{x1}def{x2}"
+msgstr "xyz{x2}"
+# Valid: added argument (valid since "{zoo}" expands to itself)
+msgid  "abc{foo}def"
+msgstr "xyz{foo}uvw{zoo}"
 # Valid: multiple reuse of same argument
-msgid  "[foo] [bar] [baz]"
-msgstr "[baz] [bar] [foo] [bar]"
+msgid  "{foo} {bar} {baz}"
+msgstr "{baz} {bar} {foo} {bar}"
 # Valid: single reuse of same argument
-msgid  "[baz] [bar] [foo] [bar]"
-msgstr "[foo] [bar] [baz]"
+msgid  "{baz} {bar} {foo} {bar}"
+msgstr "{foo} {bar} {baz}"
 EOF
 
 : ${MSGFMT=msgfmt}
@@ -38,7 +38,7 @@ while read comment; do
   n=`expr $n + 1`
   tmpfiles="$tmpfiles f-pb-2-$n.po f-pb-2-$n.mo"
   cat <<EOF > f-pb-2-$n.po
-#, perl-bracket-format
+#, perl-brace-format
 ${msgid_line}
 ${msgstr_line}
 EOF
index 83da4a6f690954c7fe51a06f588749bda4e991ae..3b3a84b89b86db8763008b0a8f413a9b0d72e907 100755 (executable)
@@ -1,6 +1,6 @@
 #! /bin/sh
 
-# Test recognition of Perl format strings of both kinds (printf and bracketed).
+# Test recognition of Perl format strings of both kinds (printf and brace).
 # This test is for the combination of both kinds.
 
 tmpfiles=""
@@ -10,23 +10,23 @@ tmpfiles="$tmpfiles f-pm-1.data"
 
 cat <<\EOF > f-pm-1.data
 # Both formats.
-#, perl-format, perl-bracket-format
-"[foo] %c [bar] %d [baz]"
+#, perl-format, perl-brace-format
+"{foo} %c {bar} %d {baz}"
 # printf format only.
 #, perl-format
 "%c %d"
 # printf format only, because '%' is not allowed in identifier.
 #, perl-format
-"[foo%cbar]"
+"{foo%cbar}"
 # Valid bracketed format because there is still one valid identifier.
-#, perl-format, perl-bracket-format
-"[foo%cbar] [baz]"
+#, perl-format, perl-brace-format
+"{foo%cbar} {baz}"
 # Bracketed format only, because %l is not recognized in printf format.
-#, perl-bracket-format
-"[foo] %l [bar]"
+#, perl-brace-format
+"{foo} %l {bar}"
 # Neither format recognized here.
 
-"[foo bar %l"
+"{foo bar %l"
 EOF
 
 : ${XGETTEXT=xgettext}
index 696315cd90de65ad1c5b96533d67d652c3808725..09afbbb5b99ff29b9c2db3c677a0f4e5591c5e37 100755 (executable)
@@ -1,7 +1,7 @@
 #! /bin/sh
 
 # Test checking of Perl format strings.
-# This test is for the combination of printf and bracketed format strings.
+# This test is for the combination of printf and brace format strings.
 
 tmpfiles=""
 trap 'rm -fr $tmpfiles' 1 2 3 15
@@ -9,32 +9,32 @@ trap 'rm -fr $tmpfiles' 1 2 3 15
 tmpfiles="$tmpfiles f-pm-2.data"
 cat <<\EOF > f-pm-2.data
 # Valid: normal case.
-#, perl-format, perl-bracket-format
-msgid  "[foo] %d [bar] %s"
-msgstr "[bar] [foo] %d %s"
+#, perl-format, perl-brace-format
+msgid  "{foo} %d {bar} %s"
+msgstr "{bar} {foo} %d %s"
 # Invalid: missing argument.
-#, perl-format, perl-bracket-format
-msgid  "[foo] %d [bar] %s"
-msgstr "[bar] %d %s"
+#, perl-format, perl-brace-format
+msgid  "{foo} %d {bar} %s"
+msgstr "{bar} %d %s"
 # Valid: missing argument but checking disabled.
-#, perl-format, no-perl-bracket-format
-msgid  "[foo] %d [bar] %s"
-msgstr "[bar] %d %s"
+#, perl-format, no-perl-brace-format
+msgid  "{foo} %d {bar} %s"
+msgstr "{bar} %d %s"
 # Invalid: printf format reordered without position specifiers %1$, %2$.
-#, perl-format, perl-bracket-format
-msgid  "[foo] %d [bar] %s"
-msgstr "[bar] %s [foo] %d"
+#, perl-format, perl-brace-format
+msgid  "{foo} %d {bar} %s"
+msgstr "{bar} %s {foo} %d"
 # Valid: same thing but checking disabled.
-#, no-perl-format, perl-bracket-format
-msgid  "[foo] %d [bar] %s"
-msgstr "[bar] %s [foo] %d"
+#, no-perl-format, perl-brace-format
+msgid  "{foo} %d {bar} %s"
+msgstr "{bar} %s {foo} %d"
 # Invalid: unnamed vs. named arguments
 #, perl-format
 msgid  "abc%sdef"
-msgstr "xyz[value]"
+msgstr "xyz{value}"
 # Invalid: named vs. unnamed arguments
-#, perl-bracket-format
-msgid  "abc[value]def"
+#, perl-brace-format
+msgid  "abc{value}def"
 msgstr "xyz%s"
 EOF
 
index 7b7ebccdad9b6eb0797088682e5bf94961cf27cb..6948ac12d9ab019b190474be960d80e167fe852c 100755 (executable)
@@ -1,7 +1,7 @@
 #! /bin/sh
 
 # Test of gettext facilities in the Perl language,
-# using bracket format strings.
+# using brace format strings.
 # Assumes an fr_FR locale is installed.
 # Assumes the following packages are installed: perl, libintl-perl.
 
@@ -16,7 +16,7 @@ print __"'Your command, please?', asked the waiter.";
 print "\n"
 printf __n ("a piece of cake", "%d pieces of cake", $n), $n;
 print "\n"
-printf __x ("[old] is replaced by [new].", old => "FF", new => "EUR");
+printf __x ("{old} is replaced by {new}.", old => "FF", new => "EUR");
 print "\n"
 EOF
 
@@ -35,8 +35,8 @@ msgid_plural "%d pieces of cake"
 msgstr[0] ""
 msgstr[1] ""
 
-#, perl-bracket-format
-msgid "[old] is replaced by [new]."
+#, perl-brace-format
+msgid "{old} is replaced by {new}."
 msgstr ""
 EOF
 
@@ -61,9 +61,9 @@ msgstr[0] "un morceau de gateau"
 msgstr[1] "%d morceaux de gateau"
 
 # Reverse the arguments.
-#, perl-bracket-format
-msgid "[old] is replaced by [new]."
-msgstr "[new] remplace [old]."
+#, perl-brace-format
+msgid "{old} is replaced by {new}."
+msgstr "{new} remplace {old}."
 EOF
 
 tmpfiles="$tmpfiles fr.po.new"
index 9f2f55ce5859871e7f24d36a670594cfd29c2381..21c2eebc01a4debe1d327acda171a399f7071ecf 100755 (executable)
@@ -108,23 +108,23 @@ printf "%s\n", gettext qq(mari\\\\huana);
 printf "%s\n", gettext qq(mari\\\\\huana);
 
 # Recognition of format strings.
-gettext "This is [only] a bracketed formatstring.";
-gettext "This is %s [mixed].";
+gettext "This is {only} a brace formatstring.";
+gettext "This is %s {mixed}.";
 gettext "This is only %c.";
 gettext "This is nothing at all.";
 gettext "And this is %l also no format at all.";
 
-# xgettext: no-perl-format, perl-bracket-format
-gettext "The function '[func]' expects '%c' here.";
+# xgettext: no-perl-format, perl-brace-format
+gettext "The function '{func}' expects '%c' here.";
 
 # This is a contradictory case: The same string three times,
 # with different xgettext comments.
-# xgettext: perl-bracket-format, no-perl-format
-gettext "Left as an %exercise to [maintainer].";
-# xgettext: no-perl-bracket-format, perl-format
-gettext "Left as an %exercise to [maintainer].";
+# xgettext: perl-brace-format, no-perl-format
+gettext "Left as an %exercise to {maintainer}.";
+# xgettext: no-perl-brace-format, perl-format
+gettext "Left as an %exercise to {maintainer}.";
 # No xgettext comment this time.
-gettext "Left as an %exercise to [maintainer].";
+gettext "Left as an %exercise to {maintainer}.";
 __END__
 gettext "Discarded!";
 EOF
@@ -262,13 +262,13 @@ msgid "mari\\\\huana"
 msgstr ""
 
 #: xg-test26.pl:102
-#, perl-bracket-format
-msgid "This is [only] a bracketed formatstring."
+#, perl-brace-format
+msgid "This is {only} a brace formatstring."
 msgstr ""
 
 #: xg-test26.pl:103
-#, perl-format, perl-bracket-format
-msgid "This is %s [mixed]."
+#, perl-format, perl-brace-format
+msgid "This is %s {mixed}."
 msgstr ""
 
 #: xg-test26.pl:104
@@ -285,13 +285,13 @@ msgid "And this is %l also no format at all."
 msgstr ""
 
 #: xg-test26.pl:109
-#, no-perl-format, perl-bracket-format
-msgid "The function '[func]' expects '%c' here."
+#, no-perl-format, perl-brace-format
+msgid "The function '{func}' expects '%c' here."
 msgstr ""
 
 #: xg-test26.pl:114 xg-test26.pl:116 xg-test26.pl:118
-#, perl-format, no-perl-bracket-format
-msgid "Left as an %exercise to [maintainer]."
+#, perl-format, no-perl-brace-format
+msgid "Left as an %exercise to {maintainer}."
 msgstr ""
 EOF