<commit_before>var cc ={win:Ti.UI.currentWindow};
Ti.include('./application.js','./about_resources_data.js');
(function(){

	cc.win.orientationModes = [
		Ti.UI.PORTRAIT,
		Ti.UI.UPSIDE_PORTRAIT
	];
	
				
	cc.getDataRow=function(itemR,itemCount){
		var row = Ti.UI.createTableViewRow({
			height:50,
			hasChild:true,
			className:'res_' + itemCount,  //Add unique to force new template
			ja_url:itemR.ref_ja_url,
			en_url:itemR.ref_en_url,
			isRowElement:true //hack for android touch event
		});
		
		if(itemR.hasHeader){
			row.header=itemR.header;
		}
		var resName = Ti.UI.createLabel({text:itemR.title, 
											 color:'#000',
											 height:'auto',
											 left:5,
											 width:(Ti.Platform.displayCaps.platformWidth-20),
											 textAlign:'left',
											 font:{
												fontSize:14,fontWeight:'Bold'
											}
											});	
		row.add(resName);
		
		return row;
	};
	
	cc.getTableData=function(){
		var tableData=[];
		var itemCount = cc.resourceData.length;
		for (var iLoop=0;iLoop<itemCount;iLoop++){
			tableData.push(cc.getDataRow(cc.resourceData[iLoop],iLoop));
		}
		return tableData;
	};
	cc.tableView = Ti.UI.createTableView({
		backgroundColor:'#fff',
		data:cc.getTableData()
	});
	cc.win.add(cc.tableView);
	
	cc.openLink=function(urlText){
		if (!Ti.Network.online){
		 	  noNetworkAlert();
		} else {
		   Ti.Platform.openURL(urlText);
		}		
	};
})();


//-------------------------------
//	Events
//-------------------------------
cc.tableView.addEventListener('click', function(e){

	//If japan then try to load the japanese link first
	if(Ti.Locale.currentCountry=='ja'){
		if(e.rowData.ja_url.length>0){
			cc.openLink(e.rowData.ja_url);
		}else{
			cc.openLink(e.rowData.en_url);
		}
	}else{
		//For everyone else try the english version first
		if(e.rowData.en_url.length>0){
			cc.openLink(e.rowData.en_url);
		}else{
			cc.openLink(e.rowData.ja_url);
		}		
	}
});<commit_msg>updated to correct locale language issue<commit_after>var cc ={win:Ti.UI.currentWindow};
Ti.include('./application.js','./about_resources_data.js');
(function(){

	cc.win.orientationModes = [
		Ti.UI.PORTRAIT,
		Ti.UI.UPSIDE_PORTRAIT
	];
	
	Ti.API.info('currentCountry=' +  Ti.Locale.currentCountry);
	Ti.API.info('currentLanguage=' +  Ti.Locale.currentLanguage);
	Ti.API.info('currentLocale=' +  Ti.Locale.currentLocale);	
				
	cc.getDataRow=function(itemR,itemCount){
		var row = Ti.UI.createTableViewRow({
			height:50,
			hasChild:true,
			className:'res_' + itemCount,  //Add unique to force new template
			ja_url:itemR.ref_ja_url,
			en_url:itemR.ref_en_url,
			isRowElement:true //hack for android touch event
		});
		
		if(itemR.hasHeader){
			row.header=itemR.header;
		}
		var resName = Ti.UI.createLabel({text:itemR.title, 
											 color:'#000',
											 height:'auto',
											 left:5,
											 width:(Ti.Platform.displayCaps.platformWidth-20),
											 textAlign:'left',
											 font:{
												fontSize:14,fontWeight:'Bold'
											}
											});	
		row.add(resName);
		
		return row;
	};
	
	cc.getTableData=function(){
		var tableData=[];
		var itemCount = cc.resourceData.length;
		for (var iLoop=0;iLoop<itemCount;iLoop++){
			tableData.push(cc.getDataRow(cc.resourceData[iLoop],iLoop));
		}
		return tableData;
	};
	cc.tableView = Ti.UI.createTableView({
		backgroundColor:'#fff',
		data:cc.getTableData()
	});
	cc.win.add(cc.tableView);
	
	cc.openLink=function(urlText){
		if (!Ti.Network.online){
		 	  noNetworkAlert();
		} else {
		   Ti.Platform.openURL(urlText);
		}		
	};
})();


//-------------------------------
//	Events
//-------------------------------
cc.tableView.addEventListener('click', function(e){

	//If japan then try to load the japanese link first
	if(Ti.Locale.currentLanguage=='ja'){
		if(e.rowData.ja_url.length>0){
			cc.openLink(e.rowData.ja_url);
		}else{
			cc.openLink(e.rowData.en_url);
		}
	}else{
		//For everyone else try the english version first
		if(e.rowData.en_url.length>0){
			cc.openLink(e.rowData.en_url);
		}else{
			cc.openLink(e.rowData.ja_url);
		}		
	}
});
{'fraction_non_alphanumeric': 0.184904738641915, 'fraction_numerical': 0.006350757205666829, 'mean_word_length': 2.8057620817843865, 'pattern_counts': {'":': 0, '<': 5, '<?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': '4318089', 'n_tokens_mistral': 1836, 'n_tokens_neox': 1475, 'n_words': 209}