On Fri, Feb 04, 2011 at 04:10:30PM +0800, Dongsheng Song wrote: > On Fri, Feb 4, 2011 at 15:59, Dongsheng Song <dongsheng.s...@gmail.com> wrote: > > On Sun, Nov 14, 2010 at 01:19, Greg Hudson <ghud...@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.
We won't change svn_opt_subcommand_desc2_t. Instead, we would introduce a new svn_opt_subcommand_desc3_t. > > > > Change print_command_info2 have the similarly issues, and it's more > > complex to generate and store strings for translating. There would be a new print_command_info3. It might be more complext to generate and store multiple strings. But if this helps translators I think we should do it. We must find a nice way of splitting up help texts large help texts like this put too much burden on translators. > > 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 > > > > OOPS, apr_pstrcat can concatenate multiple strings, not need for > svn_opt__string_concat. > http://apr.apache.org/docs/apr/1.4/group__apr__strings.html#g7bd80c95ffb7b3f96bc78e7b5b5b0045 Unfortunately, the help text is part of the definition of a static array. So at the moment we cannot use apr_pstrcat() to split up the help text. Stefan