[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: Translation problems with string constants

From: Erik Huelsmann <e.huelsmann_at_gmx.net>
Date: 2004-04-26 20:58:41 CEST

> "Erik Huelsmann" <e.huelsmann@gmx.net> writes:
> > There are several cases in which string constants stand in the way of
> easy
> > translation. The first being parametrised strings; I'd like to solve
> those
> > this way:
> >
> > - SVN_PROP_REVISION_AUTHOR " contains a newline")
> > + N_("svn:author contains a newline"))
> > +
> >
> Is there some way to generalize the SVN_REVNUM_T_FMT solution so it
> can be used for generic strings like SVN_PROP_REVISION_AUTHOR as well?

Yes, in general it is possible to use apr_psprintf() to transform numbers to
strings using the SVN_REVNUM_T_FMT format string and use that string for a
%s format specifier in the destination string.

An example:

   SVN_ERR_W( ... some code ... ,
              apr_psprintf("Error committing r" SVN_REVNUM_T_FMT "\n",
                           revision, pool));


   SVN_ERR_W( ... some code ... ,
              apr_psprintf("Error committing r%s\n",
                           SVN_REV_TO_STR(revision, pool)));


#define SVN_REV_TO_STR(rev, pool) apr_psprintf(SVN_REVNUM_T_FMT, rev, pool)

The case demonstrated above is a static initializer though so that this
scheme does not apply.



"Sie haben neue Mails!" - Die GMX Toolbar informiert Sie beim Surfen!
Jetzt aktivieren unter http://www.gmx.net/info
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Mon Apr 26 20:59:22 2004

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.