Fix all lang files so they are proper JSON (JSON does not allow single-quoted strings) except for lang.es.js. Started a python script that will help use manage the translation files going forward

git-svn-id: http://svg-edit.googlecode.com/svn/trunk@1205 eee81c28-f429-11dd-99c0-75d572ba1ddd
This commit is contained in:
Jeff Schiller
2010-01-13 16:28:33 +00:00
parent fc41d62a66
commit 8bff0591d3
55 changed files with 90 additions and 61 deletions

29
extras/update-langs.py Executable file
View File

@@ -0,0 +1,29 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# This is a helper script for the svg-edit project, useful for updating language files
# Licensed under the Apache 2 License as is the rest of the project
# Requires Python 2.6
#
# Copyright (c) 2010 Jeff Schiller
# TODO: Fix lang.es.js which apparently is not proper JSON (encoding issues?)
import os
import sys
import re
import json
def processFile(filename):
in_string = open('./editor/locale/'+filename).read()
try:
j = json.loads(in_string)
pass
except ValueError:
print "ERROR! " + filename + " was not valid JSON, please fix it!"
if __name__ == '__main__':
# get list of all lang files
for file in os.listdir('./editor/locale/'):
if file[:4] == "lang":
processFile(file)