<!DOCTYPE html >
<html >

<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
<title>Check Localizable Resource Strings</title>

<script>
//Prepare fake variables context
function WriteConsole(){};

</script>

</head>

<body>

You can use a path like this running from the web server:
http://server/connect/localization/en-US/Different RESX Strings.htm?es-MX

<p>

<script type="text/javascript">

	function LoadJSONSync(sFileURL) 
	{		
		try
		{
			var objXMLHttpReqObj = new XMLHttpRequest();
			var READY_STATE_COMPLETE=4;
			var sRet="";
			
			if(objXMLHttpReqObj){
				objXMLHttpReqObj.open("GET", sFileURL, false); //synchronous
				objXMLHttpReqObj.onreadystatechange = function(){
					if(objXMLHttpReqObj.readyState==READY_STATE_COMPLETE){
						if (objXMLHttpReqObj.status!=404)
						{
							sRet=objXMLHttpReqObj.responseText;
						}
					}
				}
				objXMLHttpReqObj.send(null);	
				return sRet;		
			}
		}catch(e)
		{
			return "";
		}
		
	}


// Move the Resource Strings outside the default RESX
// Change if in the view or VD localization files
var SUFFIX="";
//var SUFFIX="v";
var sCulture=window.location.search.substr(1);

if (!sCulture)
{
	sCulture="es-MX";
}

document.write("<div> Loading Resources" + SUFFIX + ".en-US.js </div>")

var US_RESX=JSON.parse(LoadJSONSync("Resources" + SUFFIX + ".en-US.js"));


// Remove the first RESX so another can be loaded
//g_MqRef.RESX=null;

document.write("<div> Loading Resources ../" + sCulture + "/Resources" + SUFFIX + "." + sCulture + ".js </div>")
//<!-- ony one of these will work in a given folder -->
var tmp=LoadJSONSync("../" + sCulture + "/Resources" + SUFFIX + "." + sCulture + ".js");
if (tmp)
{

	var LOC_RESX=JSON.parse(tmp);
}

document.write("Size of US RESX:");
document.write(Object.keys(US_RESX).length);


document.write("<hr>");
document.write("Size of Translated RESX for " + sCulture + ":");
document.write(Object.keys(LOC_RESX).length);

document.write("<hr>");

document.write("Elements added in US RESX:<hr>");

var prop;
// At this point, both Resource String tables are loaded and we can compare them
for (prop in US_RESX)
{
	//document.write(g_MqRef.RESX["WIZARD_SECURITY_EDIT_DESCRIPTION"]);

	// Check if it's undefined
	if (!LOC_RESX[prop])
	{
		document.write("\"" + prop + "\":\"" + US_RESX[prop] + "\",<br>");
	}
}

</script>



</body>

</html>
