packages feed

reflex-localize-dom 1.0.0.0 → 1.0.3.0

raw patch · 3 files changed

+28/−4 lines, 3 filesdep ~reflex-localizePVP ok

version bump matches the API change (PVP)

Dependency ranges changed: reflex-localize

API changes (from Hackage documentation)

+ Reflex.Localize.Dom: localizedDyn :: (MonadLocalized t m, LocalizedPrint a) => Dynamic t a -> m (Dynamic t Text)
+ Reflex.Localize.Dom: localizedDynText :: (MonadLocalized t m, LocalizedPrint a, PostBuild t m, DomBuilder t m) => Dynamic t a -> m ()

Files

CHANGELOG.md view
@@ -1,3 +1,15 @@+# 1.0.3.0++* Allow `reflex-localize-1.1`++# 1.0.2.0++* Remove warnings++# 1.0.1.0++* Add two new helper functions: ``localizedDyn`` and ``localizedDynText``+ # 1.0.0.0  * Initial release
reflex-localize-dom.cabal view
@@ -1,5 +1,5 @@ name:                reflex-localize-dom-version:             1.0.0.0+version:             1.0.3.0 synopsis:            Helper widgets for reflex-localize description:         Library provides helpers for dynamic strings that depends on current selected language. stability:           Experimental@@ -17,7 +17,7 @@ maintainer:          - Anton Gushcha <ncrashed@gmail.com>                      - Aminion <>                      - Vladimir Krutkin <krutkinvs@gmail.com>-                     - Levon Oganyan+                     - Levon Oganyan <lemarwin42@protonmail.com> bug-reports:         https://github.com/hexresearch/ergvein/issues homepage:            https://github.com/hexresearch/ergvein extra-source-files:@@ -37,7 +37,7 @@     , containers     , reflex                    >= 0.4      && < 0.9     , reflex-dom                >= 0.6      && < 0.9-    , reflex-localize           >= 1.0      && < 1.1+    , reflex-localize           >= 1.0      && < 1.2     , text   default-language:    Haskell2010   default-extensions:
src/Reflex/Localize/Dom.hs view
@@ -8,11 +8,14 @@ -- -- Dom helpers to show localized --+{-# OPTIONS_GHC -Wno-orphans #-} module Reflex.Localize.Dom(     localizedText   , localizedTextWith   , localizedTextLower   , localizedTextUpper+  , localizedDyn+  , localizedDynText   , languageDropdown   , module Reflex.Localize   ) where@@ -22,7 +25,6 @@ import Reflex.Dom import Reflex.Localize import Reflex.Localize.Language-import Reflex.Localize.Trans  import qualified Data.Text as T import qualified Data.Map.Strict as M@@ -57,5 +59,15 @@ -- | Same as `localizedText` but transforms text to upper case. localizedTextUpper :: (MonadLocalized t m, LocalizedPrint a, PostBuild t m, DomBuilder t m) => a -> m () localizedTextUpper = localizedTextWith T.toUpper++-- | Same as 'localized', but takes a dynamic value as input+localizedDyn :: (MonadLocalized t m, LocalizedPrint a) => Dynamic t a -> m (Dynamic t Text)+localizedDyn valD = do+  langD <- getLanguage+  pure $ localizedShow <$> langD <*> valD++-- | Same as 'localizedText', but takes a dynamic value as input+localizedDynText :: (MonadLocalized t m, LocalizedPrint a, PostBuild t m, DomBuilder t m) => Dynamic t a -> m ()+localizedDynText valD = dynText =<< localizedDyn valD  deriving instance DomBuilder t m => DomBuilder t (LocalizeT t m)