← Back to team overview

widelands-dev team mailing list archive

[Merge] lp:~widelands-dev/widelands-website/bug-1807701_string_fixes_website into lp:widelands-website

 

kaputtnik has proposed merging lp:~widelands-dev/widelands-website/bug-1807701_string_fixes_website into lp:widelands-website.

Commit message:
Needed changes for the change to developers.json in bug 1807701

Requested reviews:
  Widelands Developers (widelands-dev)
Related bugs:
  Bug #1807701 in Widelands Website: "Extraneous TRANSLATORS comment"
  https://bugs.launchpad.net/widelands-website/+bug/1807701

For more details, see:
https://code.launchpad.net/~widelands-dev/widelands-website/bug-1807701_string_fixes_website/+merge/361402
-- 
Your team Widelands Developers is requested to review the proposed merge of lp:~widelands-dev/widelands-website/bug-1807701_string_fixes_website into lp:widelands-website.
=== modified file 'mainpage/views.py'
--- mainpage/views.py	2018-11-08 20:11:19 +0000
+++ mainpage/views.py	2019-01-06 09:50:29 +0000
@@ -104,25 +104,30 @@
             json_data = json.load(f)['developers']
 
         for head in json_data:
-            # Add first header
-            txt = txt + '##' + head['heading'] + '\n'
-            # Inserting Translators if there was no error
-            if head['heading'] == 'Translators' and 'KeyError' not in transl_list:
-                for values in (transl_list):
-                    # Add subheader for locale
-                    txt = txt + '### ' + \
-                        values['your-language-name-in-english'] + '\n'
-                    # Prepaire the names for wl_markdown
-                    txt = txt + '* ' + \
-                        values['translator-list'].replace('\n', '\n* ') + '\n'
-
-            # Add a subheader or/and the member(s)
-            for entry in head['entries']:
-                if 'subheading' in entry.keys():
-                    txt = txt + '###' + entry['subheading'] + '\n'
-                if 'members' in entry.keys():
-                    for name in entry['members']:
-                        txt = txt + '* ' + name + '\n'
+            if 'heading' in head:
+                # Add first header
+                txt = txt + '##' + head['heading'] + '\n'
+                # Inserting Translators if there was no error
+                if head['heading'] == 'Translators' and 'KeyError' not in transl_list:
+                    for values in (transl_list):
+                        # Add subheader for locale
+                        txt = txt + '### ' + \
+                            values['your-language-name-in-english'] + '\n'
+                        # Prepaire the names for wl_markdown
+                        txt = txt + '* ' + \
+                            values['translator-list'].replace('\n', '\n* ') + '\n'
+
+                # Add a subheader or/and the member(s)
+                for entry in head['entries']:
+                    if 'subheading' in entry.keys():
+                        txt = txt + '###' + entry['subheading'] + '\n'
+                    if 'members' in entry.keys():
+                        for name in entry['members']:
+                            txt = txt + '* ' + name + '\n'
+                    if 'translate' in entry.keys():
+                        for transl in entry['translate']:
+                            txt = txt + '* ' + transl + '\n'
+
     except IOError:
         txt = txt + "Couldn't find developer file!"
 


Follow ups