From e517a8e4701f2df2f1a39e3ed16db0e5e3393ea1 Mon Sep 17 00:00:00 2001 From: Sarah Vaupel Date: Thu, 31 Oct 2019 13:47:31 +0100 Subject: [PATCH] fix: fix i18n widget files --- src/Handler/Utils/I18n.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Handler/Utils/I18n.hs b/src/Handler/Utils/I18n.hs index 18c27ce84..6c6ec72bf 100644 --- a/src/Handler/Utils/I18n.hs +++ b/src/Handler/Utils/I18n.hs @@ -57,7 +57,7 @@ i18nWidgetFilesAvailable' basename = do let fileKinds' = fmap (pack . dropExtension . takeBaseName &&& toTranslation . pack . takeBaseName) availableFiles fileKinds :: Map Text [Text] fileKinds = sortWith (NTop . flip List.elemIndex (NonEmpty.toList appLanguages)) . Set.toList <$> Map.fromListWith Set.union [ (kind, Set.singleton l) | (kind, Just l) <- fileKinds' ] - toTranslation fName = listToMaybe . sortOn length . mapMaybe (flip Text.stripPrefix fName) $ map fst fileKinds' + toTranslation fName = listToMaybe . sortOn length . mapMaybe (flip Text.stripPrefix fName . (<>".")) $ map fst fileKinds' availableTranslations' <- iforM fileKinds $ \kind -> maybe (fail $ "‘" <> i18nDirectory <> "’ has no translations for ‘" <> unpack kind <> "’") return . NonEmpty.nonEmpty