From 61ddcd4f1e1dcd3cc374799cbc3d45cc30d1def0 Mon Sep 17 00:00:00 2001 From: Francois Andrieu Date: Jun 14 2021 18:42:00 +0000 Subject: use langtable library to dynamically build the language menu --- diff --git a/build.d/construct-translations.py b/build.d/construct-translations.py index dd3cefa..3917489 100755 --- a/build.d/construct-translations.py +++ b/build.d/construct-translations.py @@ -1,6 +1,7 @@ #!/bin/env python import ConfigParser, sys, os +import langtable ''' This script takes the contents of the website-specific LINGUAS file, constructs an options menu for the languages contained therein. @@ -40,7 +41,8 @@ with open(sys.argv[2], 'r') as linguas: # Linguas is where available languages a lang = lang.strip() if lang and not lang.startswith('#') and not lang in banned: #output.write(' \n') - output.write(", '"+lang+"': '"+language_map.get('Languages',lang)+"'") + #output.write(", '"+lang+"': '"+language_map.get('Languages',lang)+"'") + output.write(", '"+lang+"': '"+langtable.language_name(languageId=lang).encode('utf-8')+"'") finally: linguas.close() output.write("""}