locale_format.js 378 B

1234567891011121314151617
  1. /**
  2. * Formatter file for extracting messages. Replaces default formatter. see https://formatjs.io/docs/tooling/cli#--format-path
  3. *
  4. * Message files will be in this format:
  5. * {
  6. * [key]: string
  7. * }
  8. */
  9. const format = (msgs) => {
  10. const results = {}
  11. for (const key in msgs) {
  12. results[key] = msgs[key].defaultMessage
  13. }
  14. return results
  15. }
  16. module.exports = { format }