There is no API for this, but starting with version 7.0 the following key is set in the registry for the particular version of XMetaL Author Essential or XMetaL Author Enterprise you have installed.
HKEY_LOCAL_MACHINE\SOFTWARE\SoftQuad\XMetaL 7.0\Install_LanguageHKEY_LOCAL_MACHINE\SOFTWARE\SoftQuad\XMetaL 8.0\Install_LanguageYou can use the standard Windows "WScript.Shell" ActiveX object to read from the registry, so a script similar to the following JScript example should give you what you need:
//XMetaL Script Language JScript:
function registryReadKey(regKey) {
try {
var wShell = new ActiveXObject("WScript.Shell");
var keyVal = wShell.RegRead(regKey);
wShell = null;
return keyVal;
}
catch(e) {
//no value set or something else went wrong, fail silently
}
}
var xmVersion = Application.VersionNumber;
var xmLocale = registryReadKey("HKEY_LOCAL_MACHINE\\SOFTWARE\\SoftQuad\\XMetaL " + xmVersion + "\\Install_Language");
Application.Alert(xmLocale);
I believe standard two letter localization values are used such as EN, DE, FR and JP.