git.iko.soy/typeable/pandoc
on master help sign in
Bibtex reader: fall back on en-US if locale for LANG not found.
efa34a8John MacFarlane
src/Text/Pandoc/Readers/BibTeX.hs+4−1
@@ -51,7 +51,10 @@ readBibTeX' variant _opts t = do
51 lang <- maybe (Lang "en" (Just "US")) parseLang
51 lang <- maybe (Lang "en" (Just "US")) parseLang
52 <$> lookupEnv "LANG"
52 <$> lookupEnv "LANG"
53 locale <- case getLocale lang of
53 locale <- case getLocale lang of
54+ Left e ->
55+ case getLocale (Lang "en" (Just "US")) of
56+ Right l -> return l
54− Left e -> throwError $ PandocCiteprocError e
57+ Left _ -> throwError $ PandocCiteprocError e
55 Right l -> return l
58 Right l -> return l
56 case BibTeX.readBibtexString variant locale (const True) t of
59 case BibTeX.readBibtexString variant locale (const True) t of
57 Left e -> throwError $ PandocParsecError t e
60 Left e -> throwError $ PandocParsecError t e