<commit_before>export const validateLocale = () => {
  const locale = window.locale || 'en';
  if (/^en/.test(locale)) {
    return 'en';
  }
  if (/^fr/.test(locale)) {
    return 'fr';
  }
  if (/^zh/.test(locale)) {
    return 'zh';
  }
  return 'en';
};

const getLocale = (page) => {
  const locale = validateLocale();
  let datas = {};
  try {
    datas = require(`./${page}/${locale}.js`).default;
  } catch (e) {
    datas = require(`./${page}/en.js`).default;
  } finally {
    return datas;
  }
};

export default getLocale;<commit_msg>set default language to zh<commit_after>export const validateLocale = () => {
  const locale = window.locale || 'en';
  if (/^en/.test(locale)) {
    return 'en';
  }
  if (/^fr/.test(locale)) {
    return 'fr';
  }
  if (/^zh/.test(locale)) {
    return 'zh';
  }
  return 'zh';
};

const getLocale = (page) => {
  const locale = validateLocale();
  let datas = {};
  try {
    datas = require(`./${page}/${locale}.js`).default;
  } catch (e) {
    datas = require(`./${page}/en.js`).default;
  } finally {
    return datas;
  }
};

export default getLocale;
{'fraction_non_alphanumeric': 0.21176470588235294, 'fraction_numerical': 0.0, 'mean_word_length': 2.8006872852233675, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6416364', 'n_tokens_mistral': 406, 'n_tokens_neox': 390, 'n_words': 87}