<commit_before>import apiClient from 'panoptes-client/lib/api-client';

const translations = {
  strings: {},
  load: (translated_type, translated_id, language) => {
    translations.strings[translated_type] = {};
    return apiClient
      .type('translations')
      .get({ translated_type, translated_id, language })
      .then(([translation]) => {
        translations.strings[translated_type] = translation.strings;
      })
      .catch(error => {
        console.log(error.status);
        switch (error.status) {
          case 404:
            translations.strings[translated_type] = {};
            break;
        }
      });
  }
};

export default translations;<commit_msg>Register some Italian translations for site text<commit_after>import apiClient from 'panoptes-client/lib/api-client';
import counterpart from 'counterpart';

counterpart.setFallbackLocale('en');


const translations = {
  strings: {},
  load: (translated_type, translated_id, language) => {
    translations.strings[translated_type] = {};
    return apiClient
      .type('translations')
      .get({ translated_type, translated_id, language })
      .then(([translation]) => {
        translations.strings[translated_type] = translation.strings;
        counterpart.setLocale(language);
      })
      .catch(error => {
        console.log(error.status);
        switch (error.status) {
          case 404:
            translations.strings[translated_type] = {};
            break;
        }
      });
  }
};

export default translations;
{'fraction_non_alphanumeric': 0.1279527559055118, 'fraction_numerical': 0.003937007874015748, 'mean_word_length': 2.841309823677582, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, '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': '7465669', 'n_tokens_mistral': 436, 'n_tokens_neox': 413, 'n_words': 77}