From patchwork Tue May 22 03:17:10 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [3,of,5] githelp: make several strings localizable From: Matt Harbison X-Patchwork-Id: 31801 Message-Id: To: mercurial-devel@mercurial-scm.org Date: Mon, 21 May 2018 23:17:10 -0400 # HG changeset patch # User Matt Harbison # Date 1526957717 14400 # Mon May 21 22:55:17 2018 -0400 # Node ID d00bfbf24df05e8b8e21acf1444ea24f265a6123 # Parent c137053c30e3a477d9f27aa72f0f791d5bcbe5b2 githelp: make several strings localizable diff --git a/hgext/githelp.py b/hgext/githelp.py --- a/hgext/githelp.py +++ b/hgext/githelp.py @@ -67,7 +67,7 @@ def githelp(ui, repo, *args, **kwargs): cmd = args[0] if not cmd in gitcommands: - raise error.Abort("error: unknown git command %s" % (cmd)) + raise error.Abort(_("error: unknown git command %s") % (cmd)) ui.pager('githelp') args = args[1:] @@ -90,7 +90,7 @@ def parseoptions(ui, cmdoptions, args): elif ('-' + ex.opt) in ex.msg: flag = '-' + ex.opt else: - raise error.Abort("unknown option %s" % ex.opt) + raise error.Abort(_("unknown option %s") % ex.opt) try: args.remove(flag) except Exception: @@ -336,7 +336,7 @@ def checkout(ui, repo, *args, **kwargs): cmd = Command('revert') cmd['--all'] = None else: - raise error.Abort("a commit must be specified") + raise error.Abort(_("a commit must be specified")) ui.status((bytes(cmd)), "\n") @@ -386,7 +386,7 @@ def clone(ui, repo, *args, **kwargs): args, opts = parseoptions(ui, cmdoptions, args) if len(args) == 0: - raise error.Abort("a repository to clone must be specified") + raise error.Abort(_("a repository to clone must be specified")) cmd = Command('clone') cmd.append(args[0]) @@ -776,7 +776,7 @@ def rebase(ui, repo, *args, **kwargs): "\n\n")) cmd['-d'] = convert(opts.get('onto')) if len(args) < 2: - raise error.Abort("Expected format: git rebase --onto X Y Z") + raise error.Abort(_("Expected format: git rebase --onto X Y Z")) cmd['-s'] = "'::%s - ::%s'" % (convert(args[1]), convert(args[0])) else: if len(args) == 1: