--------------------------------------------------------------------------------
--  Handler.......... : onTranslateSomething
--  Author........... : 
--  Description...... : 
--------------------------------------------------------------------------------

--------------------------------------------------------------------------------
function polyglotLIBdemo.onTranslateSomething (  )
--------------------------------------------------------------------------------
	
    local hU = this.getUser ( )
    local l = "ruRU"
	
    -- check if library has been initialized
    if user.getAIVariable ( hU, "polyglotLIB", "bInit" ) == true then
    
    -- demo: test lang availability
	if polyglot.isLanguageAvailable ( l ) then
        log.message ( "AVAIL "..l..": true" )
	
		-- demo: translate single codestring
		local sTrans = polyglot.translate ( l, "CONTEXT_CLASS_GODDESS", true )
		log.message ( "SINGLE: " .. sTrans )
    
		-- demo: translate compound codestring
		sTrans = polyglot.translateCompound ( l, "I like CONTEXT_CLASS_GODDESS and CONTEXT_CLASS_PRINCESS", false )
		log.message ( "COMPOUND: " .. sTrans )
			
		-- demo: translate single codestring
		local sTrans = polyglot.translate ( l, "CONTEXT_CLASS_PRINCESS", true )
		log.message ( "SINGLE: " .. sTrans )
			
	else
		log.message ( "AVAIL "..l..": false" )
    end
    
    else
        log.message ( "Polyglot needs to be initialized before translation." )
    end
    
--------------------------------------------------------------------------------
end
--------------------------------------------------------------------------------
