[damned-lies] Prioritize LINGUAS files for docs when it exists



commit e4c3bdb0185cb60fa51a9cd5236ac183fb258e30
Author: Claude Paroz <claude 2xlibre net>
Date:   Wed Mar 11 10:07:02 2020 +0100

    Prioritize LINGUAS files for docs when it exists

 stats/utils.py | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)
---
diff --git a/stats/utils.py b/stats/utils.py
index 16c99bd0..4919a1e1 100644
--- a/stats/utils.py
+++ b/stats/utils.py
@@ -624,14 +624,15 @@ def get_doc_linguas(branch, subdir):
     """Get language list in one Makefile.am (either path) """
     linguas = None
     po_path = branch.co_path / subdir
+
+    # Prioritize LINGUAS files when it exists.
+    LINGUAS_path = po_path / "LINGUAS"
+    if LINGUAS_path.exists():
+        return read_linguas_file(LINGUAS_path)
+
     linguas_file = MakefileWrapper.find_file(branch, [po_path, branch.co_path])
     if linguas_file:
         linguas = linguas_file.read_variable("DOC_LINGUAS", "HELP_LINGUAS", "gettext.languages")
-    if linguas is None:
-        # Try to get LINGUAS file like for UI.
-        LINGUAS_path = po_path / "LINGUAS"
-        if LINGUAS_path.exists():
-            return read_linguas_file(LINGUAS_path)
     if linguas is None:
         return {'langs':None,
                 'error': gettext_noop("Don’t know where to look for the DOC_LINGUAS variable, ask the module 
maintainer.") }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]