Merge pull request #1290 from yesodweb/languages-checks-setLanguage
languages reflects setLanguage
This commit is contained in:
commit
fec96bc57c
@ -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
|
## 1.4.25
|
||||||
|
|
||||||
* Add instance of MonadHandler and MonadWidget for ExceptT [#1278](https://github.com/yesodweb/yesod/pull/1278)
|
* Add instance of MonadHandler and MonadWidget for ExceptT [#1278](https://github.com/yesodweb/yesod/pull/1278)
|
||||||
|
|||||||
@ -1053,7 +1053,10 @@ cachedBy k action = do
|
|||||||
--
|
--
|
||||||
-- This is handled by parseWaiRequest (not exposed).
|
-- This is handled by parseWaiRequest (not exposed).
|
||||||
languages :: MonadHandler m => m [Text]
|
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' :: Eq a => a -> [(a, b)] -> [b]
|
||||||
lookup' a = map snd . filter (\x -> a == fst x)
|
lookup' a = map snd . filter (\x -> a == fst x)
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
name: yesod-core
|
name: yesod-core
|
||||||
version: 1.4.25
|
version: 1.4.26
|
||||||
license: MIT
|
license: MIT
|
||||||
license-file: LICENSE
|
license-file: LICENSE
|
||||||
author: Michael Snoyman <michael@snoyman.com>
|
author: Michael Snoyman <michael@snoyman.com>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user