<commit_before>jQuery(function(){

locale = '<%=session[:locale] || 'en'%>'

set_locale_link = function(l){
	if( l == 'es' ){
		locale_link = '<%=link_to( 'English', 
			locale_path('en'), 
			:id => 'session_locale' )-%>'
	}else{
		locale_link = '<%=link_to( 'Espa&ntilde;ol', 
			locale_path('es'), 
			:id => 'session_locale' )-%>'
	}

	jQuery('#session_locale').replaceWith(locale_link);

	jQuery('#session_locale').click(function(){
		jQuery.getScript(this.href, function(){
			translate(locale);
			set_locale_link(locale);
		});
		return false;
	});
}
set_locale_link(locale);

translate = function(l){
	if( typeof(translatables) != 'undefined' ){
		jQuery.each(translatables, function(index,value){
			jQuery(value.tag).html(decodeURI(value.locales[l]));
			jQuery(value.tag).fadeIn('slow');	/* pointless */
		})
	}
};
translate(locale);

});
<commit_msg>Using decodeURIComponent as decodeURI seems to muck up decoding entities.<commit_after>jQuery(function(){

locale = '<%=session[:locale] || 'en'%>'

set_locale_link = function(l){
	if( l == 'es' ){
		locale_link = '<%=link_to( 'English', 
			locale_path('en'), 
			:id => 'session_locale' )-%>'
	}else{
		locale_link = '<%=link_to( 'Espa&ntilde;ol', 
			locale_path('es'), 
			:id => 'session_locale' )-%>'
	}

	jQuery('#session_locale').replaceWith(locale_link);

	jQuery('#session_locale').click(function(){
		jQuery.getScript(this.href, function(){
			translate(locale);
			set_locale_link(locale);
		});
		return false;
	});
}
set_locale_link(locale);

translate = function(l){
	if( typeof(translatables) != 'undefined' ){
		jQuery.each(translatables, function(index,value){
/*
			jQuery(value.tag).html(decodeURI(value.locales[l]));
	decodeURI mucked up decoding Entities
*/
			jQuery(value.tag).html(decodeURIComponent(value.locales[l]));
			jQuery(value.tag).fadeIn('slow');	/* pointless */
		})
	}
};
translate(locale);

});

{'fraction_non_alphanumeric': 0.20411392405063292, 'fraction_numerical': 0.0, 'mean_word_length': 5.323333333333333, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 13, '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': '4310177', 'n_tokens_mistral': 737, 'n_tokens_neox': 676, 'n_words': 99}