Debian Codegraph @

importers/ding2tei/src/Data/NatLang/Language.hs

raw symbols SCIP
1 {-
2 - Data/NatLang/Language.hs - specific languages
3 -
4 - Copyright 2020 Einhard Leichtfuß
5 -
6 - This file is part of ding2tei-haskell.
7 -
8 - ding2tei-haskell is free software: you can redistribute it and/or modify
9 - it under the terms of the GNU Affero General Public License as published
10 - by the Free Software Foundation, either version 3 of the License, or
11 - (at your option) any later version.
12 -
13 - ding2tei-haskell is distributed in the hope that it will be useful,
14 - but WITHOUT ANY WARRANTY; without even the implied warranty of
15 - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 - GNU Affero General Public License for more details.
17 -
18 - You should have received a copy of the GNU Affero General Public License
19 - along with ding2tei-haskell. If not, see <https://www.gnu.org/licenses/>.
20 -}
21
22
23 {-|
24 - Natural language data types.
25 - Only English and German for now, the main languages of the Ding dictionary.
26 -}
27 module Data.NatLang.Language
28 ( Language(..)
29 , showCode
30 ) where
31
32
33 -- | There are more languages. They are not of particular importance for the
34 -- German-English Ding dictionary though.
35 data Language = German | English
36 deriving (Eq, Ord)
37
38
39 -- | Show the full language name, in English.
40 instance Show Language where
41 show German = "German"
42 show English = "English"
43
44
45 -- | Show short language code, as to be used in @xml:lang.
46 -- This is the ISO 639-1 code, unless no such one is available, where the
47 -- ISO 639-3 code is shown.
48 showCode :: Language -> String
49 showCode German = "de"
50 showCode English = "en"
51
52
53 -- vi: ft=haskell ts=2 sw=2 et