[PATCH] i18n: translate abort messages

Anton Shestakov engored at ya.ru
Tue Jun 14 08:02:39 EDT 2016


14.06.2016, 19:45, "liscju" <piotr.listkiewicz at gmail.com>:
> # HG changeset patch
> # User liscju <piotr.listkiewicz at gmail.com>
> # Date 1465898035 -7200
> # Tue Jun 14 11:53:55 2016 +0200
> # Node ID 045a18140c1d065b36f1dbdea9c3cc8d62adf36d
> # Parent 60621cecc8c53d3a27e9984fb06fefc1f99797b3
> i18n: translate abort messages
>
> I found a few places where message given to abort is
> not translated, I don't find any reason to not translate
> them.

...

> diff --git a/mercurial/scmutil.py b/mercurial/scmutil.py
> --- a/mercurial/scmutil.py
> +++ b/mercurial/scmutil.py
> @@ -461,7 +461,8 @@ class abstractvfs(object):
>          # have a use case.
>          vfs = getattr(self, 'vfs', self)
>          if getattr(vfs, '_backgroundfilecloser', None):
> - raise error.Abort('can only have 1 active background file closer')
> + raise error.Abort(
> + _('can only have 1 active background file closer'))
>
>          with backgroundfilecloser(ui, expectedcount=expectedcount) as bfc:
>              try:
> @@ -581,8 +582,9 @@ class vfs(abstractvfs):
>
>          if backgroundclose:
>              if not self._backgroundfilecloser:
> - raise error.Abort('backgroundclose can only be used when a '
> + raise error.Abort(_('backgroundclose can only be used when a '
>                                    'backgroundclosing context manager is active')
> + )

Tiny stylistic nit: it may be worth it to move this message on the next line (just like what the previous hunk does) to avoid the lone hanging parenthesis.

Otherwise LGTM.

(Awfully sorry for my mailer messing up all the white space)


More information about the Mercurial-devel mailing list