code: def humanize_placeholders(msgid):
      
      return re.sub(
          r'%(?:\((\w+)\))?([sd])',
          lambda match: r'__{0}__'.format(
              match.group(1).lower() if match.group(1) else 'number' if match.group(2) == 'd' else 'item'),
          msgid)
docs: Convert placeholders to the (google translate) service friendly form.
  
      %(name)s -> __name__
      %s       -> __item__
      %d       -> __number__