You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Erik Huelsmann <eh...@gmail.com> on 2007/12/16 10:47:27 UTC

Re: svn commit: r28504 - branches/reintegrate/subversion/libsvn_fs_fs

On Dec 15, 2007 10:12 PM,  <bl...@tigris.org> wrote:
> Author: blair
> Date: Sat Dec 15 13:12:07 2007
> New Revision: 28504
>
> Log:
> Instead of using %llu for a apr_int64_t, use APR_INT64_T_FMT which
> works correctly with 64-bit compiles.
>
> * subversion/libsvn_fs_fs/dag.c
>   (svn_fs_fs__dag_increment_mergeinfo_count):
>     s/llu/APR_INT64_T_FMT/g.
>
>
> Modified:
>    branches/reintegrate/subversion/libsvn_fs_fs/dag.c
>
> Modified: branches/reintegrate/subversion/libsvn_fs_fs/dag.c
> URL: http://svn.collab.net/viewvc/svn/branches/reintegrate/subversion/libsvn_fs_fs/dag.c?pathrev=28504&r1=28503&r2=28504
> ==============================================================================
> --- branches/reintegrate/subversion/libsvn_fs_fs/dag.c  (original)
> +++ branches/reintegrate/subversion/libsvn_fs_fs/dag.c  Sat Dec 15 13:12:07 2007
> @@ -528,7 +528,7 @@
>        return svn_error_createf
>          (SVN_ERR_FS_CORRUPT, NULL,
>           _("Can't increment mergeinfo count on node-revision %s to negative "
> -           "value %llu"),
> +           "value %" APR_INT64_T_FMT),
>           idstr->data, noderev->mergeinfo_count);

You can't include format specifiers in translatable strings because
xgettext (the translatable string extractor) chokes on it.

The right way to do it would be to
 _("value %s"), apr_psprintf("%" APR_INT64_T_FMT, noderev->mergeinfo_count)


bye,

Erik.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: svn commit: r28504 - branches/reintegrate/subversion/libsvn_fs_fs

Posted by Arfrever Frehtes Taifersar Arahesis <ar...@gmail.com>.
2007-12-16 19:02:18 Blair Zajac napisał(a):
> Does our build system require using configure before using xgettext?

No.

-- 
Arfrever Frehtes Taifersar Arahesis

Re: svn commit: r28504 - branches/reintegrate/subversion/libsvn_fs_fs

Posted by Branko Čibej <br...@xbc.nu>.
Blair Zajac wrote:
> David Glasser wrote:
>> On Dec 16, 2007 11:33 AM, Erik Huelsmann <eh...@gmail.com> wrote:
>>
>> Arguably, xgettext could do something along the lines of
>>   s/%(d|ll|llu|etc...)/%NUMBER/
>> before it hashes or something...
>>
>> Maybe this activates the SEP field though.
>
> SEP field?

Somebody Else's Problem.
http://en.wikipedia.org/wiki/Somebody_Else%27s_Problem

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: svn commit: r28504 - branches/reintegrate/subversion/libsvn_fs_fs

Posted by Karl Fogel <kf...@red-bean.com>.
Blair Zajac <bl...@orcaware.com> writes:
> David Glasser wrote:
>> On Dec 16, 2007 11:33 AM, Erik Huelsmann <eh...@gmail.com> wrote:
>>
>> Arguably, xgettext could do something along the lines of
>>   s/%(d|ll|llu|etc...)/%NUMBER/
>> before it hashes or something...
>>
>> Maybe this activates the SEP field though.
>
> SEP field?

http://en.wikipedia.org/wiki/Somebody_Else's_Problem_field

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: svn commit: r28504 - branches/reintegrate/subversion/libsvn_fs_fs

Posted by Blair Zajac <bl...@orcaware.com>.
David Glasser wrote:
> On Dec 16, 2007 11:33 AM, Erik Huelsmann <eh...@gmail.com> wrote:
> 
> Arguably, xgettext could do something along the lines of
>   s/%(d|ll|llu|etc...)/%NUMBER/
> before it hashes or something...
> 
> Maybe this activates the SEP field though.

SEP field?

Blair

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: svn commit: r28504 - branches/reintegrate/subversion/libsvn_fs_fs

Posted by David Glasser <gl...@davidglasser.net>.
On Dec 16, 2007 11:33 AM, Erik Huelsmann <eh...@gmail.com> wrote:
>
> On Dec 16, 2007 7:02 PM, Blair Zajac <bl...@orcaware.com> wrote:
> >
> > Erik Huelsmann wrote:
> > > On Dec 15, 2007 10:12 PM,  <bl...@tigris.org> wrote:
> > >> Author: blair
> > >> Date: Sat Dec 15 13:12:07 2007
> > >> New Revision: 28504
> > >>
> > >> Log:
> > >> Instead of using %llu for a apr_int64_t, use APR_INT64_T_FMT which
> > >> works correctly with 64-bit compiles.
> > >>
> > >> * subversion/libsvn_fs_fs/dag.c
> > >>   (svn_fs_fs__dag_increment_mergeinfo_count):
> > >>     s/llu/APR_INT64_T_FMT/g.
> > >>
> > >>
> > >> Modified:
> > >>    branches/reintegrate/subversion/libsvn_fs_fs/dag.c
> > >>
> > >> Modified: branches/reintegrate/subversion/libsvn_fs_fs/dag.c
> > >> URL: http://svn.collab.net/viewvc/svn/branches/reintegrate/subversion/libsvn_fs_fs/dag.c?pathrev=28504&r1=28503&r2=28504
> > >> ==============================================================================
> > >> --- branches/reintegrate/subversion/libsvn_fs_fs/dag.c  (original)
> > >> +++ branches/reintegrate/subversion/libsvn_fs_fs/dag.c  Sat Dec 15 13:12:07 2007
> > >> @@ -528,7 +528,7 @@
> > >>        return svn_error_createf
> > >>          (SVN_ERR_FS_CORRUPT, NULL,
> > >>           _("Can't increment mergeinfo count on node-revision %s to negative "
> > >> -           "value %llu"),
> > >> +           "value %" APR_INT64_T_FMT),
> > >>           idstr->data, noderev->mergeinfo_count);
> > >
> > > You can't include format specifiers in translatable strings because
> > > xgettext (the translatable string extractor) chokes on it.
> > >
> > > The right way to do it would be to
> > >  _("value %s"), apr_psprintf("%" APR_INT64_T_FMT, noderev->mergeinfo_count)
> >
> > It would be nicer to have xgettext use cpp on the source code before processing
> > it.  Is there a way we can do that?
>
> Unfortunately not: the APR_*_FMT macros expand to different strings on
> different platforms (one has "lu", the other "llu", afaik). This fact
> makes the actual string appear differently on different platforms.
> This would render it impossible to create a translation for it,
> because input strings are hashed and then used to look up the
> translated string from the dictionary.
>
> So, the way we've been doing it (using the %s placeholder) is pretty
> much the only way to do this portably while still taking advantage of
> the APR_*_FMT constants...
>
> Hope that explains it a bit.

Arguably, xgettext could do something along the lines of
  s/%(d|ll|llu|etc...)/%NUMBER/
before it hashes or something...

Maybe this activates the SEP field though.

--dave


-- 
David Glasser | glasser@davidglasser.net | http://www.davidglasser.net/

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: svn commit: r28504 - branches/reintegrate/subversion/libsvn_fs_fs

Posted by Erik Huelsmann <eh...@gmail.com>.
On Dec 16, 2007 7:02 PM, Blair Zajac <bl...@orcaware.com> wrote:
>
> Erik Huelsmann wrote:
> > On Dec 15, 2007 10:12 PM,  <bl...@tigris.org> wrote:
> >> Author: blair
> >> Date: Sat Dec 15 13:12:07 2007
> >> New Revision: 28504
> >>
> >> Log:
> >> Instead of using %llu for a apr_int64_t, use APR_INT64_T_FMT which
> >> works correctly with 64-bit compiles.
> >>
> >> * subversion/libsvn_fs_fs/dag.c
> >>   (svn_fs_fs__dag_increment_mergeinfo_count):
> >>     s/llu/APR_INT64_T_FMT/g.
> >>
> >>
> >> Modified:
> >>    branches/reintegrate/subversion/libsvn_fs_fs/dag.c
> >>
> >> Modified: branches/reintegrate/subversion/libsvn_fs_fs/dag.c
> >> URL: http://svn.collab.net/viewvc/svn/branches/reintegrate/subversion/libsvn_fs_fs/dag.c?pathrev=28504&r1=28503&r2=28504
> >> ==============================================================================
> >> --- branches/reintegrate/subversion/libsvn_fs_fs/dag.c  (original)
> >> +++ branches/reintegrate/subversion/libsvn_fs_fs/dag.c  Sat Dec 15 13:12:07 2007
> >> @@ -528,7 +528,7 @@
> >>        return svn_error_createf
> >>          (SVN_ERR_FS_CORRUPT, NULL,
> >>           _("Can't increment mergeinfo count on node-revision %s to negative "
> >> -           "value %llu"),
> >> +           "value %" APR_INT64_T_FMT),
> >>           idstr->data, noderev->mergeinfo_count);
> >
> > You can't include format specifiers in translatable strings because
> > xgettext (the translatable string extractor) chokes on it.
> >
> > The right way to do it would be to
> >  _("value %s"), apr_psprintf("%" APR_INT64_T_FMT, noderev->mergeinfo_count)
>
> It would be nicer to have xgettext use cpp on the source code before processing
> it.  Is there a way we can do that?

Unfortunately not: the APR_*_FMT macros expand to different strings on
different platforms (one has "lu", the other "llu", afaik). This fact
makes the actual string appear differently on different platforms.
This would render it impossible to create a translation for it,
because input strings are hashed and then used to look up the
translated string from the dictionary.

So, the way we've been doing it (using the %s placeholder) is pretty
much the only way to do this portably while still taking advantage of
the APR_*_FMT constants...

Hope that explains it a bit.


bye,


Erik.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: svn commit: r28504 - branches/reintegrate/subversion/libsvn_fs_fs

Posted by Blair Zajac <bl...@orcaware.com>.
Erik Huelsmann wrote:
> On Dec 15, 2007 10:12 PM,  <bl...@tigris.org> wrote:
>> Author: blair
>> Date: Sat Dec 15 13:12:07 2007
>> New Revision: 28504
>>
>> Log:
>> Instead of using %llu for a apr_int64_t, use APR_INT64_T_FMT which
>> works correctly with 64-bit compiles.
>>
>> * subversion/libsvn_fs_fs/dag.c
>>   (svn_fs_fs__dag_increment_mergeinfo_count):
>>     s/llu/APR_INT64_T_FMT/g.
>>
>>
>> Modified:
>>    branches/reintegrate/subversion/libsvn_fs_fs/dag.c
>>
>> Modified: branches/reintegrate/subversion/libsvn_fs_fs/dag.c
>> URL: http://svn.collab.net/viewvc/svn/branches/reintegrate/subversion/libsvn_fs_fs/dag.c?pathrev=28504&r1=28503&r2=28504
>> ==============================================================================
>> --- branches/reintegrate/subversion/libsvn_fs_fs/dag.c  (original)
>> +++ branches/reintegrate/subversion/libsvn_fs_fs/dag.c  Sat Dec 15 13:12:07 2007
>> @@ -528,7 +528,7 @@
>>        return svn_error_createf
>>          (SVN_ERR_FS_CORRUPT, NULL,
>>           _("Can't increment mergeinfo count on node-revision %s to negative "
>> -           "value %llu"),
>> +           "value %" APR_INT64_T_FMT),
>>           idstr->data, noderev->mergeinfo_count);
> 
> You can't include format specifiers in translatable strings because
> xgettext (the translatable string extractor) chokes on it.
> 
> The right way to do it would be to
>  _("value %s"), apr_psprintf("%" APR_INT64_T_FMT, noderev->mergeinfo_count)

It would be nicer to have xgettext use cpp on the source code before processing 
it.  Is there a way we can do that?

Does our build system require using configure before using xgettext?  We could 
create a source tree with cpp processed .c files and have xgettext process that.

Blair

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org