import React__default from 'react';
import GlobalContext from '@para-ui/core/GlobalContext';

/**
 * @author linhd
 * @date 2022/3/15 4:03 PM
 * @description 国际化钩子
 */
var useFormatMessage = function useFormatMessage(comName, defI18nData) {
  var _React$useContext = React__default.useContext(GlobalContext),
    intlFormat = _React$useContext.intlFormat;
  defI18nData.zh_CN = defI18nData.zh;
  defI18nData['zh-CN'] = defI18nData.zh;
  defI18nData.en_US = defI18nData.en;
  defI18nData['en-US'] = defI18nData.en;
  var intl = intlFormat && intlFormat(comName, defI18nData);
  return intl;
};

export { useFormatMessage as u };
