diff options
Diffstat (limited to 'src/Text/Pandoc/Logging.hs')
-rw-r--r-- | src/Text/Pandoc/Logging.hs | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/Text/Pandoc/Logging.hs b/src/Text/Pandoc/Logging.hs index ac45b0a66..832a1f4df 100644 --- a/src/Text/Pandoc/Logging.hs +++ b/src/Text/Pandoc/Logging.hs @@ -95,6 +95,8 @@ data LogMessage = | CouldNotHighlight String | MissingCharacter String | Deprecated String String + | NoTranslation String + | CouldNotLoadTranslations String String deriving (Show, Eq, Data, Ord, Typeable, Generic) instance ToJSON LogMessage where @@ -195,6 +197,11 @@ instance ToJSON LogMessage where Deprecated thing msg -> ["thing" .= Text.pack thing, "message" .= Text.pack msg] + NoTranslation term -> + ["term" .= Text.pack term] + CouldNotLoadTranslations lang msg -> + ["lang" .= Text.pack lang, + "message" .= Text.pack msg] showPos :: SourcePos -> String @@ -282,6 +289,11 @@ showLogMessage msg = if null m then "" else ". " ++ m + NoTranslation t -> + "The term " ++ t ++ " has no translation defined." + CouldNotLoadTranslations lang m -> + "Could not load translations for " ++ lang ++ + if null m then "" else ('\n':m) messageVerbosity:: LogMessage -> Verbosity messageVerbosity msg = @@ -314,3 +326,5 @@ messageVerbosity msg = CouldNotHighlight{} -> WARNING MissingCharacter{} -> WARNING Deprecated{} -> WARNING + NoTranslation{} -> WARNING + CouldNotLoadTranslations{} -> WARNING |