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

Re: [Proposed] Split very long messages by paragraph for easy translate

From: Dongsheng Song <dongsheng.song_at_gmail.com>
Date: Fri, 4 Feb 2011 15:59:01 +0800

On Sun, Nov 14, 2010 at 01:19, Greg Hudson <ghudson_at_mit.edu> wrote:
> On Sat, 2010-11-13 at 10:31 -0500, Daniel Shahaf wrote:
>> Sounds reasonable.
>>
>> What changes to the source code would be required?
>>
>> Do we just change
>>       N_("three\n\nparagraphs\n\nhere\n")
>> to
>>       N_("three\n") N_("paragraphs\n") N_("here\n")
>
> No, that would just result in evaluating gettext on the combined string,
> same as before.  I can see two options for help strings in particular:
>
> 1. Rev svn_opt_subcommand_desc2_t to include an array of help strings
> which are translated and displayed in sequence.
>
> 2. Change print_command_info2 to look at the help string and break it up
> at certain boundaries (such as blank lines or numbered list entries)
> before translating it.
>
> (Mercurial is written in Python, so it has different constraints.)
>

Change svn_opt_subcommand_desc2_t.help from 'const char *' to 'const
char **' maybe break the ABI,
I don't think we can do it in the near future.

Change print_command_info2 have the similarly issues, and it's more
complex to generate and store strings for translating.

I have another approach, introduce a new function to concatenate many
strings, e.g.
const char * svn_opt__string_concat(apr_pool_t *pool, const char *s1, ...)

The last parameter should be NULL to indicate this is the last
parameter, then the very long messages:
N_("para1" "para2" "para3" "..." "paraN")

Can be changed to:
svn_opt__string_concat(N_("para1"), (N_("para2"), (N_("para3"), ...,
(N_("paraN"), NULL)

Why I recall this thread ? Because when I translating today, I found a
message which have 255 lines (svn/main.c:676 ),
It's supper terrible ! I can not image the maintenance work when there
have one line changed only!

Any comments?

--
Dongsheng Song
Received on 2011-02-04 09:00:01 CET

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

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.