chore(letter): allow for more different driving licence names in letters
This commit is contained in:
parent
0725a9a908
commit
073432c75b
@ -56,23 +56,36 @@ defaultNotice renewAuto l qualName qualShort newExpire
|
|||||||
, "(Kontaktieren Sie uns bitte, um zukünftige Briefe von uns in deutscher Sprache zu erhalten.)"
|
, "(Kontaktieren Sie uns bitte, um zukünftige Briefe von uns in deutscher Sprache zu erhalten.)"
|
||||||
]
|
]
|
||||||
|
|
||||||
|
isAnyDrivingLicence :: Text -> Maybe Text
|
||||||
|
-- isAnyDrivingLicence = firstJust (Text.stripSuffix "führerschein") . Text.words . Text.replace "-" " " . Text.replace "+" ""
|
||||||
|
isAnyDrivingLicence = firstJust (Text.stripSuffix "führerschein") . Text.words . Text.map anyNonAlphaToBlank
|
||||||
|
|
||||||
|
anyNonAlphaToBlank :: Char -> Char
|
||||||
|
anyNonAlphaToBlank c
|
||||||
|
| Char.isAlpha c
|
||||||
|
= c
|
||||||
|
| otherwise = ' '
|
||||||
|
|
||||||
qualificationText :: Lang -> Text -> Text -> (Text, Text, Text) -- (qarea, qformal, qlicence) i.e. (Rollfeld, Rollfeldfahrberechtigung, Rollfeldführerschein) translated
|
qualificationText :: Lang -> Text -> Text -> (Text, Text, Text) -- (qarea, qformal, qlicence) i.e. (Rollfeld, Rollfeldfahrberechtigung, Rollfeldführerschein) translated
|
||||||
qualificationText l qName@(Text.stripSuffix "führerschein" -> Just qPrefix) qShort
|
|
||||||
| isDe l
|
|
||||||
= (qPrefix, [st|Fahrberechtigung „#{qShort}“|], qName)
|
|
||||||
| qShort == "F"
|
|
||||||
= ("apron", [st|driving licence "#{qShort}"|], "apron driving licence")
|
|
||||||
| qShort == "R"
|
|
||||||
= ("maneuvering area", [st|driving licence "#{qShort}"|], "maneuvering area driving licence")
|
|
||||||
| otherwise
|
|
||||||
= (qPrefix, qPrefix <> " driving licence", qName)
|
|
||||||
qualificationText l _qName "GSS"
|
qualificationText l _qName "GSS"
|
||||||
| isDe l
|
| isDe l
|
||||||
= ("Gabelstapler", "Fahrberechtigung Gabelstapler", "Gabelstaplerführerschein")
|
= ("Gabelstapler", "Fahrberechtigung Gabelstapler", "Gabelstaplerführerschein")
|
||||||
| otherwise
|
| otherwise
|
||||||
= ("Forklift", "forklift driving licence", "forklift driving licence")
|
= ("forklift", "forklift driving licence", "forklift driving licence")
|
||||||
qualificationText _l qName qShort
|
qualificationText l qName@(isAnyDrivingLicence -> Just qPrefix) qShort
|
||||||
|
| isDe l
|
||||||
|
= (qPrefix, [st|Fahrberechtigung „#{qShort}“|], qName)
|
||||||
|
| qShort == "F"
|
||||||
|
= ("apron", [st|driving licence "#{qShort}"|], "apron driving licence")
|
||||||
|
| Text.isPrefixOf "R" qShort
|
||||||
|
= ("maneuvering area", [st|driving licence "#{qShort}"|], "maneuvering area driving licence")
|
||||||
|
| otherwise
|
||||||
|
= (qPrefix, qPrefix <> " driving licence", qName)
|
||||||
|
qualificationText l qName qShort
|
||||||
|
| isDe l
|
||||||
= (qShort, [st|Fahrberechtigung „#{qShort}“|], qName)
|
= (qShort, [st|Fahrberechtigung „#{qShort}“|], qName)
|
||||||
|
| otherwise
|
||||||
|
= (qShort, [st|driving licence "#{qShort}"|], qName)
|
||||||
|
|
||||||
|
|
||||||
data LetterRenewQualification = LetterRenewQualification
|
data LetterRenewQualification = LetterRenewQualification
|
||||||
|
|||||||
@ -128,7 +128,7 @@ we require by **$expiry$**, that the
|
|||||||
$if(practical)$
|
$if(practical)$
|
||||||
theorectical and practical
|
theorectical and practical
|
||||||
$endif$
|
$endif$
|
||||||
airport-specific recurrent training at Fraport AG,
|
airport-specific $qarea$ recurrent training at Fraport AG,
|
||||||
according to European Union Regulation No. 139/2014,
|
according to European Union Regulation No. 139/2014,
|
||||||
has been completed.
|
has been completed.
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user