diff --git a/yesod-core/ChangeLog.md b/yesod-core/ChangeLog.md index 75708658..c3ff22fe 100644 --- a/yesod-core/ChangeLog.md +++ b/yesod-core/ChangeLog.md @@ -1,3 +1,8 @@ +## 1.4.26 + +* Modify `languages` so that, if you previously called `setLanguage`, the newly + set language will be reflected. + ## 1.4.25 * Add instance of MonadHandler and MonadWidget for ExceptT [#1278](https://github.com/yesodweb/yesod/pull/1278) diff --git a/yesod-core/Yesod/Core/Handler.hs b/yesod-core/Yesod/Core/Handler.hs index 53759125..087e3bf7 100644 --- a/yesod-core/Yesod/Core/Handler.hs +++ b/yesod-core/Yesod/Core/Handler.hs @@ -1053,7 +1053,10 @@ cachedBy k action = do -- -- This is handled by parseWaiRequest (not exposed). languages :: MonadHandler m => m [Text] -languages = reqLangs <$> getRequest +languages = do + mlang <- lookupSession langKey + langs <- reqLangs <$> getRequest + return $ maybe id (:) mlang langs lookup' :: Eq a => a -> [(a, b)] -> [b] lookup' a = map snd . filter (\x -> a == fst x) diff --git a/yesod-core/yesod-core.cabal b/yesod-core/yesod-core.cabal index fe728717..382bc965 100644 --- a/yesod-core/yesod-core.cabal +++ b/yesod-core/yesod-core.cabal @@ -1,5 +1,5 @@ name: yesod-core -version: 1.4.25 +version: 1.4.26 license: MIT license-file: LICENSE author: Michael Snoyman