def process_locales(series):
 languages = dict(((k.lower(), v['native']) for (k, v) in product_details.languages.items()))
 for row in series:
  if ('data' in row):
   new = {}
   for (key, count) in row['data'].items():
    if (key in languages):
     k = (u'%s (%s)' % (languages[key], key))
     new[k] = count
   row['data'] = new
  (yield row)

def process_locales ( series ) : languages = dict ( ( ( k . lower ( ) , v [ 'native' ] ) for ( k , v ) in product_details . languages . items ( ) ) ) for row in series : if ( 'data' in row ) : new = { } for ( key , count ) in row [ 'data' ] . items ( ) : if ( key in languages ) : k = ( u'%s (%s)' % ( languages [ key ] , key ) ) new [ k ] = count row [ 'data' ] = new ( yield row )
convert locale codes to pretty names .