function makeFieldTooltip (schema, locale) {
  if (!schema) {
    return ''
  }

  let tooltip = ''
  if (schema.title) {
    tooltip += schema.title
  }

  if (schema.description) {
    if (tooltip.length > 0) {
      tooltip += '\n'
    }
    tooltip += schema.description
  }

  if (schema.default) {
    if (tooltip.length > 0) {
      tooltip += '\n\n'
    }
    tooltip += translate('default', undefined, locale) + '\n'
    tooltip += JSON.stringify(schema.default, null, 2)
  }

  if (Array.isArray(schema.examples) && schema.examples.length > 0) {
    if (tooltip.length > 0) {
      tooltip += '\n\n'
    }
    tooltip += translate('examples', undefined, locale) + '\n'
    schema.examples.forEach((example, index) => {
      tooltip += JSON.stringify(example, null, 2)
      if (index !== schema.examples.length - 1) {
        tooltip += '\n'
      }
    })
  }

  return tooltip
}
Make a tooltip for a field based on the field's schema.
@param {object} schema JSON schema
@param {string} [locale] Locale code (for example, zh-CN)
@returns {string} Field tooltip, may be empty string if all relevant schema properties are missing