work with arrays of locales

This commit is contained in:
Eric House 2014-04-29 06:33:14 -07:00
parent 8612a5f624
commit 7ea037d56a

View file

@ -247,19 +247,20 @@ def getDicts( params ):
return result return result
def getXlate( params ): def getXlate( params ):
result = None result = []
logging.debug( "getXlate:" + json.dumps(params) ) logging.debug( "getXlate:" + json.dumps(params) )
locale = params[k_LOCALE] for entry in params:
proto = params[k_XLATPROTO] locale = entry[k_LOCALE]
curVers = int(params[k_XLATEVERS]) curVers = entry[k_XLATEVERS]
data = mk_for_download.getXlationFor( k_filebase + 'xw4', locale ) data = mk_for_download.getXlationFor( k_filebase + 'xw4', locale )
if data: if data: result.append( { k_LOCALE: locale,
result = { k_LOCALE: locale, k_OLD: curVers,
k_OLD: curVers, k_NEW: curVers + "_new",
k_NEW: curVers + 1, k_PAIRS: data,
k_PAIRS: data, } )
}
if 0 == len(result): result = None
logging.debug( "getXlate=>%s" % (json.dumps(result)) ) logging.debug( "getXlate=>%s" % (json.dumps(result)) )
return result return result