You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@apr.apache.org by Cauchy Song <ca...@gmail.com> on 2007/01/25 09:37:23 UTC

Fwd: Ordering like "%1$s" is unsupported in the format strings

Mainly by:
/** Create an error structure with the given @a apr_err and @a child,
 * with a printf-style error message produced by passing @a fmt, using
 * apr_psprintf().
 */
svn_error_t *svn_error_createf(apr_status_t apr_err,
                               svn_error_t *child,
                               const char *fmt,
                               ...)
  __attribute__ ((format(printf, 3, 4)));

Is there any thing support format strings like "%1$s"  in apr ?


---------- Forwarded message ----------
From: Kobayashi Noritada <no...@dolphin.c.u-tokyo.ac.jp>
Date: 2007-1-25 下午2:23
Subject: Ordering like "%1$s" is unsupported in the format strings
To: subversion dev ML <de...@subversion.tigris.org>
Cc: dongsheng.song@gmail.com


Hi (mainly to zh_CN translators),

Recently revamped (Excellent!! :->) zh_CN.po contains many ordering
strings such as "%1$s".  However, such ordering of words in the printf
format strings is not supported in Subversion (in APR?).  Here I show
a test and its result with my ja.po.

Put a following entry into po.

  #: svn/propedit-cmd.c:116
  #, c-format
  msgid "No changes to property '%s' on revision %ld\n"
  msgstr "Revision %2$ld no zokusei '%1$s' ha henkou saremasendeshita.\n"

Then build and install po.  After that, run propedit, and then just
close the editor without modification of the property:

  nori1[14:40]%  rev=163
saba:~/svnwc/deb/serf
  nori1[14:40]% svn propedit --revprop -r $rev svn:log
saba:~/svnwc/deb/serf
  [snip]
  Revision %$ld no zokusei '%$s' ha henkou saremasendeshita.

The expected result is:

  Revision 163 no zokusei 'svn:log' ha henkou saremasendeshita.

Yes, it's not supported.

Since orders of words are vastly different between English and
Japanese (For example, Subject-Verb-Object-Modifier is popular in
English, Modifier-Subject-Object-Verb is popular in Japanese.), I also
would like to use po's ordering framework.  However, that framework is
dependent on implementation and currently unsupported in
Subversion. :-(

Thanks,

-nori

Re: Fwd: Ordering like "%1$s" is unsupported in the format strings

Posted by Joe Orton <jo...@redhat.com>.
On Thu, Jan 25, 2007 at 04:37:23PM +0800, Cauchy Song wrote:
> Mainly by:
> /** Create an error structure with the given @a apr_err and @a child,
> * with a printf-style error message produced by passing @a fmt, using
> * apr_psprintf().
> */
> svn_error_t *svn_error_createf(apr_status_t apr_err,
>                               svn_error_t *child,
>                               const char *fmt,
>                               ...)
>  __attribute__ ((format(printf, 3, 4)));
> 
> Is there any thing support format strings like "%1$s"  in apr ?

No, the APR printf (vformatter) implementation does not support 
positional specifiers like that; patches to add such support would be 
welcome!

Regards,

joe