languages reflects setLanguage
This commit is contained in:
parent
f9927530b4
commit
bbca01ce71
@ -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)
|
||||
|
||||
@ -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)
|
||||
|
||||
@ -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>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user