You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Karl Fogel <kf...@red-bean.com> on 2007/09/10 19:18:55 UTC

Re: For consistency mark some dates and strings for localization

Arfrever Frehtes Taifersar Arahesis <ar...@gmail.com> writes:
> I'm attaching a new patch. I hope that it won't be forgotten.
>
> [[[
> Mark some dates and strings for localization.
>
> * subversion/libsvn_diff/diff_file.c
>   (output_unified_default_hdr): Mark a date for localization.
> * subversion/svn/list-cmd.c
>   (print_dirent): Mark dates for localization.
> * subversion/svnlook/main.c
>   (generate_label): Mark strings for localization.
>   "txn" and "rev" are translatable here.
>
> Patch by: Arfrever Frehtes Taifersar Arahesis <ar...@gmail.com>
> ]]]

First, thanks for including a log message with the patch :-).  And I
see you already got Hyrum's mail about "[PATCH]" in the subject
header, so no problem there.

I was just discussing your patch with Erik Hülsmann in IRC.  In the
end, we weren't convinced that it should be applied.  Here's our
conversation:

   <kfogel>  Is it our norm to localize date formats?  Someone just
             posted a patch that does, e.g., this:
   
   <kfogel>  -      "%a %b %e :%M:%S %Y", &exploded_time);
             +    _("%a %b %e :%M:%S %Y"), &exploded_time);
   
   <ehu>     kfogel: I meant to answer that mail. He already did so for
             another date. But I think we shouldn't do that.
   
   <ehu>     kfogel: Because that is already part of the locale data
   
   <kfogel>  ehu: that's what I was worried about.
   
   <kfogel>  Want me to just follow up w/ an edited transcript of our IRC
             conversation right now?  (save you some time)
   
   <ehu>     please, yes.
   
   <ehu>     I've looked at strftime and it provides %c (courtisy of
             Yorick?)
   
   <ehu>     which is documented to 'return the date format in the
             specific locale'
   
   <kfogel>  aha
   
   <ehu>     to be exact:
   
   <ehu>     %c     The preferred date  and  time  representation  for
             the  current locale
   
   <kfogel>  What about the part of his patch that applies to diff
             labels?
   
   <kfogel>  e.g.: 
   
   <kfogel>     if (name)
             -    *label = apr_psprintf(pool, "%s\t%s (txn %s)",
             +    *label = apr_psprintf(pool, _("%s\t%s (txn %s)"),
                                        path, datestr, name);
                else
             -    *label = apr_psprintf(pool, "%s\t%s (rev %ld)",
             +    *label = apr_psprintf(pool, _("%s\t%s (rev %ld)"),
                                        path, datestr, rev);
   
   <ehu>     no way. that's just diff specific. Why would that need
             translation? There's not even a real word there!?
   
   <kfogel>  yeah, "txn" and "rev" don't really need to get translated
             anyway, right?
   
   <kfogel>  or do they?
   
   <ehu>     I think (rev %ld) should have been (r%ld) though
   
   <kfogel>  good point!
   
   <kfogel>  that's a separate commit; I'll just do that and see if
             anyone complains.
   
   <ehu>     And personally, I never saw txn appear anywhere.
   
   <kfogel>  I highly doubt anyone is parsing that part of the format,
             and if they are, they can easily adjust
   
   <kfogel>  maybe the txn part is new, I don't know
   
   <ehu>     never mind that. I've never seen a complaint someone didn't
             understand the rev part.
   
   <ehu>     which is about to disappear anyway.
   
   <ehu>     txn isn't common enough (in output) to bother translators
             with.
   
   <ehu>     (imo)
   
   <kfogel>  "rev" is about to disappear?
   
   <kfogel>  (oh, you mean to "r"?)
   
   <ehu>     yup
   
   <kfogel>  gotcha
   
   <kfogel>  okay, responding to original poster now

   <ehu>     thanks

So right now, I think it wouldn't be applied.  If we're missing
something important, please let us know.

Below is your patch, just for reference.

Best,
-Karl


> Index: subversion/libsvn_diff/diff_file.c
> ===================================================================
> --- subversion/libsvn_diff/diff_file.c	(revision 26497)
> +++ subversion/libsvn_diff/diff_file.c	(working copy)
> @@ -1058,7 +1058,7 @@
>    apr_time_exp_lt(&exploded_time, file_info.mtime);
>  
>    apr_strftime(time_buffer, &time_len, sizeof(time_buffer) - 1,
> -               "%a %b %e %H:%M:%S %Y", &exploded_time);
> +               _("%a %b %e %H:%M:%S %Y"), &exploded_time);
>  
>    *header = apr_psprintf(pool, "%s\t%s", path, time_buffer);
>  
> Index: subversion/svn/list-cmd.c
> ===================================================================
> --- subversion/svn/list-cmd.c	(revision 26497)
> +++ subversion/svn/list-cmd.c	(working copy)
> @@ -87,12 +87,12 @@
>            && apr_time_sec(dirent->time - now) < (365 * 86400 / 2))
>          {
>            apr_err = apr_strftime(timestr, &size, sizeof(timestr),
> -                                 "%b %d %H:%M", &exp_time);
> +                                 _("%b %d %H:%M"), &exp_time);
>          }
>        else
>          {
>            apr_err = apr_strftime(timestr, &size, sizeof(timestr),
> -                                 "%b %d  %Y", &exp_time);
> +                                 _("%b %d  %Y"), &exp_time);
>          }
>  
>        /* if that failed, just zero out the string and print nothing */
> Index: subversion/svnlook/main.c
> ===================================================================
> --- subversion/svnlook/main.c	(revision 26497)
> +++ subversion/svnlook/main.c	(working copy)
> @@ -700,10 +700,10 @@
>      datestr = "                       ";
>  
>    if (name)
> -    *label = apr_psprintf(pool, "%s\t%s (txn %s)",
> +    *label = apr_psprintf(pool, _("%s\t%s (txn %s)"),
>                            path, datestr, name);
>    else
> -    *label = apr_psprintf(pool, "%s\t%s (rev %ld)",
> +    *label = apr_psprintf(pool, _("%s\t%s (rev %ld)"),
>                            path, datestr, rev);
>    return SVN_NO_ERROR;
>  }

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


Re: [PATCH] For consistency mark some dates and strings for localization

Posted by Karl Fogel <kf...@red-bean.com>.
Arfrever Frehtes Taifersar Arahesis <ar...@gmail.com> writes:
>> The patch below looks good to me -- I guess the translator would just
>> rearrange the % codes in whatever order was appropriate?
>> 
>> I'd prefer for someone more familiar with translation/localization
>> issues to agree before I commit, though, in case I'm missing something
>> obvious.
>
> Fortunately you aren't missing anything :) .
> I confirm that that patch works correctly with Polish translation.

r26588.  We'll see if anyone thinks otherwise :-).

Thanks for the patch,
-Karl

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

Re: [PATCH] For consistency mark some dates and strings for localization

Posted by Arfrever Frehtes Taifersar Arahesis <ar...@gmail.com>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

2007-09-14 03:22:02 Karl Fogel napisał(a):
> Arfrever Frehtes Taifersar Arahesis <ar...@gmail.com> writes:
> > So what do you think about this small, reduced patch, which I'm
> > attaching now?  As mentioned earlier, localization of dates in `svn
> > ls -v` would be consistent with localization of dates in `ls -l`.
> 
> The patch below looks good to me -- I guess the translator would just
> rearrange the % codes in whatever order was appropriate?
> 
> I'd prefer for someone more familiar with translation/localization
> issues to agree before I commit, though, in case I'm missing something
> obvious.

Fortunately you aren't missing anything :) .
I confirm that that patch works correctly with Polish translation.

- -- 
Arfrever Frehtes Taifersar Arahesis
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.7 (GNU/Linux)

iD8DBQFG6gTD/axNJ4Xo/ZERAht3AJ4pZS3PLuppSduAYxilgsQ1tBntwwCeNOV1
obPHaOKgo+K7nJ6sTu/cvBM=
=uNob
-----END PGP SIGNATURE-----

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

Re: [PATCH] For consistency mark some dates and strings for localization

Posted by Karl Fogel <kf...@red-bean.com>.
Arfrever Frehtes Taifersar Arahesis <ar...@gmail.com> writes:
> So what do you think about this small, reduced patch, which I'm
> attaching now?  As mentioned earlier, localization of dates in `svn
> ls -v` would be consistent with localization of dates in `ls -l`.

The patch below looks good to me -- I guess the translator would just
rearrange the % codes in whatever order was appropriate?

I'd prefer for someone more familiar with translation/localization
issues to agree before I commit, though, in case I'm missing something
obvious.  Anyone?

-K

> [[[
> Mark dates for localization.
>
> * subversion/svn/list-cmd.c
>   (print_dirent): Mark dates for localization.
>
> Patch by: Arfrever Frehtes Taifersar Arahesis <ar...@gmail.com>
> ]]]
>
> Index: subversion/svn/list-cmd.c
> ===================================================================
> --- subversion/svn/list-cmd.c	(revision 26580)
> +++ subversion/svn/list-cmd.c	(working copy)
> @@ -87,12 +87,12 @@
>            && apr_time_sec(dirent->time - now) < (365 * 86400 / 2))
>          {
>            apr_err = apr_strftime(timestr, &size, sizeof(timestr),
> -                                 "%b %d %H:%M", &exp_time);
> +                                 _("%b %d %H:%M"), &exp_time);
>          }
>        else
>          {
>            apr_err = apr_strftime(timestr, &size, sizeof(timestr),
> -                                 "%b %d  %Y", &exp_time);
> +                                 _("%b %d  %Y"), &exp_time);
>          }
>  
>        /* if that failed, just zero out the string and print nothing */

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


Re: [PATCH] For consistency mark some dates and strings for localization

Posted by Arfrever Frehtes Taifersar Arahesis <ar...@gmail.com>.
2007-09-10 22:32:11 Arfrever Frehtes Taifersar Arahesis napisał(a):
> 2007-09-10 21:46:02 Erik Huelsmann napisał(a):
> > On 9/10/07, Arfrever Frehtes Taifersar Arahesis <ar...@gmail.com> wrote:
> > > 2007-09-10 21:18:32 Karl Fogel napisał(a):
> > > > So right now, I think it wouldn't be applied.  If we're missing
> > > > something important, please let us know.
> > >
> > > Thanks for reply.
> > >
> > > %c is too long for `svn ls -v`. Its localization would be also consistent with e.g. `ls -l`.
> > >
> > > I don't have strong arguments for localization of "%a %b %e %H:%M:%S %Y", but e.g. in
> > > Simplified Chinese the order is "year month day" instead of "month day year", so maybe Cauchy
> > > would like to localize it.
> > >
> > > No problem in case of "txn" and "rev".
> > >
> > > For me, the most important would be the localization of dates in `svn ls -v`.
> >
> > Understood. Maybe you could have a look at how ls localized it's
> > output? Did they do it the way you do, or do they use some other %
> > format specifier from strftime?
> 
> <Coreutils-6.9>/src/ls.c: Lines 672-693:
> /* strftime formats for non-recent and recent files, respectively, in
>    -l output.  */
> 
> static char const *long_time_format[2] =
>   {
>     /* strftime format for non-recent files (older than 6 months), in
>        -l output.  This should contain the year, month and day (at
>        least), in an order that is understood by people in your
>        locale's territory.  Please try to keep the number of used
>        screen columns small, because many people work in windows with
>        only 80 columns.  But make this as wide as the other string
>        below, for recent files.  */
>     N_("%b %e  %Y"),
>     /* strftime format for recent files (younger than 6 months), in -l
>        output.  This should contain the month, day and time (at
>        least), in an order that is understood by people in your
>        locale's territory.  Please try to keep the number of used
>        screen columns small, because many people work in windows with
>        only 80 columns.  But make this as wide as the other string
>        above, for non-recent files.  */
>     N_("%b %e %H:%M")
>   };

So what do you think about this small, reduced patch, which I'm attaching now?
As mentioned earlier, localization of dates in `svn ls -v` would be consistent
with localization of dates in `ls -l`.

[[[
Mark dates for localization.

* subversion/svn/list-cmd.c
  (print_dirent): Mark dates for localization.

Patch by: Arfrever Frehtes Taifersar Arahesis <ar...@gmail.com>
]]]

-- 
Arfrever Frehtes Taifersar Arahesis

Re: For consistency mark some dates and strings for localization

Posted by Arfrever Frehtes Taifersar Arahesis <ar...@gmail.com>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

2007-09-10 21:46:02 Erik Huelsmann napisał(a):
> On 9/10/07, Arfrever Frehtes Taifersar Arahesis <ar...@gmail.com> wrote:
> > -----BEGIN PGP SIGNED MESSAGE-----
> > Hash: SHA1
> >
> > 2007-09-10 21:18:32 Karl Fogel napisał(a):
> > > So right now, I think it wouldn't be applied.  If we're missing
> > > something important, please let us know.
> >
> > Thanks for reply.
> >
> > %c is too long for `svn ls -v`. Its localization would be also consistent with e.g. `ls -l`.
> >
> > I don't have strong arguments for localization of "%a %b %e %H:%M:%S %Y", but e.g. in
> > Simplified Chinese the order is "year month day" instead of "month day year", so maybe Cauchy
> > would like to localize it.
> >
> > No problem in case of "txn" and "rev".
> >
> > For me, the most important would be the localization of dates in `svn ls -v`.
> 
> Understood. Maybe you could have a look at how ls localized it's
> output? Did they do it the way you do, or do they use some other %
> format specifier from strftime?

<Coreutils-6.9>/src/ls.c: Lines 672-693:
/* strftime formats for non-recent and recent files, respectively, in
   -l output.  */

static char const *long_time_format[2] =
  {
    /* strftime format for non-recent files (older than 6 months), in
       -l output.  This should contain the year, month and day (at
       least), in an order that is understood by people in your
       locale's territory.  Please try to keep the number of used
       screen columns small, because many people work in windows with
       only 80 columns.  But make this as wide as the other string
       below, for recent files.  */
    N_("%b %e  %Y"),
    /* strftime format for recent files (younger than 6 months), in -l
       output.  This should contain the month, day and time (at
       least), in an order that is understood by people in your
       locale's territory.  Please try to keep the number of used
       screen columns small, because many people work in windows with
       only 80 columns.  But make this as wide as the other string
       above, for non-recent files.  */
    N_("%b %e %H:%M")
  };


<I'm subscribed to this list.>

- -- 
Arfrever Frehtes Taifersar Arahesis
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.6 (GNU/Linux)

iD8DBQFG5aoQ/axNJ4Xo/ZERAh/yAJ9Z/xNNC826Vs1saKkdlhhl69hhngCfQIXI
FniFrtQiZUPAMfj3PmgRakc=
=dhsw
-----END PGP SIGNATURE-----

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

Re: For consistency mark some dates and strings for localization

Posted by Erik Huelsmann <eh...@gmail.com>.
On 9/10/07, Arfrever Frehtes Taifersar Arahesis <ar...@gmail.com> wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> 2007-09-10 21:18:32 Karl Fogel napisał(a):
> > So right now, I think it wouldn't be applied.  If we're missing
> > something important, please let us know.
>
> Thanks for reply.
>
> %c is too long for `svn ls -v`. Its localization would be also consistent with e.g. `ls -l`.
>
> I don't have strong arguments for localization of "%a %b %e %H:%M:%S %Y", but e.g. in
> Simplified Chinese the order is "year month day" instead of "month day year", so maybe Cauchy
> would like to localize it.
>
> No problem in case of "txn" and "rev".
>
> For me, the most important would be the localization of dates in `svn ls -v`.

Understood. Maybe you could have a look at how ls localized it's
output? Did they do it the way you do, or do they use some other %
format specifier from strftime?

I hope the latter, in which case we should probably use the same
format specifier.

Thanks for your contributions!

bye,


Erik.

Re: For consistency mark some dates and strings for localization

Posted by Arfrever Frehtes Taifersar Arahesis <ar...@gmail.com>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

2007-09-10 21:18:32 Karl Fogel napisał(a):
> So right now, I think it wouldn't be applied.  If we're missing
> something important, please let us know.

Thanks for reply.

%c is too long for `svn ls -v`. Its localization would be also consistent with e.g. `ls -l`.

I don't have strong arguments for localization of "%a %b %e %H:%M:%S %Y", but e.g. in
Simplified Chinese the order is "year month day" instead of "month day year", so maybe Cauchy
would like to localize it.

No problem in case of "txn" and "rev".

For me, the most important would be the localization of dates in `svn ls -v`.

- -- 
Arfrever Frehtes Taifersar Arahesis
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.6 (GNU/Linux)

iD8DBQFG5Z3o/axNJ4Xo/ZERAoU4AKCahLO99IiSy0dNgyoXhkSYDbDmvQCfaV7+
iMpyJ7alB2KXdIrCrOkGaMo=
=c4/J
-----END PGP SIGNATURE-----

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