[damned-lies] Support LINGUAS file also for doc domains



commit 7c80a3744b90d260641d4c4ff48b365f679c02b4
Author: Claude Paroz <claude 2xlibre net>
Date:   Mon Mar 5 15:52:38 2018 +0100

    Support LINGUAS file also for doc domains

 stats/utils.py |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
---
diff --git a/stats/utils.py b/stats/utils.py
index 7df8fb8..aad01d3 100644
--- a/stats/utils.py
+++ b/stats/utils.py
@@ -581,6 +581,11 @@ def get_doc_linguas(module_path, po_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 = os.path.join(po_path, "LINGUAS")
+        if os.access(LINGUAS_path, os.R_OK):
+            linguas = read_linguas_file(LINGUAS_path)
+    if linguas is None:
         return {'langs':None,
                 'error': ugettext_noop("Don’t know where to look for the DOC_LINGUAS variable, ask the 
module maintainer.") }
     return {'langs': linguas.split() if isinstance(linguas, str) else linguas,


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