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

[PATCH] Make translator happy - was - Re: svn commit: r1052029 - /subversion/trunk/subversion/libsvn_repos/commit.c

From: Dongsheng Song <dongsheng_at_apache.org>
Date: Fri, 11 Mar 2011 10:58:34 +0800

On Thu, Dec 23, 2010 at 02:53, <blair_at_apache.org> wrote:
> Author: blair
> Date: Wed Dec 22 18:53:48 2010
> New Revision: 1052029
>
> URL: http://svn.apache.org/viewvc?rev=1052029&view=rev
> Log:
> The error from the post-commit is already self-describing so
> svn_repos__post_commit_error_str() doesn't need to wrap its error with
> a duplicae "post-commit error" text.
>
> Also, i18n the text.
>

1051763 blair if (hook_err1)
1051763 blair {
1051763 blair if (err == hook_err1)
1051763 blair {
1052029 blair if (hook_err2->message)
1052029 blair msg = apr_pstrdup(pool, hook_err2->message);

1) invoke apr_pstrdup, OK

1052029 blair else
1052029 blair msg = _("post-commit hook failed with
no error message");
1051763 blair }
1051763 blair else
1051763 blair {
1052029 blair msg = hook_err2->message
1052029 blair ? hook_err2->message
1052029 blair : _("post-commit hook failed with
no error message.");

2) not invoke apr_pstrdup

1052029 blair msg = apr_psprintf(
1052029 blair pool,
1052029 blair _("post commit FS processing had
error '%s' and %s"),
1052029 blair err->message ? err->message :
_("(no error message)"),
1052029 blair msg);

3) nearly impossible for translate

1051763 blair }
1051763 blair }
1051763 blair else
1051763 blair {
1051988 blair msg = apr_psprintf(pool,
1052029 blair _("post-commit FS
processing had error '%s'."),
1053499 blair err->message ? err->message
1053499 blair : _("(no
error message)"));
1051763 blair }

How about the following patch ?

[[[
* subversion/libsvn_repos/commit.c: Make translator happy.
]]]
Index: commit.c
===================================================================
--- commit.c (revision 1080427)
+++ commit.c (working copy)
@@ -644,16 +644,16 @@
           if (hook_err2->message)
             msg = apr_pstrdup(pool, hook_err2->message);
           else
- msg = _("post-commit hook failed with no error message");
+ msg = _("post-commit hook failed with no error message.");
         }
       else
         {
           msg = hook_err2->message
- ? hook_err2->message
+ ? apr_pstrdup(pool, hook_err2->message)
                   : _("post-commit hook failed with no error message.");
           msg = apr_psprintf(
                   pool,
- _("post commit FS processing had error '%s' and %s"),
+ _("post commit FS processing had error:\n%s\n%s"),
                   err->message ? err->message : _("(no error message)"),
                   msg);
         }
@@ -661,7 +661,7 @@
   else
     {
       msg = apr_psprintf(pool,
- _("post-commit FS processing had error '%s'."),
+ _("post-commit FS processing had error:\n%s"),
                          err->message ? err->message
                                       : _("(no error message)"));
     }

--
Dongsheng
Received on 2011-03-11 03:59:22 CET

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