From 40f14f355cd68d9c2fbd0567af041098bfd32452 Mon Sep 17 00:00:00 2001
From: Boris Paing <boris.paing@laposte.net>
Date: Fri, 27 Mar 2020 12:37:22 +0100
Subject: [PATCH] FIX: locales handling

---
 head.php              | 4 ++++
 tpl/download.php      | 2 --
 tpl/features.php      | 4 ++--
 tpl/funding-alt-1.php | 1 +
 tpl/funding-orig.php  | 1 +
 tpl/home.php          | 5 +++--
 tpl/jobs.php          | 2 +-
 tpl/legal-notice.php  | 1 +
 tpl/tuto.php          | 3 +++
 9 files changed, 16 insertions(+), 7 deletions(-)

diff --git a/head.php b/head.php
index f74cd50..fefbd64 100644
--- a/head.php
+++ b/head.php
@@ -53,6 +53,7 @@ $bodyIds = !isset($bodyIds) ? '' : $bodyIds;
 	</head>
 	<body id="<?php echo $bodyIds; ?>">
 			<?php
+				$currentPageTextDomain = textdomain();
 				textdomain("menu");
 
 				$menu =
@@ -122,3 +123,6 @@ $bodyIds = !isset($bodyIds) ? '' : $bodyIds;
 			</header>
 			
 			<main>
+			<?php
+				textdomain($currentPageTextDomain);
+			?>
\ No newline at end of file
diff --git a/tpl/download.php b/tpl/download.php
index 00ed327..f2f1ad4 100644
--- a/tpl/download.php
+++ b/tpl/download.php
@@ -9,8 +9,6 @@ include('cesiumDownloads.php');
 
 include('head.php');
 
-textdomain('download');
-
 ?>
 
 
diff --git a/tpl/features.php b/tpl/features.php
index 33f6574..b392305 100644
--- a/tpl/features.php
+++ b/tpl/features.php
@@ -1,12 +1,12 @@
 <?php
 
+textdomain('features');
+
 $pageTitle = _('Fonctionnalités');
 $pageDescription = _("Fonctionnalités de Cesium : gérer son comptes monnaie libre Ğ1, rechercher des membres dans l'annuaire, trouver des entreprises qui acceptent la Ğ1.");
 
 include('head.php');
 
-textdomain('features');
-
 ?>
 <article id="features">
 	
diff --git a/tpl/funding-alt-1.php b/tpl/funding-alt-1.php
index eb031a2..7b72e4b 100644
--- a/tpl/funding-alt-1.php
+++ b/tpl/funding-alt-1.php
@@ -1,4 +1,5 @@
 <?php
+textdomain('funding');
 
 $pageTitle = _("Coucou");
 $pageDescription = _("");
diff --git a/tpl/funding-orig.php b/tpl/funding-orig.php
index 113675b..3881b39 100644
--- a/tpl/funding-orig.php
+++ b/tpl/funding-orig.php
@@ -1,4 +1,5 @@
 <?php
+textdomain('funding');
 
 $pageTitle = _("Coucou");
 $pageDescription = _("");
diff --git a/tpl/home.php b/tpl/home.php
index 76edefb..f3bfaed 100644
--- a/tpl/home.php
+++ b/tpl/home.php
@@ -1,4 +1,7 @@
 <?php
+
+textdomain('home');
+
 $bodyIds = 'home';
 
 $pageTitle = _('Cesium Ğ1 - Site officiel');
@@ -6,8 +9,6 @@ $pageDescription = _("Cesium est l'application la plus intuitive pour gérer vot
 
 include('head.php');
 
-textdomain('home');
-
 ?>
 
 <section id="showcase">
diff --git a/tpl/jobs.php b/tpl/jobs.php
index cb1a01f..14e7f4b 100644
--- a/tpl/jobs.php
+++ b/tpl/jobs.php
@@ -1,5 +1,5 @@
 <?php
-
+textdomain('jobs');
 
 $pageTitle = _("Rejoignez l'équipe");
 $pageDescription = _("");
diff --git a/tpl/legal-notice.php b/tpl/legal-notice.php
index d4d2073..81eadd8 100644
--- a/tpl/legal-notice.php
+++ b/tpl/legal-notice.php
@@ -1,4 +1,5 @@
 <?php
+textdomain('legal-notice');
 
 $pageTitle = _("Mentions légales");
 $pageDescription = _("");
diff --git a/tpl/tuto.php b/tpl/tuto.php
index 8e7e582..2613968 100644
--- a/tpl/tuto.php
+++ b/tpl/tuto.php
@@ -1,4 +1,7 @@
 <?php
+
+textdomain('tuto');
+
 $pageTitle = '';
 
 $tutoURL = $rootURL . '/' . LANG . dgettext('menu', $pagePermalink) . '/';
-- 
GitLab