EPUB reader: convert e.g. en_US from locale to en-US in language.
This commit is contained in:
parent
95b0f28831
commit
4a17d661ff
1 changed files with 2 additions and 1 deletions
|
@ -128,7 +128,8 @@ writeEPUB mbStylesheet fonts opts doc@(Pandoc meta _) = do
|
|||
let chapterEntries = zipWith chapterToEntry [1..] chapters
|
||||
|
||||
-- contents.opf
|
||||
localeLang <- catch (liftM (takeWhile (/='.')) $ getEnv "LANG")
|
||||
localeLang <- catch (liftM (map (\c -> if c == '_' then '-' else c) .
|
||||
takeWhile (/='.')) $ getEnv "LANG")
|
||||
(\e -> let _ = (e :: SomeException) in return "en-US")
|
||||
let lang = case lookup "lang" (writerVariables opts') of
|
||||
Just x -> x
|
||||
|
|
Loading…
Reference in a new issue