summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorAleš Smodiš <aless@guru.si>2015-09-24 14:23:31 +0200
committerAleš Smodiš <aless@guru.si>2015-09-24 14:23:31 +0200
commit863d3eb91e4cb9cdb4d781ae90c93d4fecba1121 (patch)
tree7a95134d9b7e39244601a5b28c38564528ac955f /scripts
parent3dec5262acfb619a92b948fba3534b229bd01cb6 (diff)
Update JSON build script: include problem name translations with language index data.
Diffstat (limited to 'scripts')
-rw-r--r--scripts/build_web_resources.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/scripts/build_web_resources.py b/scripts/build_web_resources.py
index e3e6eff..f90ce24 100644
--- a/scripts/build_web_resources.py
+++ b/scripts/build_web_resources.py
@@ -174,8 +174,14 @@ while row:
common_data['id'] = problem_id
common_data['identifier'] = problem_identifier
problems_map[problem_identifier] = common_data
- # load and dump translations, for the problem subdirectory's problem.json
- problem_data = {'id': problem_id, 'identifier': problem_identifier, 'translations': load_translation_data(problem_package, problem_props)}
+ # load translations, and copy only problem names to the common data
+ problem_translations = load_translation_data(problem_package, problem_props)
+ name_translations = {}
+ for key, value in problem_translations.items():
+ name_translations[key] = {'name': value.get('name')}
+ common_data['translations'] = name_translations
+ # dump translations, for the problem subdirectory's problem.json
+ problem_data = {'id': problem_id, 'identifier': problem_identifier, 'translations': problem_translations}
problem_output_path = os.path.join(group_output_path, problem_identifier)
if not os.path.exists(problem_output_path):
os.mkdir(problem_output_path)