[PATCH] debuginstall: don't translate encoding messages

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

[PATCH] debuginstall: don't translate encoding messages

Yuya Nishihara
# HG changeset patch
# User Yuya Nishihara <[hidden email]>
# Date 1594289812 -32400
#      Thu Jul 09 19:16:52 2020 +0900
# Node ID fb3564e1caa7aab9dd818ef91f13b41201f36302
# Parent  f43bc4ce0d697051135ff21080b7794e6aaea8bf
debuginstall: don't translate encoding messages

While Microsoft trained us to read mojibake text, it doesn't make sense
to print mojibake messages when debugging the exact issue.

diff --git a/mercurial/debugcommands.py b/mercurial/debugcommands.py
--- a/mercurial/debugcommands.py
+++ b/mercurial/debugcommands.py
@@ -1465,8 +1465,8 @@ def debuginstall(ui, **opts):
     fm = ui.formatter(b'debuginstall', opts)
     fm.startitem()
 
-    # encoding
-    fm.write(b'encoding', _(b"checking encoding (%s)...\n"), encoding.encoding)
+    # encoding might be unknown or wrong. don't translate these messages.
+    fm.write(b'encoding', b"checking encoding (%s)...\n", encoding.encoding)
     err = None
     try:
         codecs.lookup(pycompat.sysstr(encoding.encoding))
@@ -1476,7 +1476,7 @@ def debuginstall(ui, **opts):
     fm.condwrite(
         err,
         b'encodingerror',
-        _(b" %s\n (check that your locale is properly set)\n"),
+        b" %s\n (check that your locale is properly set)\n",
         err,
     )
 
_______________________________________________
Mercurial-devel mailing list
[hidden email]
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH] debuginstall: don't translate encoding messages

Augie Fackler-2
On Thu, Jul 09, 2020 at 07:59:22PM +0900, Yuya Nishihara wrote:
> # HG changeset patch
> # User Yuya Nishihara <[hidden email]>
> # Date 1594289812 -32400
> #      Thu Jul 09 19:16:52 2020 +0900
> # Node ID fb3564e1caa7aab9dd818ef91f13b41201f36302
> # Parent  f43bc4ce0d697051135ff21080b7794e6aaea8bf
> debuginstall: don't translate encoding messages

queued, thanks
_______________________________________________
Mercurial-devel mailing list
[hidden email]
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel