EvalCommand fr

frederic.piou shared this question 2 years ago
Answered

Bonjour,


Comment peut-on forcer evalCommand à interpréter les commandes en français ?


Dans l'exemple du fichier joint, la commande "s=Droite[A,B]" n'est pas interprétée (ligne 60).


Et pourtant le paramètre est renseigné : "language":"fr" (ligne 41)


Merci d'avance pour votre aide !

Comments (3)

photo
1

Sorry, commands send to evalCommand() must be in English


https://wiki.geogebra.org/e...

photo
1

Hi, I searched in your Reference an example of use of evalCommand in javascript, but I didn't find.


Is it available with javascript ?


When I put this method on one applet object, I receive a error in javascript debug "It's not a function"


<html>
<head>
<meta name=viewport content="width=device-width,initial-scale=1">  
<meta charset="utf-8"/>
<script src="<a href="https://www.geogebra.org/ap" rel="nofollow" target="_blank">https://www.geogebra.org/ap......;;
</head>

<body>
TEST <br/>

<div id="ggb-element"></div>
<p>
Here is the second applet:<p>
<div style="width:907px;height:415px;display:block" id="applet_container2"></div>
<p>
<script>  

	var parameters1 = {"id":"app1","width":800,"height":285,"showToolBar":false,"borderColor":null,
	"showMenuBar":false,"showAlgebraInput":true,"showResetIcon":true,
	"enableLabelDrags":false,"enableShiftDragZoom":true,"enableRightClick":false,
	"capturingThreshold":null,"showToolBarHelp":false,"errorDialogsActive":true,"useBrowserForJS":false,
	"grid":false,
	};
	
	    //var ggbApp = new GGBApplet({"appName": "graphing", "width": 800, "height": 600, "showToolBar": false, "showAlgebraInput": false, "showMenuBar": false }, true);
	var applet1 = new GGBApplet(parameters1, '5.0');
	
	
	//applet1.evalCommand("f(x)=sin(x)");

	
    window.addEventListener("load", function() { 
        
		//ggbApp.evalCommand('f(x)=sin(x)');
		applet1.inject('ggb-element');

    });
        
</script>

</body>
</html>

photo
1

You need to call evalCommand() on the api, not the GGBApplet object


"appletOnLoad":function(api){  api.evalCommand('Segment((1,2),(3,4))'); }, 

photo
© 2020 International GeoGebra Institute