Patchwork [1,of,8,V2] gendoc: make sure locale path is set before loading any modules

login
register
mail settings
Submitter Yuya Nishihara
Date May 19, 2017, 3:25 p.m.
Message ID <329d4934ca617e7044d1.1495207511@mimosa>
Download mbox | patch
Permalink /patch/20720/
State Accepted
Headers show

Comments

Yuya Nishihara - May 19, 2017, 3:25 p.m.
# HG changeset patch
# User Yuya Nishihara <yuya@tcha.org>
# Date 1494665635 -32400
#      Sat May 13 17:53:55 2017 +0900
# Node ID 329d4934ca617e7044d1e5be2daa664043a97078
# Parent  763d7292569138886c3fdf179f7e688351bfb212
gendoc: make sure locale path is set before loading any modules

Otherwise some messages wouldn't be translated depending on when the util
was loaded.

Patch

diff --git a/doc/gendoc.py b/doc/gendoc.py
--- a/doc/gendoc.py
+++ b/doc/gendoc.py
@@ -16,6 +16,10 @@  os.environ['HGMODULEPOLICY'] = 'allow'
 # import from the live mercurial repo
 sys.path.insert(0, "..")
 from mercurial import demandimport; demandimport.enable()
+# Load util so that the locale path is set by i18n.setdatapath() before
+# calling _().
+from mercurial import util
+util.datapath
 from mercurial import (
     commands,
     extensions,