Merge pull request #1290 from yesodweb/languages-checks-setLanguage

languages reflects setLanguage
This commit is contained in:
Michael Snoyman 2016-11-10 11:31:33 +02:00 committed by GitHub
commit fec96bc57c
3 changed files with 10 additions and 2 deletions

View File

@ -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)

View File

@ -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)

View File

@ -1,5 +1,5 @@
name: yesod-core
version: 1.4.25
version: 1.4.26
license: MIT
license-file: LICENSE
author: Michael Snoyman <michael@snoyman.com>