aboutsummaryrefslogtreecommitdiff
path: root/src/Text
diff options
context:
space:
mode:
authorJohn MacFarlane <fiddlosopher@gmail.com>2012-01-01 14:32:27 -0800
committerJohn MacFarlane <fiddlosopher@gmail.com>2012-01-01 14:32:27 -0800
commit4e30f24974a2aa698afcb7b3e639030c816e0a41 (patch)
treeddc3074827e0bb5e3ba94808f6b1eb4460d37af3 /src/Text
parentda8425598a8ab4a98388e8ee346a2ae7ec540aa0 (diff)
downloadpandoc-4e30f24974a2aa698afcb7b3e639030c816e0a41.tar.gz
EPUB writer: Allow `lang` variable to set language in metadata.
Defaults to locale language if `lang` is not set.
Diffstat (limited to 'src/Text')
-rw-r--r--src/Text/Pandoc/Writers/EPUB.hs7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/Text/Pandoc/Writers/EPUB.hs b/src/Text/Pandoc/Writers/EPUB.hs
index a817f07a5..af907a809 100644
--- a/src/Text/Pandoc/Writers/EPUB.hs
+++ b/src/Text/Pandoc/Writers/EPUB.hs
@@ -120,8 +120,11 @@ writeEPUB mbStylesheet opts doc@(Pandoc meta _) = do
let chapterEntries = zipWith chapterToEntry [1..] chapters
-- contents.opf
- lang <- catch (liftM (takeWhile (/='.')) $ getEnv "LANG")
- (\_ -> return "en-US")
+ localeLang <- catch (liftM (takeWhile (/='.')) $ getEnv "LANG")
+ (\_ -> return "en-US")
+ let lang = case lookup "lang" (writerVariables opts') of
+ Just x -> x
+ Nothing -> localeLang
uuid <- getRandomUUID
let chapterNode ent = unode "item" !
[("id", takeBaseName $ eRelativePath ent),