--------------------------------------------------------------------------------
--  Handler.......... : onInitPG
--  Author........... : 
--  Description...... : 
--------------------------------------------------------------------------------

--------------------------------------------------------------------------------
function polyglotLIB.onInitPG ( sXMLpath, sScheme, nVersion )
--------------------------------------------------------------------------------
	
--	if application.isPluginRegistered ( "PolyglotLIB" ) then
    
        if sXMLpath == "" then
            sXMLpath = application.getPackDirectory ( ) .. "/polyglottt"
        end
        if sScheme == "" then
            sScheme = "Polyglot-*.xml"
        end
    
        if system.getOSType ( ) == system.kOSTypeWindows then
            sXMLpath = string.replace ( sXMLpath, "/", "\\" )
        end
    
        log.message ( "loading polyglot from "..sXMLpath )
        local ret = polyglot.init ( sXMLpath, sScheme, nVersion )
        if ret == 0 then
            log.warning ( "PolyglotLIB init problem" )
        elseif ret == 1 then
            this.bInit ( true )
            log.message ( "PolyglotLIB init successful" )
        elseif ret == 2 then
            log.warning ( "PolyglotLIB XML folder does not exist" )
        elseif ret == 3 then
            log.warning ( "PolyglotLIB XML parsing problem" )
        else
            log.warning ( "PolyglotLIB general error" )
        end
--    else
--        log.warning ( "PolyglotLIB is not referenced" )
--        this.bInit ( false )
--    end
        
--------------------------------------------------------------------------------
end
--------------------------------------------------------------------------------
