Merge pull request #1457 from bermanjosh/langFix

Fix docs on `languages` set and `getMessageRender` to use it (#1325)
This commit is contained in:
Michael Snoyman 2017-11-26 12:40:56 +02:00 committed by GitHub
commit 18de949b03
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 5 deletions

View File

@ -1,3 +1,6 @@
## 1.4.37.1
* Fix documentation on `languages` function, update `getMessageRender` to use said function. [#1457] (https://github.com/yesodweb/yesod/pull/1457)
## 1.4.37 ## 1.4.37
* Add `setWeakEtag` function in Yesod.Core.Handler module. * Add `setWeakEtag` function in Yesod.Core.Handler module.

View File

@ -1079,7 +1079,7 @@ getMessageRender :: (MonadHandler m, RenderMessage (HandlerSite m) message)
=> m (message -> Text) => m (message -> Text)
getMessageRender = do getMessageRender = do
env <- askHandlerEnv env <- askHandlerEnv
l <- reqLangs <$> getRequest l <- languages
return $ renderMessage (rheSite env) l return $ renderMessage (rheSite env) l
-- | Use a per-request cache to avoid performing the same action multiple times. -- | Use a per-request cache to avoid performing the same action multiple times.
@ -1130,15 +1130,15 @@ cachedBy k action = do
-- | Get the list of supported languages supplied by the user. -- | Get the list of supported languages supplied by the user.
-- --
-- Languages are determined based on the following three (in descending order -- Languages are determined based on the following (in descending order
-- of preference): -- of preference):
-- --
-- * The _LANG user session variable.
--
-- * The _LANG get parameter. -- * The _LANG get parameter.
-- --
-- * The _LANG cookie. -- * The _LANG cookie.
-- --
-- * The _LANG user session variable.
--
-- * Accept-Language HTTP header. -- * Accept-Language HTTP header.
-- --
-- Yesod will seek the first language from the returned list matched with languages supporting by your application. This language will be used to render i18n templates. -- Yesod will seek the first language from the returned list matched with languages supporting by your application. This language will be used to render i18n templates.

View File

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