<commit_before>import Ember from 'ember';


var fn= function(key,value) {	
	Ember.assert('You seem to have assigned a i18n computed property to a native object',typeof this.constructor.metaForProperty==='function');
		
	var meta=this.constructor.metaForProperty(key);
	
	var service=meta.i18nService();
	Ember.assert('I18n: service not initialized, please check your version of ember-load-initializers (bower)',service);
	
	if(!this['_i18n']) {
		// Added this because of a potential memory leak, but the leak might have been caused by furnace-forms
		this.reopen({
			_i18n: service,
			willDestroy : function() {
				this._super();
				this.set('_i18n',null);
			}
		})
	
	}
	
	if(!this._i18nCache) {
		this._i18nCache={};
	}
	
	if(typeof meta.i18nDefaultValue==='function') {
		value=meta.i18nDefaultValue.call(this,key,value);
	} else {
		if(value) {
			this._i18nCache[key]=value
		}
		else {
			value = this._i18nCache[key] || meta.i18nDefaultValue;
		}
	}
		
	
	
	var _values=[];
	if(meta.i18nValues) {
		for(var i=0; i<meta.i18nValues.length;i++) {
			_values.push(this.get(meta.i18nValues[i]));
		}
	}
	// We might want to be able to use objects to load toString value from	
	return service.translate(value,_values)
};

/* Signatures
 * 
 * ns,defaultValue[,values]
 * ns,keys,defaultValue[,values]
 * 
 */

export default function i18nComputed() { 
	var ns=arguments[0];
	
	var observes=null;
	var values=null;
	var defaultValue=null;
	
	if(arguments.length===2 || (arguments.length===3 && typeof arguments[2] === 'array' )) {
		defaultValue=arguments[1];
		if(arguments.length===3)
			values=arguments[2];
	} else {
		observes=arguments[1];
		defaultValue=arguments[2];
		if(arguments.length===4)
			values=arguments[3];
	}
	
	var cp = new Ember.computed({
		get : function(key) {
			return fn.call(this,key);
		},
		set : function(key,value) {
			if(typeof value==='function') {
				value=value.call(this,key);<commit_msg>Fixed computed property<commit_after>import Ember from 'ember';


var fn= function(key,value) {	
	Ember.assert('You seem to have assigned a i18n computed property to a native object',typeof this.constructor.metaForProperty==='function');
		
	var meta=this.constructor.metaForProperty(key);
	
	var service=meta.i18nService();
	Ember.assert('I18n: service not initialized, please check your version of ember-load-initializers (bower)',service);
	
	if(!this['_i18n']) {
		// Added this because of a potential memory leak, but the leak might have been caused by furnace-forms
		this.reopen({
			_i18n: service,
			willDestroy : function() {
				this._super();
				this.set('_i18n',null);
			}
		})
	
	}
	
	if(!this._i18nCache) {
		this._i18nCache={};
	}
	
	if(typeof meta.i18nDefaultValue==='function') {
		value=meta.i18nDefaultValue.call(this,key,value);
	} else {
		if(value) {
			this._i18nCache[key]=value
		}
		else {
			value = this._i18nCache[key] || meta.i18nDefaultValue;
		}
	}
		
	
	
	var _values=[];
	if(meta.i18nValues) {
		for(var i=0; i<meta.i18nValues.length;i++) {
			_values.push(this.get(meta.i18nValues[i]));
		}
	}
	// We might want to be able to use objects to load toString value from	
	return service.translate(value,_values)
};

/* Signatures
 * 
 * ns,defaultValue[,values]
 * ns,keys,defaultValue[,values]
 * 
 */

export default function i18nComputed() { 
	var ns=arguments[0];
	
	var observes=null;
	var values=null;
	var defaultValue=null;
	
	if(arguments.length===2 || (arguments.length===3 && arguments[2]!==undefined && typeof arguments[2] === 'array' )) {
		defaultValue=arguments[1];
		if(arguments.length===3)
			values=arguments[2];
	} else {
		observes=arguments[1];
		defaultValue=arguments[2];
		if(arguments.length===4)
			values=arguments[3];
	}
	
	var cp = new Ember.computed({
		get : function(key) {
			return fn.call(this,key);
		},
		set : function(key,value) {
			if(typeof value==='function') {
				value=value.call(this,key);
{'fraction_non_alphanumeric': 0.15335381464413722, 'fraction_numerical': 0.023809523809523808, 'mean_word_length': 4.2584118438761775, 'pattern_counts': {'":': 0, '<': 5, '<?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': '1499498', 'n_tokens_mistral': 1555, 'n_tokens_neox': 1360, 'n_words': 276}