import { isBrowser } from '../../utils';
import zhLocal from './zh-CN';
import zhTWLocal from './zh-TW';
import enUSLocal from './en-US';
import itITLocal from './it-IT';
const locales = {
  'zh-CN': zhLocal,
  'zh-TW': zhTWLocal,
  'en-US': enUSLocal,
  'it-IT': itITLocal
};
const getLanguage = () => {
  // support ssr
  if (!isBrowser()) {
    return '';
  }
  const lang = window.localStorage.getItem('wau_locale');
  return lang || window.g_locale || navigator.language;
};
export { getLanguage };
export default (() => {
  const gLocale = getLanguage();
  if (locales[gLocale]) {
    return locales[gLocale];
  }
  return locales['zh-CN'];
});