def _parse_localename(localename):
 code = normalize(localename)
 if ('@' in code):
  (code, modifier) = code.split('@', 1)
  if ((modifier == 'euro') and ('.' not in code)):
   return (code, 'iso-8859-15')
 if ('.' in code):
  return tuple(code.split('.')[:2])
 elif (code == 'C'):
  return (None, None)
 raise ValueError(('unknown locale: %s' % localename))

def _parse_localename ( localename ) : code = normalize ( localename ) if ( '@' in code ) : ( code , modifier ) = code . split ( '@' , 1 ) if ( ( modifier == 'euro' ) and ( '.' not in code ) ) : return ( code , 'iso-8859-15' ) if ( '.' in code ) : return tuple ( code . split ( '.' ) [ : 2 ] ) elif ( code == 'C' ) : return ( None , None ) raise ValueError ( ( 'unknown locale: %s' % localename ) )
parses the locale code for localename and returns the result as tuple .