diff --git a/ecrire/inc/actions.php b/ecrire/inc/actions.php
index 76369053bc151db304863c623821f374d93c95ef..3cc83c7b9654f944c45c202ef83261ee01966382 100644
--- a/ecrire/inc/actions.php
+++ b/ecrire/inc/actions.php
@@ -60,7 +60,7 @@ function ajax_retour($corps, $content_type = null){
 	if (isset($_COOKIE['spip_admin'])
 	    AND ((_request('var_mode')=='debug') OR !empty($GLOBALS['tableau_des_temps'])))
 		$e = erreur_squelette();
-	if (isset($GLOBALS['transformer_xml']) OR $GLOBALS['exec']=='valider_xml'){
+	if (isset($GLOBALS['transformer_xml']) OR (isset($GLOBALS['exec']) AND $GLOBALS['exec']=='valider_xml')){
 		$debut = _DOCTYPE_ECRIRE
 		         ."<html><head><title>Debug Spip Ajax</title></head>"
 		         ."<body><div>\n\n"
diff --git a/ecrire/inc/pipelines.php b/ecrire/inc/pipelines.php
index 5995472d31ae61bdce3a2a18f4e478723d2a3e07..11a6fd60938b91e20c27d09682b15ff3205be03e 100644
--- a/ecrire/inc/pipelines.php
+++ b/ecrire/inc/pipelines.php
@@ -98,7 +98,7 @@ function f_insert_head($texte) {
 // Inserer au besoin les boutons admins
 // http://doc.spip.org/@f_admin
 function f_admin ($texte) {
-	if ($GLOBALS['affiche_boutons_admin']) {
+	if (isset($GLOBALS['affiche_boutons_admin']) AND $GLOBALS['affiche_boutons_admin']) {
 		include_spip('public/admin');
 		$texte = affiche_boutons_admin($texte);
 	}
@@ -141,4 +141,4 @@ function f_queue(&$texte){
 	return $texte;
 }
 
-?>
\ No newline at end of file
+?>
diff --git a/ecrire/inc/utils.php b/ecrire/inc/utils.php
index cec337f0ad6ec1e5c5d79608eac73f52d131493e..34459920e879bc3b5a8d74e845bcad37fff4e713 100644
--- a/ecrire/inc/utils.php
+++ b/ecrire/inc/utils.php
@@ -490,7 +490,13 @@ function _T($texte, $args=array(), $options=array()) {
 		unset($args['spip_lang']);
 	}
 	// Sinon on prend la langue du contexte
-	else{
+	else {
+		// [fixme] dans certains cas d'ajax, la globale n'est pas presente
+		// c'est peut etre un probleme plus en amont.
+		if (!isset($GLOBALS['spip_lang'])) {
+			include_spip('inc/lang');
+			utiliser_langue_visiteur();
+		}
 		$lang = $GLOBALS['spip_lang'];
 	}
 	$text = $traduire($texte, $lang);