[game-data-packager] 02/02: babel.py: hardcode some missing & one-file translations

Alexandre Detiste detiste-guest at moszumanska.debian.org
Sat Jun 20 09:57:55 UTC 2015


This is an automated email from the git hooks/post-receive script.

detiste-guest pushed a commit to branch master
in repository game-data-packager.

commit 65cb61509689f49a3435b94487435dde4109ef77
Author: Alexandre Detiste <alexandre.detiste at gmail.com>
Date:   Sat Jun 20 11:57:18 2015 +0200

    babel.py: hardcode some missing & one-file translations
---
 tools/babel.py | 20 +++++++++++++++++++-
 1 file changed, 19 insertions(+), 1 deletion(-)

diff --git a/tools/babel.py b/tools/babel.py
index a2542f0..8a0ad3c 100755
--- a/tools/babel.py
+++ b/tools/babel.py
@@ -37,8 +37,19 @@ for name, game in load_games().items():
     stats['shortname'] = name
     stats['longname'] = ascii_safe(game.longname, force=True)
     stats['total'] = len(game.packages)
+    if name in ('doom2', 'rtcw'):
+        stats['fr'] = '*'
     games.append(stats)
 
+if 'ru' not in langs:
+    langs['ru'] = 0
+
+missing = {
+  'nomouth': ['ru'],
+  'rtcw': ['de','es','it'],
+  'waxworks': ['de','es','fr'],
+}
+
 games = sorted(games, key=lambda k: (k['genre'], k['shortname'], k['longname']))
 
 langs_order = sorted(langs, key=langs.get, reverse=True)
@@ -70,8 +81,11 @@ for game in games:
     html.write('  <td>%s</td>\n' % game['longname'])
     for lang in langs_order:
         count = game.get(lang,None)
-        if lang in ('total', 'en'):
+        if lang in ('total', 'en') or count == '*':
             html.write('  <td bgcolor="lightgreen">%s</td>\n' % count)
+        elif lang in missing.get(game['shortname'],[]):
+            assert not count
+            html.write('  <td bgcolor="orange">!</td>\n')
         elif count:
             html.write('  <td bgcolor="green">%s</td>\n' % count)
         else:
@@ -87,6 +101,10 @@ for lang in langs_order:
 html.write('''
 </tr>
 </table>
+<ul>
+<li>* : provided as an alternative one-file in a 'en'/'C' package</li>
+<li>! : language is missing</li>
+</ul>
 </html>
 '''
 )

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-games/game-data-packager.git



More information about the Pkg-games-commits mailing list