diff --git a/contrib/check-code.py b/contrib/check-code.py
index 8083f4d00bd102d8661b49df0dbd63bea0279dee_Y29udHJpYi9jaGVjay1jb2RlLnB5..6c7283faa967741009f8223b04b1098ada8ec552_Y29udHJpYi9jaGVjay1jb2RlLnB5 100755
--- a/contrib/check-code.py
+++ b/contrib/check-code.py
@@ -178,6 +178,7 @@
     (r'[\s\(](open|file)\([^)]*\)\.',
      "always assign an opened file to a variable, and close it afterwards"),
     (r'(?i)descendent', "the proper spelling is descendAnt"),
+    (r'\.debug\(\_', "don't mark debug messages for translation"),
   ],
   # warnings
   [
diff --git a/hgext/relink.py b/hgext/relink.py
index 8083f4d00bd102d8661b49df0dbd63bea0279dee_aGdleHQvcmVsaW5rLnB5..6c7283faa967741009f8223b04b1098ada8ec552_aGdleHQvcmVsaW5rLnB5 100644
--- a/hgext/relink.py
+++ b/hgext/relink.py
@@ -117,7 +117,7 @@
         tgt = os.path.join(dst, fn)
         ts = linkfilter(srcpath, tgt, st)
         if not ts:
-            ui.debug(_('not linkable: %s\n') % fn)
+            ui.debug('not linkable: %s\n' % fn)
             continue
         targets.append((fn, ts.st_size))
         ui.progress(_('pruning'), pos, fn, _('files'), total)
@@ -159,7 +159,7 @@
         sfp.close()
         dfp.close()
         if sin:
-            ui.debug(_('not linkable: %s\n') % f)
+            ui.debug('not linkable: %s\n' % f)
             continue
         try:
             relinkfile(source, tgt)