aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn MacFarlane <[email protected]>2023-03-10 13:52:12 -0800
committerJohn MacFarlane <[email protected]>2023-03-10 13:52:12 -0800
commit5b78210ebebba263d8d594b8c62c724baa7e808f (patch)
tree9c38bbf2e1e07004b5490d23b0ca1926cfae08c7
parent8c017174d4096fbd2236e66e4bf8f815958a3a61 (diff)
LaTeX writer: Add Chinese to Babel languages.
-rw-r--r--src/Text/Pandoc/Writers/LaTeX/Lang.hs9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/Text/Pandoc/Writers/LaTeX/Lang.hs b/src/Text/Pandoc/Writers/LaTeX/Lang.hs
index 2e8259a5b..ebbf2ad41 100644
--- a/src/Text/Pandoc/Writers/LaTeX/Lang.hs
+++ b/src/Text/Pandoc/Writers/LaTeX/Lang.hs
@@ -49,7 +49,14 @@ toBabel (Lang "la" _ _ vars _ _)
| "x-classic" `elem` vars = Just "classiclatin"
toBabel (Lang "pt" _ (Just "BR") _ _ _) = Just "brazilian"
toBabel (Lang "sl" _ _ _ _ _) = Just "slovene"
-toBabel x = commonFromBcp47 x
+toBabel (Lang "zh" (Just "Hant") (Just "HK") _ _ _) = Just "chinese-hant-hk"
+toBabel (Lang "zh" (Just "Hant") (Just "MO") _ _ _) = Just "chinese-hant-mo"
+toBabel (Lang "zh" (Just "Hans") (Just "HK") _ _ _) = Just "chinese-hans-hk"
+toBabel (Lang "zh" (Just "Hans") (Just "MO") _ _ _) = Just "chinese-hans-mo"
+toBabel (Lang "zh" (Just "Hans") _ _ _ _) = Just "chinese-hans"
+toBabel (Lang "zh" (Just "Hant") _ _ _ _) = Just "chinese-hant"
+toBabel (Lang "zh" _ _ _ _ _) = Just "chinese"
+toBabel x = commonFromBcp47 x
-- Takes a list of the constituents of a BCP47 language code
-- and converts it to a string shared by Babel and Polyglossia.