From 57b4d9515753d745f184c39a52aa4143d0f6a711 Mon Sep 17 00:00:00 2001 From: tofulm Date: Wed, 4 May 2022 09:03:29 +0200 Subject: [PATCH] dans la declaration du header, on accepte les chaines de langue : <:prefix:ma_chaine_de_langue:> --- gamuform_fonctions.php | 9 +++++++++ json_gamuform.json.html | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/gamuform_fonctions.php b/gamuform_fonctions.php index 165cb38..a7902ae 100644 --- a/gamuform_fonctions.php +++ b/gamuform_fonctions.php @@ -13,6 +13,15 @@ if (!defined('_ECRIRE_INC_VERSION')) { return; } + +function gamuform_lang(?string $chaine):string { + if (strpos($chaine, ':>') !== false) { + $chaine = substr($chaine, 2, -2); + $chaine = _T($chaine); + } + return $chaine ?? ''; +} + /** * filtre generale qui appelle un filtre spécifique, déclaré dans l'array saisies avec la cle : gamutable/filtre * si cette fonction commence par _array_ ex: _array_maSuperFonction => elle aura en parametre l'array de la ligne diff --git a/json_gamuform.json.html b/json_gamuform.json.html index 976f058..880167b 100644 --- a/json_gamuform.json.html +++ b/json_gamuform.json.html @@ -12,7 +12,7 @@ "id": "id", "edit": "", -[(#CLE|json_encode)] : [(#VALEUR|json_encode)], +[(#CLE|json_encode)] : [(#VALEUR*|gamuform_lang|json_encode)], "sup": "" },