You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by Berin Babcock-McConnell <sp...@users.sourceforge.net> on 2012/03/20 08:24:11 UTC
Subversion log format in Japanese
Hello,
I have a question regarding the format of the date displayed in the log
of a repository when using a Japanese locale. Specifically, the format
of the "human timestamp format suffix" (as it is described in
libsvn_subr/time.c) doesn't seem to be quite right and I'm wondering if
there is a reason for the format as it is.
For example, if you were to execute
$ svn log http://svn.apache.org/repos/asf/subversion
in English you would see date lines such as
"r1302758 | hwright | 2012-03-20 11:34:26 +0900 (Tue, 20 Mar 2012) | 14
lines"
The "(Tue, 20 Mar 2012)" part is dictated by the "human timestamp format
suffix" in libsvn_subr/time.c and in Japanese if you execute the same
command you get,
"r1302758 | hwright | 2012-03-20 11:34:26 +0900 (火, 20 3月 2012) | 14
lines"
This doesn't seem to be right because the order is the exact opposite of
what one would expect (normally this would be ordered as year, month,
day, day of week) and only the month has the character for month
(whereas the day and year do not have the characters for day and year so
there is a lack of consistency).
In other words, I would expect that in Japanese I would get something like,
"r1302758 | hwright | 2012-03-20 11:34:26 +0900 (2012年3月20日 (火)) |
14 lines"
I have adjusted this on my system by changing the msgstr for msgid "
(%a, %d %b %Y)" from " (%a, %d %b %Y)" to " (%x (%a))".
This feels like a bug to me and I looked at the latest version of the
Japanese po file (revision 1302772, line 6238) and I see that the format
is still " (%a, %d %b %Y)". I have googled around a bit and looked in
through the issue list, etc, and I haven't found any discussion on this
and I'm wondering if there is a particular reason for this format or is
it just that nobody has said anything yet or...?
Berin
Re: Subversion log format in Japanese
Posted by Berin Babcock-McConnell <sp...@users.sourceforge.net>.
(2012年03月21日 00:43), Stefan Sperling wrote:
> There is this comment in fr.po:
>
> # Hmmm... what about "%x" (preferred date representation in locale)
> # instead?
Yes, I used %x when I fixed this on my system because it nicely produces
most of what I wanted. Unfortunately it doesn't produce everything.
Nor does it appear to produce the right thing across locales (more on
this below).
> I don't really know either. This subject is new to me, too.
>
> You're right that there is precedent for changing the format string
> in localised text and also re-arrange the format specifiers (ko.po,
> pl.po, and zh_CN.po).
>
> So as a first step, we could fix the format string in ja.po as you
> suggest. Do you want to send a patch for that?
> See http://subversion.apache.org/docs/community-guide/general.html#patches
> and http://subversion.apache.org/docs/community-guide/l10n.html for
> background information about translations.
>
> We could also investigate if %x is acceptable and works as expected
> everywhere.
>
> Choose whichever path forward you prefer :)
I reexamined the documentation for strftime() today and I don't think
there is any one format string that will produce the correct result
across all locales. I also tried to have a look at actual output (using
the date command though...) for %x, %Ex, %c, and %Ec for the locales for
which Subversion has localizations and the results did not consistently
match the localized human_timestamp_format_suffix strings...
So, it seems like we have no choice but maintain localized
human_timestamp_format_suffix as is currently done.
With this in mind I will prepare a patch for the ja.po file (although I
need to attend to some other things this evening so I expect to do this
in the next day or so).
Beyond fixing the ja.po file, your suggestion for a new feature to make
the format string configurable seems nice too but I imagine there would
need to be some discussion on the best way to do this first...
Re: Subversion log format in Japanese
Posted by Stefan Sperling <st...@elego.de>.
On Tue, Mar 20, 2012 at 11:46:58PM +0900, Berin Babcock-McConnell wrote:
> If there were an alternate strftime() format string that produces
> the correct result in all languages that would be great. But it
> seems that there is not and that is why there is a localization
> string in the po file, right?
There is this comment in fr.po:
# Hmmm... what about "%x" (preferred date representation in locale)
# instead?
> I can see why it might be nice to give people a slightly more
> flexible method for overriding the format string than updating their
> local mo file and in googling this I got the feeling some client
> (maybe Turtoise?) allows you to do this with properties (although
> I'm not sure since I didn't pursue this)...
>
> But I'm suggesting that the current string for
> human_timestamp_format_suffix in the ja.po file isn't the best.
>
> I've noticed that many other languages have
> human_timestamp_format_suffix strings that differ from the default
> and I'm wondering why this is not the case with Japanese?
I don't really know either. This subject is new to me, too.
You're right that there is precedent for changing the format string
in localised text and also re-arrange the format specifiers (ko.po,
pl.po, and zh_CN.po).
So as a first step, we could fix the format string in ja.po as you
suggest. Do you want to send a patch for that?
See http://subversion.apache.org/docs/community-guide/general.html#patches
and http://subversion.apache.org/docs/community-guide/l10n.html for
background information about translations.
We could also investigate if %x is acceptable and works as expected
everywhere.
Choose whichever path forward you prefer :)
Re: Subversion log format in Japanese
Posted by Berin Babcock-McConnell <sp...@users.sourceforge.net>.
(2012年03月20日 21:04), Stefan Sperling wrote:
> On Tue, Mar 20, 2012 at 04:24:11PM +0900, Berin Babcock-McConnell wrote:
>> Hello,
>>
>> I have a question regarding the format of the date displayed in the
>> log of a repository when using a Japanese locale. Specifically, the
>> format of the "human timestamp format suffix" (as it is described in
>> libsvn_subr/time.c) doesn't seem to be quite right and I'm wondering
>> if there is a reason for the format as it is.
>>
>> For example, if you were to execute
>>
>> $ svn log http://svn.apache.org/repos/asf/subversion
>>
>> in English you would see date lines such as
>>
>> "r1302758 | hwright | 2012-03-20 11:34:26 +0900 (Tue, 20 Mar 2012) |
>> 14 lines"
>>
>> The "(Tue, 20 Mar 2012)" part is dictated by the "human timestamp
>> format suffix" in libsvn_subr/time.c and in Japanese if you execute
>> the same command you get,
>>
>> "r1302758 | hwright | 2012-03-20 11:34:26 +0900 (火, 20 3月 2012) |
>> 14 lines"
>>
>> This doesn't seem to be right because the order is the exact
>> opposite of what one would expect (normally this would be ordered as
>> year, month, day, day of week) and only the month has the character
>> for month (whereas the day and year do not have the characters for
>> day and year so there is a lack of consistency).
>>
>> In other words, I would expect that in Japanese I would get something like,
>>
>> "r1302758 | hwright | 2012-03-20 11:34:26 +0900 (2012年3月20日 (火))
>> | 14 lines"
>>
>> I have adjusted this on my system by changing the msgstr for msgid "
>> (%a, %d %b %Y)" from " (%a, %d %b %Y)" to " (%x (%a))".
>>
>> This feels like a bug to me and I looked at the latest version of
>> the Japanese po file (revision 1302772, line 6238) and I see that
>> the format is still " (%a, %d %b %Y)". I have googled around a bit
>> and looked in through the issue list, etc, and I haven't found any
>> discussion on this and I'm wondering if there is a particular reason
>> for this format or is it just that nobody has said anything yet
>> or...?
>
> Did you see this part of the comment above the human-readable date
> format string?
>
> * [..] The
> * human explanatory part is generated by apr_strftime, which means
> * that its generation can be affected by locale, it can fail and it
> * doesn't need to be constant in size. In other words, perfect to be
> * converted to a configuration option later on.
>
> IOW, there are many strftime() format flags people might want to use.
> The correct date format can be based on the locale. But it might just
> as well be based on personal preferences.
>
> So the strftime() format string for the human-readable part of the date
> is hardcoded in the code right now and it is unfortunate that this looks
> bad in some locales.
>
> Is there an alternative strftime() format string that would produce
> the desired result in English, Japanese and any other language?
> If so, we could use that instead.
>
> Or we could add a new feature to make the format string configurable.
> As the comment suggests, there could be a client-side configuration
> option that allows users to specify an strftime() compatible format
> string that Subversion should use here, with the current format
> string as default.
>
> Would you like to submit a patch that implements either of these approaches?
Yes, I did notice that comment. I also noticed the following comment in
the po file,
TRANSLATION-FIXME: If APR supported reordering of
format indicators.... Human explanatory part, generated
by apr_strftime as "Sat, 01 Jan 2000"
To be honest neither made much sense to me because my understanding is
that the locale dependent string is getting printed out. In other
words, Subversion takes human_timestamp_format_suffix and asks for the
format string that is appropriate for the current locale.
If there were an alternate strftime() format string that produces the
correct result in all languages that would be great. But it seems that
there is not and that is why there is a localization string in the po
file, right?
I can see why it might be nice to give people a slightly more flexible
method for overriding the format string than updating their local mo
file and in googling this I got the feeling some client (maybe
Turtoise?) allows you to do this with properties (although I'm not sure
since I didn't pursue this)...
But I'm suggesting that the current string for
human_timestamp_format_suffix in the ja.po file isn't the best.
I've noticed that many other languages have
human_timestamp_format_suffix strings that differ from the default and
I'm wondering why this is not the case with Japanese?
Re: Subversion log format in Japanese
Posted by Stefan Sperling <st...@elego.de>.
On Tue, Mar 20, 2012 at 04:24:11PM +0900, Berin Babcock-McConnell wrote:
> Hello,
>
> I have a question regarding the format of the date displayed in the
> log of a repository when using a Japanese locale. Specifically, the
> format of the "human timestamp format suffix" (as it is described in
> libsvn_subr/time.c) doesn't seem to be quite right and I'm wondering
> if there is a reason for the format as it is.
>
> For example, if you were to execute
>
> $ svn log http://svn.apache.org/repos/asf/subversion
>
> in English you would see date lines such as
>
> "r1302758 | hwright | 2012-03-20 11:34:26 +0900 (Tue, 20 Mar 2012) |
> 14 lines"
>
> The "(Tue, 20 Mar 2012)" part is dictated by the "human timestamp
> format suffix" in libsvn_subr/time.c and in Japanese if you execute
> the same command you get,
>
> "r1302758 | hwright | 2012-03-20 11:34:26 +0900 (火, 20 3月 2012) |
> 14 lines"
>
> This doesn't seem to be right because the order is the exact
> opposite of what one would expect (normally this would be ordered as
> year, month, day, day of week) and only the month has the character
> for month (whereas the day and year do not have the characters for
> day and year so there is a lack of consistency).
>
> In other words, I would expect that in Japanese I would get something like,
>
> "r1302758 | hwright | 2012-03-20 11:34:26 +0900 (2012年3月20日 (火))
> | 14 lines"
>
> I have adjusted this on my system by changing the msgstr for msgid "
> (%a, %d %b %Y)" from " (%a, %d %b %Y)" to " (%x (%a))".
>
> This feels like a bug to me and I looked at the latest version of
> the Japanese po file (revision 1302772, line 6238) and I see that
> the format is still " (%a, %d %b %Y)". I have googled around a bit
> and looked in through the issue list, etc, and I haven't found any
> discussion on this and I'm wondering if there is a particular reason
> for this format or is it just that nobody has said anything yet
> or...?
Did you see this part of the comment above the human-readable date
format string?
* [..] The
* human explanatory part is generated by apr_strftime, which means
* that its generation can be affected by locale, it can fail and it
* doesn't need to be constant in size. In other words, perfect to be
* converted to a configuration option later on.
IOW, there are many strftime() format flags people might want to use.
The correct date format can be based on the locale. But it might just
as well be based on personal preferences.
So the strftime() format string for the human-readable part of the date
is hardcoded in the code right now and it is unfortunate that this looks
bad in some locales.
Is there an alternative strftime() format string that would produce
the desired result in English, Japanese and any other language?
If so, we could use that instead.
Or we could add a new feature to make the format string configurable.
As the comment suggests, there could be a client-side configuration
option that allows users to specify an strftime() compatible format
string that Subversion should use here, with the current format
string as default.
Would you like to submit a patch that implements either of these approaches?