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

Re: Make option parsing error messages translatable

From: C. Michael Pilato <cmpilato_at_collab.net>
Date: Fri, 3 May 2013 08:56:25 -0400

On 05/02/2013 04:45 PM, Mattias Engdegård wrote:
> It is quite annoying that some of the more common error messages, the
>
> svn: invalid option: --gurgle
>
> kind, are entirely untranslatable because they are printed directly by
> APR which does not have any concept of translation at all. (This was
> reported before but met with silence:
> http://svn.haxx.se/dev/archive-2008-05/1445.shtml)
>
> It is not easy to fix it in a clean way; ideally, APR would return a
> detailed error code together with the required string parameters, but
> it doesn't. Even if we did change APR to that effect, it would be an
> incompatibility requiring a new APR version for use with Subversion.
>
> This patch, instead, installs an apr_getopt_err_fn_t, acting as a
> replacement for fprintf. It is admittedly a hack, but quite a
> localised one -- it doesn't foul up any other code -- and does not
> have any negative effects that I can think of. In short, it should be
> a strict improvement.
>
> Should APR's getopt error strings change, all that will happen is that
> they are shown untranslated, just like any other translated strings.

It's a hack, to be sure, but it doesn't strike me as one that carries a
particularly high penalty. Plus, it's ultimately not much more of a hack
than we already employ in *much* more commonly executed code -- the code
which determines which of the svn_error_t's in the chain are "tracing
errors". (See svn_error__is_tracing_link().)

+1 (from me, at least) to commit. That said, I know danielsh voiced some
pretty strong opinions the opposite direction about this on IRC, so please
respect those and see if he's willing to budge before moving forward.

-- 
C. Michael Pilato <cmpilato_at_collab.net>
CollabNet   <>   www.collab.net   <>   Enterprise Cloud Development

Received on 2013-05-03 14:57:05 CEST

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