def format_messages(messages_dict):
  """ Formats input messages in Polymer format to native Android format. This means replacing
      hyphens with underscores in keys and escaping apostrophes in values. """
  formatted_messages = {}
  for k,v in messages_dict.items():
    formatted_messages[k.replace("-", "_")] = v.replace("'", "\\'")
  return formatted_messages