[library-web] use LINGUAS file if it exists



commit d889b661e86885982b77b7f22894d0c082a92701
Author: Frédéric Péters <fpeters 0d be>
Date:   Fri Jun 19 11:51:54 2020 +0200

    use LINGUAS file if it exists
    
    https://gitlab.gnome.org/Teams/Engagement/release-notes/-/issues/21#note_844087

 src/modtypes/mallard.py | 5 +++++
 1 file changed, 5 insertions(+)
---
diff --git a/src/modtypes/mallard.py b/src/modtypes/mallard.py
index 72092ba..e0e1dc1 100644
--- a/src/modtypes/mallard.py
+++ b/src/modtypes/mallard.py
@@ -249,6 +249,11 @@ class MallardModule(DocModule):
         except IndexError:
             doc_linguas = ['en']
 
+        linguas_filepath = os.path.join(ext_dirname, self.dirname, 'LINGUAS')
+        if os.path.exists(linguas_filepath):
+            doc_linguas = [x.strip() for x in open(linguas_filepath).read().splitlines()
+                           if x.strip() and not x.startswith('#')]
+
         try:
             doc_pages = re.findall(r'(?:DOC_PAGES|HELP_FILES)\s+=\s+(.*)',
                                    self.makefile_am)[0].split()


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