def _replacestrings(source):
 match = re.search('var *(_\\w+)\\=\\["(.*?)"\\];', source, re.DOTALL)
 if match:
  (varname, strings) = match.groups()
  startpoint = len(match.group(0))
  lookup = strings.split('","')
  variable = ('%s[%%d]' % varname)
  for (index, value) in enumerate(lookup):
   source = source.replace((variable % index), ('"%s"' % value))
  return source[startpoint:]
 return source

def _replacestrings ( source ) : match = re . search ( 'var *(_\\w+)\\=\\["(.*?)"\\];' , source , re . DOTALL ) if match : ( varname , strings ) = match . groups ( ) startpoint = len ( match . group ( 0 ) ) lookup = strings . split ( '","' ) variable = ( '%s[%%d]' % varname ) for ( index , value ) in enumerate ( lookup ) : source = source . replace ( ( variable % index ) , ( '"%s"' % value ) ) return source [ startpoint : ] return source
strip string lookup table and replace values in source .