[PATCH 7 of 7] debugignore: make messages translatable

FUJIWARA Katsunori foozy at lares.dti.ne.jp
Wed May 25 13:01:46 EDT 2016


# HG changeset patch
# User FUJIWARA Katsunori <foozy at lares.dti.ne.jp>
# Date 1464195454 -32400
#      Thu May 26 01:57:34 2016 +0900
# Node ID d240fc2f3dcb60ca11faea0e5242de0cf5f8c81d
# Parent  02018ce3e14c00d4699f6a4c8987dc61dd365f23
debugignore: make messages translatable

These messages have been overlooked by check-code, because they start
with non-alphabet character ('%' or '(').

Making these messages translatable seems reasonable, because messages
for ui.note(), ui.status(), ui.progress() and descriptive messages for
ui.write() in "debug" commands are already translatable in many cases.

This is also a part of preparation for making "missing _() in ui
message" detection of check-code more exact.

diff --git a/mercurial/commands.py b/mercurial/commands.py
--- a/mercurial/commands.py
+++ b/mercurial/commands.py
@@ -2521,15 +2521,16 @@ def debugignore(ui, repo, *files, **opts
                             break
             if ignored:
                 if ignored == nf:
-                    ui.write("%s is ignored\n" % f)
+                    ui.write(_("%s is ignored\n") % f)
                 else:
-                    ui.write("%s is ignored because of containing folder %s\n"
+                    ui.write(_("%s is ignored because of "
+                               "containing folder %s\n")
                              % (f, ignored))
                 ignorefile, lineno, line = ignoredata
-                ui.write("(ignore rule in %s, line %d: '%s')\n"
+                ui.write(_("(ignore rule in %s, line %d: '%s')\n")
                          % (ignorefile, lineno, line))
             else:
-                ui.write("%s is not ignored\n" % f)
+                ui.write(_("%s is not ignored\n") % f)
 
 @command('debugindex', debugrevlogopts +
     [('f', 'format', 0, _('revlog format'), _('FORMAT'))],


More information about the Mercurial-devel mailing list