You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Arfrever Frehtes Taifersar Arahesis <Ar...@GMail.Com> on 2009/06/29 13:42:44 UTC
Re: svn commit: r38199 - in trunk/subversion: libsvn_client
libsvn_wc
2009-06-25 16:47 Hyrum K. Wright <hy...@hyrumwright.org> napisał(a):
> Author: hwright
> Date: Thu Jun 25 07:47:23 2009
> New Revision: 38199
>
> Log:
> Remove some "format not a string literal, argument types not checked" warnings,
> and simplify a few format strings while we're at it.
>
> * subversion/libsvn_wc/update_editor.c
> (window_handler, apply_textdelta, close_file),
> * subversion/libsvn_wc/questions.c
> (compare_and_verify),
> * subversion/libsvn_wc/adm_crawler.c
> (svn_wc_transmit_text_deltas2),
> * subversion/libsvn_client/export.c
> (close_file):
> Don't dynamically build error format strings, when they can just as
> easily be indicated statically.
Could you revert this change? Separation of " expected: %s" and "
actual: %s" messages allows to avoid the risk of inconsistent
translation of these messages and also reduces the amount of text
which need to be translated.
--
Arfrever Frehtes Taifersar Arahesis
------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=2366356
Re: svn commit: r38199 - in trunk/subversion: libsvn_client
libsvn_wc
Posted by Julian Foad <ju...@btopenworld.com>.
I (Julian Foad) wrote:
> Without answering the question of what's best for translation (let the
> translators decide that), I think we can easily avoid the "non-constant
> format string" warnings without changing the strings marked for
> translation:
>
> > - err = svn_error_createf(
> > - SVN_ERR_WC_CORRUPT_TEXT_BASE, err,
> > - apr_psprintf(hb->pool, "%s:\n%s\n%s\n",
> > - _("Checksum mismatch while updating '%s'"),
> > - _(" expected: %s"),
> > - _(" actual: %s")),
> > - X, Y, Z);
>
> > + err = svn_error_createf(
> > + SVN_ERR_WC_CORRUPT_TEXT_BASE, err,
> > + "%s:\n%s\n%s\n",
> > + apr_psprintf(hb->pool, _("Checksum mismatch while updating '%s'"), X),
> > + apr_psprintf(hb->pool, _(" expected: %s"), Y),
> > + apr_psprintf(hb->pool, _(" actual: %s"), Z));
FYI, I only offer this as an option, not a vote. As a developer, I
prefer Hyrum's solution of just writing the three-line message as a
single string if that is in fact OK for translators. Even better would
be to factor out at least the four "corrupt text base" error reports
into a single helper function to reduce the (near-)duplication.
- Julian
------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=2366419
Re: svn commit: r38199 - in trunk/subversion: libsvn_client
libsvn_wc
Posted by Julian Foad <ju...@btopenworld.com>.
Hyrum K. Wright wrote:
> On Jun 29, 2009, at 8:42 AM, Arfrever Frehtes Taifersar Arahesis wrote:
>
> > 2009-06-25 16:47 Hyrum K. Wright <hy...@hyrumwright.org> napisał(a):
> >> Author: hwright
> >> Date: Thu Jun 25 07:47:23 2009
> >> New Revision: 38199
> >>
> >> Log:
> >> Remove some "format not a string literal, argument types not
> >> checked" warnings,
> >> and simplify a few format strings while we're at it.
> >
> > Could you revert this change? Separation of " expected: %s" and "
> > actual: %s" messages allows to avoid the risk of inconsistent
> > translation of these messages and also reduces the amount of text
> > which need to be translated.
>
> It seems there is a tradeoff to be made here: Compilation warnings
> every time somebody compiles (and a slight runtime cost of allocating
> an separate format string when these errors occur) vs. a n-time
Compilation warnings are worth avoiding. A "runtime cost" involved in
printing an error message is not worth mentioning.
> translation cost for translators. Now, since I'm not a translator, I
> don't feel that pain very acutely, but it seems that a one-time
> translator cost is much more reasonable than a every-compile-time
> developer cost.
You could say that, but it's also important to give translators an
enjoyable and minimal task, to maximise the community's benefit of their
efforts.
> I also don't quite understand what the "risk" involved with
> inconsistent translation of these messages is. To help me better
> understand the translator's plight, could you elaborate? Do other
> translators have a feeling on this as well?
Without answering the question of what's best for translation (let the
translators decide that), I think we can easily avoid the "non-constant
format string" warnings without changing the strings marked for
translation:
> - err = svn_error_createf(
> - SVN_ERR_WC_CORRUPT_TEXT_BASE, err,
> - apr_psprintf(hb->pool, "%s:\n%s\n%s\n",
> - _("Checksum mismatch while updating '%s'"),
> - _(" expected: %s"),
> - _(" actual: %s")),
> - X, Y, Z);
> + err = svn_error_createf(
> + SVN_ERR_WC_CORRUPT_TEXT_BASE, err,
> + "%s:\n%s\n%s\n",
> + apr_psprintf(hb->pool, _("Checksum mismatch while updating '%s'"), X),
> + apr_psprintf(hb->pool, _(" expected: %s"), Y),
> + apr_psprintf(hb->pool, _(" actual: %s"), Z));
- Julian
------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=2366412
Re: svn commit: r38199 - in trunk/subversion: libsvn_client
libsvn_wc
Posted by "Hyrum K. Wright" <hy...@hyrumwright.org>.
On Jun 29, 2009, at 8:42 AM, Arfrever Frehtes Taifersar Arahesis wrote:
> 2009-06-25 16:47 Hyrum K. Wright <hy...@hyrumwright.org> napisał(a):
>> Author: hwright
>> Date: Thu Jun 25 07:47:23 2009
>> New Revision: 38199
>>
>> Log:
>> Remove some "format not a string literal, argument types not
>> checked" warnings,
>> and simplify a few format strings while we're at it.
>>
>> * subversion/libsvn_wc/update_editor.c
>> (window_handler, apply_textdelta, close_file),
>> * subversion/libsvn_wc/questions.c
>> (compare_and_verify),
>> * subversion/libsvn_wc/adm_crawler.c
>> (svn_wc_transmit_text_deltas2),
>> * subversion/libsvn_client/export.c
>> (close_file):
>> Don't dynamically build error format strings, when they can just
>> as
>> easily be indicated statically.
>
> Could you revert this change? Separation of " expected: %s" and "
> actual: %s" messages allows to avoid the risk of inconsistent
> translation of these messages and also reduces the amount of text
> which need to be translated.
It seems there is a tradeoff to be made here: Compilation warnings
every time somebody compiles (and a slight runtime cost of allocating
an separate format string when these errors occur) vs. a n-time
translation cost for translators. Now, since I'm not a translator, I
don't feel that pain very acutely, but it seems that a one-time
translator cost is much more reasonable than a every-compile-time
developer cost.
I also don't quite understand what the "risk" involved with
inconsistent translation of these messages is. To help me better
understand the translator's plight, could you elaborate? Do other
translators have a feeling on this as well?
-Hyrum
------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=2366364