From c3c014a477b2b010cd336d2ab47906295ace1661 Mon Sep 17 00:00:00 2001
From: Robert Alessi <alessi@robertalessi.net>
Date: Sat, 11 Jul 2020 16:19:20 +0200
Subject: added support for polyglossia

---
 ekdosis.dtx | 34 +++++++++++++++++++++++++++++-----
 1 file changed, 29 insertions(+), 5 deletions(-)

(limited to 'ekdosis.dtx')

diff --git a/ekdosis.dtx b/ekdosis.dtx
index fe4d6d8..871fa81 100644
--- a/ekdosis.dtx
+++ b/ekdosis.dtx
@@ -3126,7 +3126,11 @@ texts=latin[xml:lang="la"]+\textcolor{red}{;}+
         \ltx@ifpackageloaded{babel}%
           {\noexpand\selectlanguage{\languagename}%
             \unexpanded\expandafter{\ekdlr@alt}}%
-          {\unexpanded\expandafter{\ekdlr@alt}}%
+          {\lxt@ifpackageloaded{polyglossia}%
+            {\noexpand\seleclanguage{\languageid{bcp-47}}%
+            \unexpanded\expandafter{\ekdlr@alt}}%
+            {\unexpanded\expandafter{\ekdlr@alt}}%
+          }%
         \ifdefined\ekdlr@post%
           \space\unexpanded\expandafter{\ekdlr@post}\space\else\fi
       \else
@@ -3134,7 +3138,11 @@ texts=latin[xml:lang="la"]+\textcolor{red}{;}+
           \space\unexpanded\expandafter{\ekdlr@pre}\space\else\fi
           \ltx@ifpackageloaded{babel}%
           {\noexpand\selectlanguage{\languagename}\unexpanded{#2}}{%
+            \ltx@ifpackageloaded{polyglossia}%
+            {\noexpand\selectlanguage{\languageid{bcp-47}}%
             \unexpanded{#2}}%
+            {\unexpanded{#2}}%
+          }%
         \ifdefined\ekdlr@post%
           \space\unexpanded\expandafter{\ekdlr@post}\space\else\fi
       \fi
@@ -3207,7 +3215,11 @@ texts=latin[xml:lang="la"]+\textcolor{red}{;}+
         \ltx@ifpackageloaded{babel}%
           {\noexpand\selectlanguage{\languagename}%
             \unexpanded\expandafter{\ekdlr@alt}}%
-          {\unexpanded\expandafter{\ekdlr@alt}}%
+          {\ltx@ifpackageloaded{polyglossia}%
+            {\noexpand\selectlanguage{\languageid{bcp-47}}%
+              \unexpanded\expandafter{\ekdlr@alt}}%
+            {\unexpanded\expandafter{\ekdlr@alt}}%
+          }%
         \ifdefined\ekdlr@post%
           \space\unexpanded\expandafter{\ekdlr@post}\space\else\fi
       \else
@@ -3215,7 +3227,11 @@ texts=latin[xml:lang="la"]+\textcolor{red}{;}+
           \space\unexpanded\expandafter{\ekdlr@pre}\space\else\fi
           \ltx@ifpackageloaded{babel}%
           {\noexpand\selectlanguage{\languagename}\unexpanded{#2}}{%
-            \unexpanded{#2}}%
+            \ltx@ifpackageloaded{polyglossia}%
+            {\noexpand\selectlanguage{\languageid{bcp-47}}%
+              \unexpanded{#2}}%
+            {\unexpanded{#2}}%
+          }%
         \ifdefined\ekdlr@post%
           \space\unexpanded\expandafter{\ekdlr@post}\space\else\fi
       \fi
@@ -3307,11 +3323,19 @@ texts=latin[xml:lang="la"]+\textcolor{red}{;}+
         \ltx@ifpackageloaded{babel}%
           {\noexpand\selectlanguage{\languagename}%
             \unexpanded\expandafter{\ekdn@lem}}%
-          {\unexpanded\expandafter{\ekdn@lem}}%
+          {\ltx@ifpackageloaded{polyglossia}%
+            {\noexpand\selectlanguage{\languageid{bcp-47}}%
+              \unexpanded\expandafter{\ekdn@lem}}%
+            {\unexpanded\expandafter{\ekdn@lem}}%
+          }%
           \unexpanded\expandafter{\ekdn@sep}\else\fi%
           \ltx@ifpackageloaded{babel}%
           {\noexpand\selectlanguage{\languagename}\unexpanded{#2}}{%
-            \unexpanded{#2}}}}%
+            \ltx@ifpackageloaded{polyglossia}%
+            {\noexpand\selectlanguage{\languageid{bcp-47}}%
+              \unexpanded{#2}}%
+            {\unexpanded{#2}}%
+          }}}%
   \ifekd@mapps%
   \unconditional@appin[\ekdan@type]{\note@contents}%
   \else%
-- 
cgit v1.2.3

