<commit_before>import Ember from 'ember';
import Locale from 'ember-i18n/utils/locale';
import config from '../../config/environment';

const DEFAULT_LOCALE = config.i18n.defaultLocale;

let missingMessage = function(locale, key, data) {

  console.log(locale)

  if (locale === DEFAULT_LOCALE || window.env === 'development') {
    return `Missing translation: ${key}`;
  } else {

    Ember.Logger.warn("Missing translation: " + key);

    // NOTE This relies on internal APIs and is brittle.
    // Emulating the internals of ember-i18n's translate method
    const i18n = this;
    const count = Ember.get(data, 'count');
    const defaults = Ember.makeArray(Ember.get(data, 'default'));
    defaults.unshift(key);
    const localeObj = new Locale(DEFAULT_LOCALE, Ember.getOwner(i18n));
    const template = localeObj.getCompiledTemplate(defaults, count);
    return template(data);
  }
};

export default missingMessage;<commit_msg>Tidy up missing message util linting issues<commit_after>import Ember from 'ember';
import Locale from 'ember-i18n/utils/locale';
import config from '../../config/environment';

const DEFAULT_LOCALE = config.i18n.defaultLocale;

let missingMessage = function(locale, key, data) {
  if (locale === DEFAULT_LOCALE || window.env === 'development') {
    return `Missing translation: ${key}`;
  } else {

    Ember.Logger.warn(`Missing translation: ${key}`);

    // NOTE This relies on internal APIs and is brittle.
    // Emulating the internals of ember-i18n's translate method
    let i18n = this;
    let count = Ember.get(data, 'count');
    let defaults = Ember.makeArray(Ember.get(data, 'default'));
    defaults.unshift(key);
    let localeObj = new Locale(DEFAULT_LOCALE, Ember.getOwner(i18n));
    let template = localeObj.getCompiledTemplate(defaults, count);
    return template(data);
  }
};

export default missingMessage;
{'fraction_non_alphanumeric': 0.12780748663101604, 'fraction_numerical': 0.0106951871657754, 'mean_word_length': 4.15426997245179, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '6698070', 'n_tokens_mistral': 582, 'n_tokens_neox': 561, 'n_words': 156}