From bb18b994b3a4150205c1d3c4de8ffc662fbf7299 Mon Sep 17 00:00:00 2001
From: bricebou <bricebou@momh.fr>
Date: Thu, 20 Feb 2025 06:46:10 +0100
Subject: [PATCH 1/2] chore: migration des fichiers de langue vers leur
 nouvelle syntaxe

Fix: #4685
---
 CHANGELOG.md        | 1 +
 lang/odtspip_fr.php | 5 ++---
 paquet.xml          | 2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index 4e9d67c..a283349 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -4,6 +4,7 @@
 
 ### Added
 
+- #4685 Migration des fichiers de langue vers leur nouvelle syntaxe
 - #4680 Prise en compte de la légende et de la description des propriétés d'accessibilité d'une image lors de son import
 - #4675 Prise en compte des styles "Block Quotation" et "Quote"
 
diff --git a/lang/odtspip_fr.php b/lang/odtspip_fr.php
index 3478845..d84cc0a 100644
--- a/lang/odtspip_fr.php
+++ b/lang/odtspip_fr.php
@@ -12,7 +12,7 @@
  *
  */
 
-$GLOBALS[$GLOBALS['idx_lang']] = array(
+return [
 	// A
 	'attacher_fichier_odt' => 'Attacher le fichier ODT à l’article ?',
 	'attacher_fichier_source' => 'Attacher le fichier à l’article ?',
@@ -72,5 +72,4 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
 
 	// T
 	'titre_page_configurer' => 'Configuration du plugin odt2spip',
-);
-?>
\ No newline at end of file
+];
diff --git a/paquet.xml b/paquet.xml
index e065f45..36084e8 100644
--- a/paquet.xml
+++ b/paquet.xml
@@ -4,7 +4,7 @@
 	version="4.2.0"
 	schema="201406091738"
 	etat="stable"
-	compatibilite="[3.2.0;4.*]"
+	compatibilite="[4.2.0;4.*]"
 	logo="prive/themes/spip/images/odt2spip-64.png"
 	documentation="https://contrib.spip.net/3001"
 >
-- 
GitLab


From 1e296e3e97ebfce1d39412d7834432bb1aa9c3b0 Mon Sep 17 00:00:00 2001
From: bricebou <bricebou@momh.fr>
Date: Wed, 5 Mar 2025 13:26:20 +0100
Subject: [PATCH 2/2] chore: migration des fichiers de langue vers leur
 nouvelle syntaxe (suite...)

Fix: #4685
---
 lang/odtspip_de.php         | 15 ++++++---------
 lang/odtspip_en.php         |  7 ++-----
 lang/odtspip_it.php         | 15 +++++++--------
 lang/odtspip_ro.php         | 15 +++++++--------
 lang/paquet-odt2spip_en.php | 10 +++-------
 lang/paquet-odt2spip_fr.php | 10 +++-------
 6 files changed, 28 insertions(+), 44 deletions(-)

diff --git a/lang/odtspip_de.php b/lang/odtspip_de.php
index 02b93a2..708ea83 100644
--- a/lang/odtspip_de.php
+++ b/lang/odtspip_de.php
@@ -13,13 +13,13 @@
  *
  */
 
-$GLOBALS[$GLOBALS['idx_lang']] = array(
+return [
 	// A
 	'attacher_fichier_odt' => 'ODT-Datei an Artikel anh&auml;ngen?',
 
 	// C
 	'choix_fichier' => 'Diese ODT-Datei benutzen: ',
-		
+
 	// D
 	'mode_document' => 'Dokumente',
 
@@ -36,9 +36,9 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
 	'images_mode_document' => 'Bilder f&uuml;r Artikel speichern als:',
 	'mode_image' => 'Bilder',
 	'importer_fichier' => 'ODT-Datei in Artikel umwandeln',
-		
+
 	// L
-	'langue_publication' => 'Sprache des Artikels', 
+	'langue_publication' => 'Sprache des Artikels',
 
 	// N
 	'non' => 'nein',
@@ -47,8 +47,5 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
 	'oui' => 'ja',
 
 	// T
-	'cet_article_version_odt' => 'OOo-Writer-Version dieses Artikels' 
-
-);
-
-?>
+	'cet_article_version_odt' => 'OOo-Writer-Version dieses Artikels',
+];
diff --git a/lang/odtspip_en.php b/lang/odtspip_en.php
index daed131..a10b717 100644
--- a/lang/odtspip_en.php
+++ b/lang/odtspip_en.php
@@ -13,7 +13,7 @@
  *
  */
 
-$GLOBALS[$GLOBALS['idx_lang']] = array(
+return [
 	// A
 	'attacher_fichier_odt' => 'Attach the ODT file to the article ?',
 	'attacher_fichier_source' => 'Attach the file to the article ?',
@@ -73,7 +73,4 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
 
 	// T
 	'titre_page_configurer' => 'Configuration of odt2spip plugin',
-
-);
-
-?>
+];
diff --git a/lang/odtspip_it.php b/lang/odtspip_it.php
index 4cf0d15..784a95a 100644
--- a/lang/odtspip_it.php
+++ b/lang/odtspip_it.php
@@ -13,10 +13,10 @@
  *
  */
 
-	$GLOBALS[$GLOBALS['idx_lang']] = array(
+return [
     // A
         'attacher_fichier_odt' => 'Allegare il file ODT all\'articolo?',
-  
+
     // C
 			'choix_fichier' => 'File ODT da utilizzare : ',
 
@@ -31,14 +31,13 @@
 
     // I
         'importer_fichier' => 'Generare un articolo a partire da un file OOo Writer',
-        
+
     // N
         'non' => 'no',
-        
+
     // O
         'oui' => 's&igrave;',
-    
+
 		// T
-        'cet_article_version_odt' => 'Versione OOo Writer di questo articolo' 
-	);
-?>
+        'cet_article_version_odt' => 'Versione OOo Writer di questo articolo'
+];
diff --git a/lang/odtspip_ro.php b/lang/odtspip_ro.php
index 0e7ccb7..8036921 100644
--- a/lang/odtspip_ro.php
+++ b/lang/odtspip_ro.php
@@ -13,10 +13,10 @@
  *
  */
 
-$GLOBALS[$GLOBALS['idx_lang']] = array(
+return [
 	// A
 	'attacher_fichier_odt' => 'Atasezi fisierul ODT la articol?',
- 
+
 	// C
 	'choix_fichier' => 'Fisierul ODT pentru a fi folosit:',
 
@@ -30,14 +30,13 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
 
 	// I
 	'importer_fichier' => 'Creare de articol din fisierul Ooo Writer',
-	   
+
 	// N
 	'non' => 'nu',
-	   
+
 	// O
 	'oui' => 'da',
-   
+
 	// T
-	'cet_article_version_odt' => 'Versiunea Ooo Writer a articolului' 
-);
-?>
+	'cet_article_version_odt' => 'Versiunea Ooo Writer a articolului'
+];
diff --git a/lang/paquet-odt2spip_en.php b/lang/paquet-odt2spip_en.php
index 65a403d..0252b52 100644
--- a/lang/paquet-odt2spip_en.php
+++ b/lang/paquet-odt2spip_en.php
@@ -8,12 +8,8 @@
 // Date: 02-04-2013 11:45:38
 // Items: 2
 
-if (!defined('_ECRIRE_INC_VERSION')) return;
-
-$GLOBALS[$GLOBALS['idx_lang']] = array(
-
-// O
+return [
+	// O
 	'odt2spip_description' => 'Spip\'s articles generator from OpenOffice or LibreOffice Writer files (.odt)',
 	'odt2spip_slogan' => 'Spip\'s articles generator from .odt files',
-);
-
+];
diff --git a/lang/paquet-odt2spip_fr.php b/lang/paquet-odt2spip_fr.php
index 46306d4..4b2cc35 100644
--- a/lang/paquet-odt2spip_fr.php
+++ b/lang/paquet-odt2spip_fr.php
@@ -8,14 +8,10 @@
 // Date: 02-04-2013 11:45:38
 // Items: 2
 
-if (!defined('_ECRIRE_INC_VERSION')) return;
-
-$GLOBALS[$GLOBALS['idx_lang']] = array(
-
-// O
+return [
+	// O
 	'odt2spip_description' => 'générateur d\'articles spip à partir de fichiers OpenOffice ou LibreOffice Writer (.odt)
 _ La transformation des fichiers ODT impose que l\'extension XSL de PHP soit active.
 _ La conversion des formules mathématiques repose sur la librairie XSLT {{MathML 2.0 to LaTeX}} de Vasil Yaroshevich [->http://www.raleigh.ru/MathML/mmltex/index.php?lang=en]',
 	'odt2spip_slogan' => 'générateur d\'articles spip à partir de fichiers .odt',
-);
-
+];
-- 
GitLab