1
0
forked from mirrors/0ad

Change the language names for translation credits to the names in the original language.

This removes the loophole in our release process, fixes #3827.

This was SVN commit r17904.
This commit is contained in:
Itms
2016-03-16 23:04:10 +00:00
parent 6d52a71d4a
commit 19a218cd48
2 changed files with 21 additions and 18 deletions
@@ -18,6 +18,9 @@ function parseHelper(list)
for (let object of list) for (let object of list)
{ {
if (object.LangName)
result += "[font=\"sans-bold-stroke-14\"]" + object.LangName + "\n";
if (object.Title) if (object.Title)
result += "[font=\"sans-bold-stroke-14\"]" + translate(object.Title) + "\n"; result += "[font=\"sans-bold-stroke-14\"]" + translate(object.Title) + "\n";
+18 -18
View File
@@ -33,22 +33,22 @@ import json, os, glob, re
# Credited languages - Keep in sync with source/tools/dist/remove-incomplete-translations.sh # Credited languages - Keep in sync with source/tools/dist/remove-incomplete-translations.sh
langs = { langs = {
'cs': 'Czech', 'cs': 'Ceština',
'de': 'German', 'de': 'Deutsch',
'en_GB': 'English (UK)', 'en_GB': 'English (UK)',
'es': 'Spanish', 'es': 'Español',
'fr': 'French', 'fr': 'Français',
'gd': 'Gaelic', 'gd': 'Gàidhlig',
'gl': 'Galician', 'gl': 'Galego',
'id': 'Indonesian', 'id': 'Bahasa Indonesia',
'it': 'Italian', 'it': 'Italiano',
'nl': 'Dutch', 'nl': 'Nederlands',
'pl': 'Polish', 'pl': 'Polski',
'pt_PT': 'Portuguese (Portugal)', 'pt_PT': 'Português (Portugal)',
'pt_BR': 'Portuguese (Brazil)', 'pt_BR': 'Português (Brasil)',
'ru': 'Russian', 'ru': 'Русский',
'sk': 'Slovak', 'sk': 'Slovenčina',
'tr': 'Turkish'} 'tr': 'Türkçe'}
root = '../../../' root = '../../../'
@@ -74,12 +74,12 @@ newJSONData = {'Content': []}
# add them to the new data after processing, else add them immediately. # add them to the new data after processing, else add them immediately.
# NB: All of this is quite inefficient # NB: All of this is quite inefficient
for element in JSONData['Content']: for element in JSONData['Content']:
if 'Title' not in element or element['Title'] not in langs.values(): if 'LangName' not in element or element['LangName'] not in langs.values():
newJSONData['Content'].append(element) newJSONData['Content'].append(element)
continue continue
for (langCode, langName) in langs.items(): for (langCode, langName) in langs.items():
if element['Title'] == langName: if element['LangName'] == langName:
langsLists[langCode] = element['List'] langsLists[langCode] = element['List']
break break
@@ -117,7 +117,7 @@ for lang in langs.keys():
# Now insert the new data into the new JSON file # Now insert the new data into the new JSON file
for (langCode, langList) in sorted(langsLists.items()): for (langCode, langList) in sorted(langsLists.items()):
newJSONData['Content'].append({'Title': langs[langCode], 'List': []}) newJSONData['Content'].append({'LangName': langs[langCode], 'List': []})
for name in langList: for name in langList:
newJSONData['Content'][-1]['List'].append({'name': name}) newJSONData['Content'][-1]['List'].append({'name': name})